Method guide

YXLSdk Class

Authorization class. Instance methods:

Method Description
- (BOOL)activateWithAppId:(NSString *)appId error:(NSError *__autoreleasing *)error
Activates the SDK. Class methods can only be used after activation.
- (BOOL)processUserActivity:(NSUserActivity *)userActivity
Checks NSUserActivity for a token.
- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(nullable NSString
                  *)sourceApplication
Checks NSURL for information about authorization.
- (void)addObserver:(id<YXLObserver>)observer NS_SWIFT_NAME(add(observer:))
Adds an observer.
- (void)removeObserver:(id<YXLObserver>)observer NS_SWIFT_NAME(remove(observer:))
Deletes an observer.
- (void)authorize
Starts the authorization process by opening one of the Yandex apps (according to the user's choice) or a browser.
- (void)logout
Removes all the stored tokens. Used to request a new set of tokens.
Method Description
- (BOOL)activateWithAppId:(NSString *)appId error:(NSError *__autoreleasing *)error
Activates the SDK. Class methods can only be used after activation.
- (BOOL)processUserActivity:(NSUserActivity *)userActivity
Checks NSUserActivity for a token.
- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(nullable NSString
                  *)sourceApplication
Checks NSURL for information about authorization.
- (void)addObserver:(id<YXLObserver>)observer NS_SWIFT_NAME(add(observer:))
Adds an observer.
- (void)removeObserver:(id<YXLObserver>)observer NS_SWIFT_NAME(remove(observer:))
Deletes an observer.
- (void)authorize
Starts the authorization process by opening one of the Yandex apps (according to the user's choice) or a browser.
- (void)logout
Removes all the stored tokens. Used to request a new set of tokens.

Class properties:

Property Description
@property (class, readonly) NSString *sdkVersion
Returns a string with the SDK version.
Property Description
@property (class, readonly) NSString *sdkVersion
Returns a string with the SDK version.

YXLObserver Class

Authorization event class. Instance methods:

Method Description
- (void)loginDidFinishWithResult:(id<YXLLoginResult>)result
Called upon successful authorization. result contains fields with tokens.
- (void)loginDidFinishWithError:(NSError *)error
Called upon authorization with an error. The error parameter contains an error code.
Method Description
- (void)loginDidFinishWithResult:(id<YXLLoginResult>)result
Called upon successful authorization. result contains fields with tokens.
- (void)loginDidFinishWithError:(NSError *)error
Called upon authorization with an error. The error parameter contains an error code.

YXLLoginrResult Class

A class that the SDK returns after successful authorization. Instance properties:

Property Description
(nonatomic, copy, readonly) NSString *token
Token used in requests to Yandex services.
(nonatomic, copy, readonly) NSString *jwt
JSON Web Token.
Property Description
(nonatomic, copy, readonly) NSString *token
Token used in requests to Yandex services.
(nonatomic, copy, readonly) NSString *jwt
JSON Web Token.