SKYPushContainer

@interface SKYPushContainer : NSObject

Undocumented

  • Returns the currently registered device ID.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nullable registeredDeviceID;

    Swift

    var registeredDeviceID: String? { get }
  • Acknowledge the container that a remote notification is received. If the notification is sent by Skygear, container would invoke container:didReceiveNotification: on its delegate.

    Declaration

    Objective-C

    - (void)applicationDidReceiveRemoteNotification:(nonnull NSDictionary *)info;

    Swift

    func applicationDidReceiveRemoteNotification(_ info: [AnyHashable : Any])
  • Registers a device token for push notification.

    Declaration

    Objective-C

    - (void)registerRemoteNotificationDeviceToken:(NSData *_Nullable)deviceToken
                                completionHandler:
                                    (void (^_Nullable)(NSString *_Nullable,
                                                       NSError *_Nullable))
                                        completionHandler;

    Swift

    func registerRemoteNotificationDeviceToken(_ deviceToken: Data?, completionHandler: ((String?, Error?) -> Void)? = nil)
  • Registers a device token for push notification. When the user is no longer associated to the device, you should call -[SKYContainer unregisterDeviceCompletionHandler:].

    Declaration

    Objective-C

    - (void)registerDeviceWithDeviceToken:(NSData *_Nullable)deviceToken
                        completionHandler:(void (^_Nullable)(NSString *_Nullable,
                                                             NSError *_Nullable))
                                              completionHandler;

    Swift

    func registerDevice(withDeviceToken deviceToken: Data?, completionHandler: ((String?, Error?) -> Void)? = nil)
  • Registers a device without device token. This method should be called when the user denied push notification permission.

    This method should be called to register the current device on remote server at the time when the application launches. It is okay to call this on subsequent launches, even if a device token is already associated with this device.

    Declaration

    Objective-C

    - (void)registerDeviceCompletionHandler:
        (void (^_Nullable)(NSString *_Nullable,
                           NSError *_Nullable))completionHandler;

    Swift

    func registerDeviceCompletionHandler(_ completionHandler: ((String?, Error?) -> Void)? = nil)
  • Unregister the current user from the current device. This should be called when the user logouts.

    Declaration

    Objective-C

    - (void)unregisterDevice;

    Swift

    func unregisterDevice()
  • Unregister the current user from the current device, this is preferred to -[unregisterDevice]. This should be called when the user logouts.

    Declaration

    Objective-C

    - (void)unregisterDeviceCompletionHandler:
        (void (^_Nullable)(NSString *_Nullable,
                           NSError *_Nullable))completionHandler;

    Swift

    func unregisterDeviceCompletionHandler(_ completionHandler: ((String?, Error?) -> Void)? = nil)

    Parameters

    completionHandler

    the completion handler