SINManagedPush

Objective-C


@interface SINManagedPush : NSObject

Swift

class SINManagedPush : NSObject

SINManagedPush is a helper class to manage push notification credentials for VoIP Push Notifications.

SINManagedPush acts as a facade for registering for device token for VoIP 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.

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

    Declaration

    Objective-C

    @property (nonatomic, readwrite, weak) id<SINManagedPushDelegate> delegate

    Swift

    weak var delegate: SINManagedPushDelegate! { get set }
  • Requests registration of VoIP push notifications (similar to PushKit’s -[PKPushRegistry setDesiredPushTypes:]).

    Note

    It is strongly recommended to link PushKit framework and use SINPushTypeVoIP.

    Declaration

    Objective-C

    - (void)setDesiredPushType:(NSString *)pushType;

    Swift

    func setDesiredPushType(_ pushType: String!)

    Parameters

    pushType

    Desired SINPushType NSString constant, e.g. SINPushTypeVoIP

  • 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.

    Display name will be passed along in Firebase Cloud Messaging push notifications if a remote user’s device is an Android device.

    See

    SINClient

    Declaration

    Objective-C

    - (void)setDisplayName:(NSString *)displayName;

    Swift

    func setDisplayName(_ displayName: String!)

    Parameters

    displayName

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

  • This method may be used to indicate to the Sinch SDK that processing of a VoIP push payload is completed in case it was for some reason not relayed to a SINClient instance.

    This will invoke the completion handler block provided to -[PKPushRegistry pushRegistry:didReceiveIncomingPushWithPayload:forType:completion:].

    Declaration

    Objective-C

    - (void)didCompleteProcessingPushPayload:(NSDictionary *)payload;

    Swift

    func didCompleteProcessingPushPayload(_ payload: [AnyHashable : Any]!)

    Parameters

    payload

    Push payload

  • Method used to extract call information contained in raw push notification payload.

    Declaration

    Objective-C

    + (id<SINNotificationResult>)queryPushNotificationPayload:
        (NSDictionary *)payload;

    Parameters

    payload

    Remote notification payload which was transferred with an Apple Push Notification.

    Return Value

    Result of initial inspection of push notification.

  • Determine whether a push notification payload is carrying a Sinch payload.

    Declaration

    Objective-C

    + (BOOL)isSinchPushPayload:(NSDictionary *)payload;

    Swift

    class func isSinchPushPayload(_ payload: [AnyHashable : Any]!) -> Bool

    Parameters

    payload

    Push payload

    Return Value

    true if sinch payload, false otherwise