Using the SDK

Authorization

To start user authorization, use the following YandexLoginSDK method:

func authorize(with: UIViewController, customValues: [String: String]?, authorizationStrategy: AuthorizationStrategy) throws
  • parentViewController is a required parameter.
  • customValues has a default value of "nil".
  • authorizationStrategy is described in detail in Method guide.

To get the authorization result, you need to register a YandexLoginSDK observer using the add(observer:) method. When you no longer need notifications from SDK Yandex ID, you can unregister the observer using the remove(observer:) method. The observer must correspond to the LoginSDKObserver protocol.

Getting information about the user

You can exchange the obtained token for user information.

Logout

To delete locally stored tokens, use the logout() method of the YandexLoginSDK class.