SFPushNotificationManager Class Reference
Inherits from | NSObject |
---|---|
Declared in | SFPushNotificationManager.h |
Overview
Handles push notification registration and unregistration, both for Salesforce notifications and remote notifications.
deviceToken
Device token returned when registering with APNS.
@property (nonatomic, strong) NSString *deviceToken
Declared In
SFPushNotificationManager.h
deviceSalesforceId
ID returned when registering for Salesforce push notifications.
@property (nonatomic, strong) NSString *deviceSalesforceId
Declared In
SFPushNotificationManager.h
customPushRegistrationBody
Custom push notification for additional HTTP POST body.
@property (nullable, nonatomic, strong) NSDictionary *customPushRegistrationBody
Declared In
SFPushNotificationManager.h
+ sharedInstance
The share instance of this class.
+ (SFPushNotificationManager *)sharedInstance
Declared In
SFPushNotificationManager.h
– registerForRemoteNotifications
Register with APNS
- (void)registerForRemoteNotifications
Declared In
SFPushNotificationManager.h
– didRegisterForRemoteNotificationsWithDeviceToken:
Call this method from your app delegate’s didRegisterForRemoteNotificationsWithDeviceToken
- (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceTokenData
Parameters
deviceTokenData |
The device token returned by APNS. |
---|
Declared In
SFPushNotificationManager.h
– registerSalesforceNotificationsWithCompletionBlock:failBlock:
Register for notifications with Salesforce. Call this method after authenticating with Salesforce and registering with APNS.
- (BOOL)registerSalesforceNotificationsWithCompletionBlock:(nullable void ( ^ ) ( void ))completionBlock failBlock:(nullable void ( ^ ) ( void ))failBlock
Parameters
completionBlock |
Completion block. |
---|---|
failBlock |
fail block. |
Return Value
YES for successful registration call being made.
Declared In
SFPushNotificationManager.h
– registerSalesforceNotificationsWithCompletionBlock:completionBlock:failBlock:
Register for notifications with Salesforce. Call this method after authenticating with Salesforce and registering with APNS.
- (BOOL)registerSalesforceNotificationsWithCompletionBlock:(SFUserAccount *)user completionBlock:(nullable void ( ^ ) ( void ))completionBlock failBlock:(nullable void ( ^ ) ( void ))failBlock
Parameters
user |
SFUserAccount to use. |
---|---|
completionBlock |
Completion block. |
failBlock |
fail block. |
Return Value
YES for successful registration call being made.
Declared In
SFPushNotificationManager.h
– unregisterSalesforceNotificationsWithCompletionBlock:
Unregister from notifications with Salesforce for a specific user. This method is called at logout.
- (BOOL)unregisterSalesforceNotificationsWithCompletionBlock:(nullable void ( ^ ) ( void ))completionBlock
Parameters
completionBlock |
Completion block. |
---|
Return Value
YES for successful unregistration call being made.
Declared In
SFPushNotificationManager.h
– unregisterSalesforceNotificationsWithCompletionBlock:completionBlock:
Unregister from notifications with Salesforce for a specific user. This method is called at logout.
- (BOOL)unregisterSalesforceNotificationsWithCompletionBlock:(SFUserAccount *)user completionBlock:(nullable void ( ^ ) ( void ))completionBlock
Parameters
user |
User account. |
---|---|
completionBlock |
Completion block. |
Return Value
YES for successful unregistration call being made.
Declared In
SFPushNotificationManager.h