Created
May 20, 2014 07:04
-
-
Save sedouard/92a0f334f8b9a8621c1e to your computer and use it in GitHub Desktop.
This file contains 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
package com.example.crossplatformpush; | |
import android.content.Context; | |
import com.microsoft.windowsazure.notifications.NotificationsHandler; | |
import com.microsoft.windowsazure.messaging.*; | |
public class Handler extends NotificationsHandler { | |
@Override | |
public void onRegistered(Context context, String gcmregId){ | |
super.onRegistered(context, gcmregId); | |
//register to notification hub | |
NotificationHub hub = new NotificationHub("<NOTIFICATION HUB NAME>", "<NOTIFICATION HUB CONNECTION STRING>", | |
context); | |
try{ | |
hub.register(gcmregId, "breaking_news", "user:1234"); | |
} | |
catch(Exception e){ | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment