SINClientRegistration

Objective-C

@protocol SINClientRegistration <NSObject>

Swift

protocol SINClientRegistration : NSObjectProtocol

Callback object to be used to proceed in user registration process when registration credentials for the user in question have been obtained.

  • Proceed with user registration by providing a signed JWT (JSON Web Token).

    The JWT should contain the following JWT header parameters:

    • ‘alg’: ‘HS256’,
    • ‘kid’: ‘hkdfv1-{date}’, where date is in UTC on the format YYYYMMDD.

    The JWT should contain the following claims:

    The JWT should be signed using a signing key derived from the Sinch Application Secret as follows. Given a function HMAC256(key, message), a date-formatting function FormatDate(date, format), and the current date as variable now, derive the signing key as follows:

    signingKey = HMAC256(applicationSecret, UTF8-ENCODE(FormatDate(now, "YYYYMMDD")));
    

    Declaration

    Objective-C

    - (void)registerWithJWT:(NSString *)jwt;

    Swift

    func register(withJWT jwt: String!)

    Parameters

    jwt

    signed JWT (JSON Web Token)

  • If the application fails to provide a signed user registration token (JWT), it must notify the Sinch client via this method.

    Calling this method will have the effect that the client delegate will receive a call to -[SINClientDelegate clientDidFail:error:].

    See

    SINClient, SINClientDelegate

    Declaration

    Objective-C

    - (void)registerDidFail:(NSError *)error;

    Swift

    func registerDidFail(_ error: Error!)

    Parameters

    error

    Error that prevented obtaining a user registration token (JWT).