SMRegistrationService Class Reference

Inherits from NSObject
Declared in SMRegistrationService.h

  registrationApplicationDelegate

The delegate object that must be implement the callbacks.

@property (nonatomic, strong, nonnull) id<SMRegistrationApplicationDelegate> registrationApplicationDelegate

Declared In

SMRegistrationService.h

  notificationEngine

Hold the notification engine object for reusing.

@property (readonly, nonnull) SMNotificationEngine *notificationEngine

Declared In

SMRegistrationService.h

– registerToServer:completionHandler:

This method registers user to server with values set in configuration and valid parameters, Failure and success calls will be transmitted to completion block which can be null. After registration request succeeded and notification channel is connected completion block will be called without error. During registration process, registration registrationStateChanged of RegistrationApplicationDelegate will be triggered after registration request and notificationConnectionStateChanged of RegistrationApplicationDelegate will be triggered after notification connection is established.

- (void)registerToServer:(NSInteger)expiration completionHandler:(void ( ^ _Nullable ) ( SMMobileError *_Nullable error ))completionBlock

Parameters

completionBlock,

block implementation that will be used by the registration service to trigger callback events. Listener can be null if user don’t care the callbacks or failure reasons.

expirationTime,

Expiration time for registration in seconds. This value is sent to SPiDR server to set the registration expiration value and SPiDR sends the suitable expiration value back in registration request response. If this value exceeds the maximum supported expiration time in SPiDR, it will send the maximum value of SPiDR server that is set. This value is generally 3600sec and the final value can be gathered by calling getExpirationTime method.

Availability

5.14.0

Declared In

SMRegistrationService.h

– registerToServer:hmacToken:completionHandler:

This method registers user to server with values set in configuration and valid parameters, Failure and success calls will be transmitted to completion block which can be null. After registration request succeeded and notification channel is connected completion block will be called without error. During registration process, registration registrationStateChanged of RegistrationApplicationDelegate will be triggered after registration request and notificationConnectionStateChanged of RegistrationApplicationDelegate will be triggered after notification connection is established.

- (void)registerToServer:(NSInteger)expiration hmacToken:(nonnull NSString *)token completionHandler:(void ( ^ _Nullable ) ( SMMobileError *_Nullable error ))completionBlock

Parameters

completionBlock,

block implementation that will be used by the registration service to trigger callback events. Listener can be null if user don’t care the callbacks or failure reasons.

hmacToken,

HMAC token to authorize subscription request to the SPiDR server. This token must be a valid token obtained from the SPiDR server.

expirationTime,

Expiration time for registration in seconds. This value is sent to SPiDR server to set the registration expiration value and SPiDR sends the suitable expiration value back in registration request response. If this value exceeds the maximum supported expiration time in SPiDR, it will send the maximum value of SPiDR server that is set. This value is generally 3600sec and the final value can be gathered by calling getExpirationTime method.

Availability

5.19.0

Declared In

SMRegistrationService.h

– registerToServer:expirationTime:subscriptionId:notificationChannelId:completionHandler:

This method registers user to server with given subscription id and notification channel id Failure and success calls will be transmitted to completion block which can be null. After registration request succeeded and notification channel is connected completion block will be called without error. During registration process, registration registrationStateChanged of RegistrationApplicationDelegate will be triggered after registration request and notificationConnectionStateChanged of RegistrationApplicationDelegate will be triggered after notification connection is established.

- (void)registerToServer:(nonnull NSArray<NSString*> *)serviceTypes expirationTime:(NSInteger)expiration subscriptionId:(nonnull NSString *)subscriptionId notificationChannelId:(nonnull NSString *)notificationChannelId completionHandler:(void ( ^ _Nullable ) ( SMMobileError *_Nullable error ))completionBlock

Parameters

subscriptionId

, subscription id to use unregistration and renew registration

notificationChannelId

, notification channel id to use websocket connection

expirationTime,

Expiration time for registration in seconds. This value is sent to SPiDR server to set the registration expiration value and SPiDR sends the suitable expiration value back in registration request response. If this value exceeds the maximum supported expiration time in SPiDR, it will send the maximum value of SPiDR server that is set. This value is generally 3600sec and the final value can be gathered by calling getExpirationTime method.

serviceTypes,

service list that application will be registered to

completionBlock,

block implementation that will be used by the registration service to trigger callback events. Listener can be null if user don’t care the callbacks or failure reasons.

Availability

4.0.1

Declared In

SMRegistrationService.h

– unRegisterFromServerWithHandler:

This method unregisters user from server. Failure and success calls will be transmitted by RegistrationListener interface.

- (void)unRegisterFromServerWithHandler:(void ( ^ _Nullable ) ( SMMobileError *_Nullable error ))completionBlock

Parameters

completionBlock,

block implementation that will be used by the registration service to trigger callback events. Listener can be null if user don’t care the callbacks or failure reasons.

Availability

2.0.0

Declared In

SMRegistrationService.h

– getExpirationTime

Gives the expiration time for registration in seconds. Since the exact value is determined by SPiDR server, this method should be called after registration succeeded.

- (NSInteger)getExpirationTime

Return Value

NSInteger, registration expiration time in seconds.

Declared In

SMRegistrationService.h

– getRegistrationState

Gives the current status of the registration.

- (SMRegistrationStates)getRegistrationState

Return Value

SMRegistrationStates, REGISTERED, UNREGISTERED

Declared In

SMRegistrationService.h

– getNotificationState

Gives the current status of the notification component.

- (SMNotificationStates)getNotificationState

Return Value

SMNotificationStates, CONNECTED, DISCONNECTED

Declared In

SMRegistrationService.h

– init

Constructing is disallowed from API level.

- (id _Nonnull)init

Discussion

Constructing is disallowed from API level.

Declared In

SMRegistrationService.h