How to get the push notification batch number for Unity game?

0 votes
Hi This Subbu,

          Using App42 cloud api i am calling Push notifacations.I am getting push notifications in my game.But i am not getting the Batch number on game icon.What is the problem.Am i  write any code for batch number.same as reference image.
asked Mar 24, 2014 in App42 Cloud API-BaaS by subbu (11 points)

1 Answer

+1 vote

 If you want to send push message with sound and badge effect , you have to pass JSON string in your message like that.


string messsage = "{'alert':'Hi There...','badge':1,'sound':'default'}";  

answered Mar 24, 2014 by sshukla480 (407 points)
thanks for helping me.i pass json message.its always  my badge number is one.if i get more than one also.
string messsage = "{'alert':'Hi There...','badge':1,'sound':'default'}";
Even if i give string messsage = "{'alert':'Hi There...','badge':10,'sound':'default'}";
it will show 10 always.even if you send 1000 messages also.This is not correct any other way.
Auto increment on badge is not supported yet. This is planned in our release coming in mid of next month (15th April)
Hi,

For auto increment of push badge count  you need to send a JSON like {"badge":"increment"} , this will increment push badge count by 1 every time and to reset the value of push badge count you can use method of Unity like UpdatePushBadgeforDevice and UpdatePushBadgeforUser .

UpdatePushBadgeforDevice – This method is used to update push badge count of particular device registered of that user .
UpdatePushBadgeforUser – This method is used to update push badge count of all device of the user, for e.g. user having multiple device registered with same name.
Thank you!
hi,
how I get the total badge number(totalBadgeNumber)?  
When I have seen one message, I invoke UpdatePushBadgeforUser (username, totalBadgeNumber - 1) to set the badge number
Also, I invoke the UpdatePushBadgeforUser (username, 0) to zero the badge number, but this function isn't work, the badge number is till display at the icon.
hi, i am sorry, by test, the badge number has been set to zero, but the badge numbers is still display at the app icon.
Hi,
For maintaining the previous badge count, you have to store the badges on client side.

"UpdatePushBadgeforUser " will reset the badge number on the server side not the client side. To reset the values on the app icon, you need to reset it from the app when app is opened.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...