Created
February 4, 2015 19:38
-
-
Save ChrisRisner/796fb9d1c6ade285f489 to your computer and use it in GitHub Desktop.
NotificationHubsHelper.java
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
public static NotificationHub instance; | |
public static NotificationHub getNotificationHub (Activity activity) { | |
NotificationsManager.handleNotifications(activity, SENDER_ID, NotificationHubsHelper.class); | |
String hubName = "myhubname"; | |
String connectionString = "myListenSharedAccessSignature"; | |
instance = new NotificationHub(hubName, connectionString, activity); | |
return instance; | |
} | |
@Override | |
public void onRegistered(Context context, String gcmRegistrationId) { | |
super.onRegistered(context, gcmRegistrationId); | |
try { | |
instance.register(gcmRegistrationId); | |
} catch (Exception ex) { | |
Log.e("NotificationHubsHelper", "error registering with hub: " + ex.getMessage()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment