SinchManagedPush
public final class SinchManagedPush
SinchManagedPush is a helper class to manage push notification credentials for VoIP Push Notifications.
SinchManagedPush acts as a facade for registering for device token for VoIP notifications, and can also automatically register any received push credentials to any active SinchClient.
SinchManagedPush simplifies scenarios such as when receiving a device token occur before creating a SinchClient. In such a case, SinchManagedPush can automatically register the device token when the SinchClient is created and started.
### Example
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.push = SinchRTC.managedPush(forAPSEnvironment: SinchRTC.APSEnvironment.development)
self.push.delegate = self
self.push.setDesiredPushType(SinchManagedPush.TypeVoIP)
...
return true
}
-
Type of VoIP push
Declaration
Swift
public static let TypeVoIP: String -
Undocumented
Declaration
Swift
public weak var delegate: SinchManagedPushDelegate? { get set } -
Requests registration of either VoIP push notifications or regular remote notifications (similar to PushKit’s PKPushRegistry.setDesiredPushTypes).
Note
It is strongly recommended to link PushKit framework and use TypeVoIP.
Declaration
Swift
public func setDesiredPushType(_ pushType: String)Parameters
pushTypeDesired puhs type String constant, e.g. TypeVoIP
-
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
SinchClient.setPushNotificationDisplayName(_:)when a new Sinch client is started.Throws
Throws if displayName exceeds 255 bytes length.
Display name will be passed along in Firebase Cloud Messaging push notifications if a remote user’s device is an Android device.
See also
SinchClientDeclaration
Swift
public func setDisplayName(_ displayName: String) throwsParameters
displayNameDisplay name that will be injected into the 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 SinchClient instance.
This will invoke the completion handler block provided to PKPushRegistry.pushRegistry:didReceiveIncomingPushWithPayload:forType:completion:.
Declaration
Swift
public func didCompleteProcessingPushPayload(_ payload: [AnyHashable : Any])