Created
November 11, 2014 17:41
-
-
Save CHLibrarian/8f369dfe08629a0f4e3c to your computer and use it in GitHub Desktop.
ContextHub Application Services Sending To Alias (Android)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Send a push notification to 2 devices, with aliases "Andy's Moto X" and "Chris' Nexus 5" | |
| String alias1 = "Andy's Moto X"; | |
| String alias2 = "Chris' Nexus 5"; | |
| SimplePushNotification notification = new SimplePushNotification("Test push notification message"); | |
| notification.getAliases().add(alias1); | |
| notification.getAliases().add(alias2); | |
| PushNotificationProxy proxy = new PushNotificationProxy(); | |
| proxy.sendSimplePushNotification(notification, new Callback<Object>() { | |
| @Override | |
| public void onSuccess(Object result) { | |
| Toast.makeText(getActivity(), "Push notification sent", Toast.LENGTH_SHORT).show(); | |
| } | |
| @Override | |
| public void onFailure(Exception e) { | |
| Toast.makeText(getActivity(), e.toString(), Toast.LENGTH_SHORT).show(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment