public class

SalesforceConnectedApp

extends Object
java.lang.Object
   ↳ com.salesforce.android.connectedapp.SalesforceConnectedApp

Class Overview

Permits configuring your app as a Salesforce Connected App for receiving push notifications via Salesforce's APEX PushNotification API.

See the Salesforce Mobile Push Notifications Implementation Guide for more information about configuring your Org.

Summary

Fields
protected final PushNotificationNotifier notifier
Public Methods
void addPushNotificationListener(PushNotificationListener listener)
Provide a PushNotificationListener instance with which to receive push notifications and their payloads from Salesforce.
static SalesforceConnectedApp create(Context context, ConnectedAppConfiguration configuration)
Create a SalesforceConnectedApp instance, which will allow you to register and unregister for Salesforce push notifications from your Org.
Async<Void> registerDeviceForPushNotifications()
Register this device for push notifications.
void removePushNotificationListener(PushNotificationListener listener)
Exclude a PushNotificationListener instance from receiving push notifications from Salesforce.
Async<Void> unregisterDeviceFromPushNotifications()
Unregister this device from receiving push notifications from Salesforce.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final PushNotificationNotifier notifier

Public Methods

public void addPushNotificationListener (PushNotificationListener listener)

Provide a PushNotificationListener instance with which to receive push notifications and their payloads from Salesforce.

PushNotificationListener instances will not be notified of push notifications if the device has not been successfully registered with Salesforce via registerDeviceForPushNotifications()

public static SalesforceConnectedApp create (Context context, ConnectedAppConfiguration configuration)

Create a SalesforceConnectedApp instance, which will allow you to register and unregister for Salesforce push notifications from your Org.

public Async<Void> registerDeviceForPushNotifications ()

Register this device for push notifications. Registration will use OAuth tokens provided by your AuthTokenProvider implementation.

In order to receive notifications in your app you must also provide a PushNotificationListener to addPushNotificationListener(PushNotificationListener).

Returns
  • An Async instance for managing the result of registration asynchronously

public void removePushNotificationListener (PushNotificationListener listener)

Exclude a PushNotificationListener instance from receiving push notifications from Salesforce.

If you intend to completely prevent the device from receiving push notifications you should call unregisterDeviceFromPushNotifications().

public Async<Void> unregisterDeviceFromPushNotifications ()

Unregister this device from receiving push notifications from Salesforce. De-registration will use OAuth tokens provided by your AuthTokenProvider implementation.

Any PushNotificationListener instances you have provided to addPushNotificationListener(PushNotificationListener) will no longer be called.

Returns
  • An Async instance for managing the result of de-registration asynchronously