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.Exception
public 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.Exception
public 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.Exception
public 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.Exception
public void unregister() throws java.lang.Exception
java.lang.Exception
public void unregisterTemplate(java.lang.String templateName) throws java.lang.Exception
templateName
- The template namejava.lang.Exception
public void unregisterAll(java.lang.String pnsHandle) throws java.lang.Exception
pnsHandle
- PNS specific identifierjava.lang.Exception
public java.lang.String getConnectionString()
public void setConnectionString(java.lang.String connectionString)
public java.lang.String getNotificationHubPath()
public void setNotificationHubPath(java.lang.String notificationHubPath)