Installation

SDK Yandex ID for iOS is installed from the YandexLoginSDK CocoaPods repository.

Step 1. Configure a Podfile

To import SDK Yandex ID from CocoaPods, configure a Podfile:

  1. Go to the directory with your Xcode project and create a text Podfile.

  2. Open the Podfile and add the dependency:

    pod 'YandexLoginSDK'
    
  3. Use this command to apply the changes:

    $ pod install
    

Step 2. Configure Info.plist

Add the following strings to the Info.plist file:

<key>LSApplicationQueriesSchemes</key>
<array>
	<string>yandexauth</string>
	<string>yandexauth2</string>
	<string>yandexauth4</string>
</array>
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleURLName</key>
		<string>YandexLoginSDK</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>yx<app ID_clientID></string>
		</array>
	</dict>
</array>

Step 3. Configure Entitlements

SDK Yandex ID communicates with Yandex apps via Universal Links. For them to work, add the following string to Capability: Associated Domains:

applinks:yx{app ID}.oauth.yandex.com

For example, if the app ID Client ID is ABCD2e, the string to be added looks like this:

applinks:yxABCD2e.oauth.yandex.com

Step 4. Import header files

Add this header to the project files where SDK Yandex ID is used:

import <YandexLoginSDK>
#import <YandexLoginSDK/YandexLoginSDK.h>
Previous
Next