Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge Count iOS #601

Open
kumaresan-cgvak opened this issue Jul 20, 2015 · 29 comments
Open

Badge Count iOS #601

kumaresan-cgvak opened this issue Jul 20, 2015 · 29 comments

Comments

@kumaresan-cgvak
Copy link

When the App becomes active, then the Badge Count is set to zero in the plugin at location as follows:

  1. In file "AppDelegate+notification.m"
  2. In method "- (void)applicationDidBecomeActive:(UIApplication *)application"
  3. at line number 90.
  4. Please remove this default reset of Badge Number. "application.applicationIconBadgeNumber = 0;"
@kumaresan-cgvak
Copy link
Author

Issue has been fixed in the Pull request "#602"

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

But i need to increment badges while receiving notification without tapping on it.Is there is a method to be called?

@kumaresan-cgvak
Copy link
Author

@ramyacl Then you need to send the updated badge count from server via notification payload along with the notification details. So, that iOS will automatically update the badge count.

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

Actually i need to do it on client side and i added cordova plugin add phonegap-plugin-push for push notification.please assist me how to do it on client side

@kumaresan-cgvak
Copy link
Author

Have a look at the Readme and feel free to ask your queries. https://github.com/phonegap-build/PushPlugin#-plugin-api

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

i tried this but still am not able to fix it

@kumaresan-cgvak
Copy link
Author

@ramyacl can you please elaborate about your issue.

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

I have added phonegap push plugin and it is working fine am receiving notification.In my server side am sending payload.addBadge(1);.so,whenever i push message from server it will remain badge number as 1.i tried to increment badge number in didReceiveRemoteNotification but it is incrementing onclick of notification.I need to increment my badge number when notification is received without any action by user.i need to do it on server side.Please help me on this

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

sorry i need to do it on client side

@kumaresan-cgvak
Copy link
Author

@ramyacl so, you just need to send the updated or new badge count payload.addBadge(1); from server side as follows

for first notification
payload.addBadge(1);

for second notification
payload.addBadge(2);

likewise.

So, that iOS will update it automatically without user action.

@kumaresan-cgvak
Copy link
Author

@ramyacl can you tell me the functionality for which you are using push-notficaiton?

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

actually i will send as payload.addBadge(1); for all the notification.From client side we need take the badge value from server side and increment it and update the incremented badge value to my app.Now the problem is how to increment the badge while receiving notifications.

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

how this payload.addBadge(1); is setting 1.payload will call which method in objective c?

@kumaresan-cgvak
Copy link
Author

@ramyacl it is automatically done by iOS. So we need to send the update value from server side. There is no delegate method for handling it.

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

Is there any possible to increment bage in client side with pushplugin?Becoz for android onMessage event is firing while receiving notification.

@kumaresan-cgvak
Copy link
Author

@ramyacl based on your scenario .. you need to update the count on server side.

@kumaresan-cgvak
Copy link
Author

@ramyacl in iOS it is handled by OS.

@ramyacl
Copy link

ramyacl commented Oct 6, 2015

In Server side can you please suggest how to do it and also please let me know the delegate method that should called while receiving notification.

@kumaresan-cgvak
Copy link
Author

@ramyacl can you tell me the scenario or functionality for which you are using pushnotification in you app?

@ramyacl
Copy link

ramyacl commented Oct 7, 2015

we are sending a message to the user when a case is raised. Now we want to display the message count at the corner of app icon. Now even if user get more than 1 message still badge(count) is showing only 1. How to increment and display.

@kumaresan-cgvak
Copy link
Author

@ramyacl implement a read status functionality. So if a case is read or viewed, the update the same to server from an app. So, when you send a new notification, you can get the number of unread case and increment it with one and send notification from server side.

@ramyacl
Copy link

ramyacl commented Oct 7, 2015

How to send the count from app to the server?

@kumaresan-cgvak
Copy link
Author

It is not count, you need to send read status to server via web service

@ramyacl
Copy link

ramyacl commented Oct 7, 2015

But if i received notification and i open the notification when am in offline how it will get update to the server.

@kumaresan-cgvak
Copy link
Author

It need to be tracked locally and updated to server when there is internet connection.

@ramyacl
Copy link

ramyacl commented Oct 8, 2015

Can you please suggest how to send the applicationIconBadgeNumber value from client side to java server side and also please help me how to increment in server side

@gladguy
Copy link

gladguy commented Apr 8, 2016

This is about incrementing the badge count in the server end.How i can track whether the notification send to the user is read or not. ?

For example : If i am sending badgecounts continuously incrementing then it would appear always higher values. How to track whether the user read the notification so, that i can reset the badge counter for that particular user device.

Thank you

@gladguy
Copy link

gladguy commented Apr 8, 2016

I have a problem in the PhoneGap splash screen and screen size.

Application is not coming in full screen. Size always there is some blank space in top and bottom of the phone and application is looking small.

@athirarenjan
Copy link

for setting the badge count in ios,you can mention the value in server side payload as
"badge":4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants