|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.shephertz.app42.paas.sdk.android.push.PushNotificationService
public class PushNotificationService
The service is for pushing the notifications to any device using GCM(Google Cloud Messaging). You have to upload your apikey that you received while registering for GCM and you have to store your device token with particular username. This service allows you the feature of sending message to particular channel, particular user or to all your users.For sending message to any channel, you have to create the channel and send the message to channel. The users which have subscribed to that channel will receive all the notification for that channel. For sending message to particular user, you have to pass username and message. Notification will sent to the device of registered user. The most important feature you can send your message to all your device whether it is iphone, android or blackberry.
Constructor Summary | |
---|---|
PushNotificationService(java.lang.String apiKey,
java.lang.String secretKey,
java.lang.String baseURL)
This is a constructor that takes |
Method Summary | |
---|---|
PushNotification |
createChannelForApp(java.lang.String channel,
java.lang.String description)
Create Channel for app on which user can subscribe and get the notification for that channel |
PushNotification |
sendPushMessageToAll(java.lang.String message)
Send push message to all your users |
PushNotification |
sendPushMessageToChannel(java.lang.String channel,
java.util.HashMap<java.lang.String,java.lang.String> message)
Send Push Message to particular channel containing Json |
PushNotification |
sendPushMessageToChannel(java.lang.String channel,
java.lang.String message)
send push message to channel containing string |
PushNotification |
sendPushMessageToUser(java.lang.String username,
java.util.HashMap<java.lang.String,java.lang.String> message)
Send Push Message to particular user |
PushNotification |
sendPushMessageToUser(java.lang.String username,
java.lang.String message)
Send Push Message To paticular user in string format |
PushNotification |
storeDeviceToken(java.lang.String Username,
java.lang.String deviceToken)
Stores your device token on server with particular username |
PushNotification |
subscribeToChannel(java.lang.String channel,
java.lang.String userName)
Subscribe to the channel |
PushNotification |
unsubscribeFromChannel(java.lang.String channel,
java.lang.String userName)
Unsubscribe from particular channel |
PushNotification |
uploadApiKey(java.lang.String apiKey)
Upload api key to server that will be used while sending notifications to the devices. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PushNotificationService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
apiKey
- secretKey
- baseURL
- Method Detail |
---|
public PushNotification createChannelForApp(java.lang.String channel, java.lang.String description) throws App42Exception
channel
- - channel name which you want to createdescription
- = description for that channel
App42Exception
public PushNotification sendPushMessageToAll(java.lang.String message)
message
- push message
public PushNotification sendPushMessageToChannel(java.lang.String channel, java.util.HashMap<java.lang.String,java.lang.String> message)
channel
- channel name which you want to send your json messagemessage
- push message in HashMap format
public PushNotification sendPushMessageToChannel(java.lang.String channel, java.lang.String message)
channel
- channel name which you want to send the messagemessage
- push message in string format
public PushNotification sendPushMessageToUser(java.lang.String username, java.util.HashMap<java.lang.String,java.lang.String> message)
username
- username which you want to send messagemessage
- push Message in json
public PushNotification sendPushMessageToUser(java.lang.String username, java.lang.String message)
username
- username which you want to send the messagemessage
- push message
public PushNotification storeDeviceToken(java.lang.String Username, java.lang.String deviceToken) throws App42Exception
Username
- username with which you want your device to be registereddeviceToken
- device id for android phones
App42Exception
public PushNotification subscribeToChannel(java.lang.String channel, java.lang.String userName) throws App42Exception
channel
- the channel name which you want to subscribeuserName
- username which want to subscribe
App42Exception
public PushNotification unsubscribeFromChannel(java.lang.String channel, java.lang.String userName) throws App42Exception
channel
- channel name which you want to unsubscribeuserName
- username which want to unsubscribe
App42Exception
public PushNotification uploadApiKey(java.lang.String apiKey) throws App42Exception
apiKey
- the apiKey which you have received while registering for GCM.
App42Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |