SelectSmartTV Mobile Push API Reference for Realtime Apps

 

This SDK has been deprecated.

If you have questions about the PubNub for SmartTV SDK, please contact us at support@pubnub.com.

PubNub's Mobile Push Gateway feature enables developers to bridge native PubNub publishing with 3rd-party push notification services including Google Android GCM (Google Cloud Messaging)/FCM (Firebase Cloud Messaging), Apple iOS APNs (Apple Push Notification service), and Microsoft Windows Phone MPNS (Microsoft Push Notification Service).

By using the Mobile Push Gateway, developers can eliminate the need for developing, configuring, and maintaining additional server-side components for third-party push notification providers.

Learn more about our Mobile Push Gateway here.


Requires Mobile Push Notifications add-on XRequires that you enable the Mobile Push Notifications for your key. Refer to the following page for details on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
Enable push notifications on provided set of channels.
To run Adding Device to Channel you can use the following method(s) in the SmartTV SDK:
  1. ParameterTypeRequiredDescription
    device_idStringYesThe device id to associate with push notifications.
    opStringYesAdd in this case.
    gw_typeStringYesapns, mpns or gcm.
    channelStringYesSpecifies channel to associate with push notifications.
    callbackFunctionYesCallback that is called on success.
    errorFunctionOptionalSpecify callback to call on error event.
pubnub.mobile_gw_provision ({
 	device_id: 'A655FBA9931AB',
 	op : 'add',
 	gw_type : 'apns', // or 'gcm'
 	channel : 'my_chat',
 	callback : mySuccessCallback,
 	error : myErrorCallback,
});
[1, "Modified Channels"]

Requires Mobile Push Notifications add-on XRequires that you enable the Mobile Push Notifications for your key. Refer to the following page for details on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
Disable push notifications on provided set of channels. If nil will be passed as channels then client will remove push notifications from all channels which associated with pushToken.
To run Removing Device From Channel you can use the following method(s) in the SmartTV SDK:
  1. ParameterTypeRequiredDescription
    device_id
    String
    Yes
    The device id to disassociate with push notifications.
    op
    String
    Yes
    Remove in this case.
    gw_type
    String
    Yes
    apns, mpns or gcm.
    channel
    String
    Yes
    Specifies channel to disassociate from push notifications.
    callback
    Function
    Yes
    Callback that is called on success.
    error
    Function
    Optional
    Specify callback to call on error event.
pubnub.mobile_gw_provision ({
	device_id : 'A655FBA9931AB',
	op : 'remove',
	gw_type : 'apns', // or 'gcm'
	channel : 'my_chat',
	callback : mySuccessCallback,
	error : myErrorCallback,
});
The output below demonstrates the response to a successful call:
[1, "Modified Channels"]