SINManagedPush Protocol Reference

Conforms to NSObject
Declared in SINManagedPush.h

Overview

SINManagedPush is a helper class to manage push notification credentials both for regular Remote Push Notifications and VoIP Push Notifications (which is available since iOS 8).

SINManagedPush acts as a facade for registering for device tokens for both types of notifications, and can also automatically register any received push credentials to any active SINClient.

SINManagedPush simplifies scenarios such as when receiving a device token occur before creating a SINClient. In such a case, SINManagedPush can automatically register the device token when the SINClient is created and started.

Example

-(BOOL)application:(UIApplication *)application
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.push = [Sinch managedPushWithAPSEnvironment:SINAPSEnvironmentAutomatic]
    [self.push setDesiredPushType:SINPushTypeVoIP];
}

– setDesiredPushType: required method

Requests registration of either VoIP remote notifications or regular remote notifications (similar to PushKit’s [PKPushRegistry setDesiredPushTypes:]).

- (void)setDesiredPushType:(NSString *)pushType

Parameters

pushType

Desired SINPushType NSString constant, e.g. SINPushTypeVoIP or SINPushTypeRemote

Declared In

SINManagedPush.h

– setDesiredPushTypeAutomatically required method

Set desired push type based on runtime detection of iOS version and whether PushKit is linked or not. This method will invoke [self setDesiredPushType:SINPushTypeVoIP] if PushKit is linked, else [self setDesiredPushType:SINPushTypeRemote].

- (void)setDesiredPushTypeAutomatically

Declared In

SINManagedPush.h

– setDisplayName: required method

Specify a display name to be used when Sinch sends a push notification on behalf of the local user (e.g. for an outgoing call). This method will automatically invoke [SINClient setPushNotificationDisplayName:] when a new Sinch client is started.

- (void)setDisplayName:(NSString *)displayName

Parameters

displayName

Display name that will be injected into remote push notification alert message.

Display name will be injected into the localization string SIN_INCOMING_CALL_DISPLAY_NAME. It will also be passed along in Firebase Cloud Messaging push notifications if a remote user’s device is an Android device.

See Also

Declared In

SINManagedPush.h