public class NotificationHub
extends java.lang.Object
| Constructor and Description |
|---|
NotificationHub(java.lang.String notificationHubPath,
java.lang.String connectionString,
android.content.Context context)
Creates a new NotificationHub client
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getConnectionString()
Gets the Notification Hub connection string
|
java.lang.String |
getNotificationHubPath()
Gets the Notification Hub path
|
Registration |
register(java.lang.String pnsHandle,
java.lang.String... tags)
Registers the client for native notifications with the specified tags
|
Registration |
registerBaidu(java.lang.String userId,
java.lang.String channelId,
java.lang.String... tags)
Registers the client for native notifications with the specified tags
|
TemplateRegistration |
registerBaiduTemplate(java.lang.String userId,
java.lang.String channelId,
java.lang.String templateName,
java.lang.String template,
java.lang.String... tags)
Registers the client for template notifications with the specified tags
|
TemplateRegistration |
registerTemplate(java.lang.String pnsHandle,
java.lang.String templateName,
java.lang.String template,
java.lang.String... tags)
Registers the client for template notifications with the specified tags
|
void |
setConnectionString(java.lang.String connectionString)
Sets the Notification Hub connection string
|
void |
setNotificationHubPath(java.lang.String notificationHubPath)
Sets the Notification Hub path
|
void |
unregister()
Unregisters the client for native notifications
|
void |
unregisterAll(java.lang.String pnsHandle)
Unregisters the client for all notifications
|
void |
unregisterTemplate(java.lang.String templateName)
Unregisters the client for template notifications of a specific template
|
public NotificationHub(java.lang.String notificationHubPath,
java.lang.String connectionString,
android.content.Context context)
notificationHubPath - Notification Hub pathconnectionString - Notification Hub connection stringcontext - Android context used to access SharedPreferencespublic Registration register(java.lang.String pnsHandle, java.lang.String... tags) throws java.lang.Exception
pnsHandle - PNS specific identifiertags - Tags to use in the registrationjava.lang.Exceptionpublic Registration registerBaidu(java.lang.String userId, java.lang.String channelId, java.lang.String... tags) throws java.lang.Exception
userId - Baidu user IdchannelId - Baidu channel Idtags - Tags to use in the registrationjava.lang.Exceptionpublic TemplateRegistration registerTemplate(java.lang.String pnsHandle, java.lang.String templateName, java.lang.String template, java.lang.String... tags) throws java.lang.Exception
pnsHandle - PNS specific identifiertemplateName - The template nametemplate - The template bodytags - The tags to use in the registrationjava.lang.Exceptionpublic TemplateRegistration registerBaiduTemplate(java.lang.String userId, java.lang.String channelId, java.lang.String templateName, java.lang.String template, java.lang.String... tags) throws java.lang.Exception
userId - The User IdchannelId - The channel IdtemplateName - The template nametemplate - The template bodytags - The tags to use in the registrationjava.lang.Exceptionpublic void unregister()
throws java.lang.Exception
java.lang.Exceptionpublic void unregisterTemplate(java.lang.String templateName)
throws java.lang.Exception
templateName - The template namejava.lang.Exceptionpublic void unregisterAll(java.lang.String pnsHandle)
throws java.lang.Exception
pnsHandle - PNS specific identifierjava.lang.Exceptionpublic java.lang.String getConnectionString()
public void setConnectionString(java.lang.String connectionString)
public java.lang.String getNotificationHubPath()
public void setNotificationHubPath(java.lang.String notificationHubPath)