soumya
soumya

Reputation: 3811

can we show badge number on iPhone app using GCM notifications as APNS badge icon

can we show badge number on iPhone app using GCM notifications as APNS badge icon

As I couldn't set this using GCM. I have reffered this link which says

  Parameter      Platform          Usage                  Description

    badge         iOS             Optional,string   Indicates the badge on client app home icon.

I am receiving the notifications from GCM but badge icon is not shown when notifications are received in background state .

Can anyone please tell me how we can set this

Upvotes: 1

Views: 2466

Answers (1)

TheWonderBird
TheWonderBird

Reputation: 663

Badges do work. Here's my request, see how yours is different

curl -X POST --header "Content-Type:application/json" --header "Authorization:key=XXXXXXXXX" "https://gcm-http.googleapis.com/gcm/send" --data-ascii '{"to":"YYYYYYYYYYYYY","data":{"custom-key":"custom-value"},"priority":10,"notification":{"body":"Hello","badge":"2"}}'

Upvotes: 3

Related Questions