Moved from Github Issues: Sending Push Notifications on Android

54 views
Skip to first unread message

Aaron Schlesinger

unread,
Oct 29, 2011, 3:12:02 PM10/29/11
to stac...@googlegroups.com
from https://github.com/stackmob/StackMob_Android/issues/1#issuecomment-2566307:

I have done everything with the code. What should be done after getting the registrationId and the sending it to stackmob? How do I create a push notification and send it to the simulator? Sorry for asking these questions through email. Will follow up rest of the questions in case on the github so that others can know how to use it too.

Aaron Schlesinger

unread,
Oct 29, 2011, 3:15:35 PM10/29/11
to stac...@googlegroups.com
Charlie - you can use this to send the push notification:

Map<String, String> payload = new HashMap<String, String>();
payload.put("key1", "val1");
List<StackMobPushToken> tokens = new ArrayList<StackMobPushToken>();
tokens.add(new StackMobPushToken(registrationId, StackMobPushToken.TokenType.Android);//use the registration ID that you pulled out of the Intent here
stackmob.pushToTokens(payload, tokens, callback);
Reply all
Reply to author
Forward
0 new messages