Connection
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:
-
Go to the folder with the Xcode project and create a text file named
Podfile. -
Open Podfile and add the following dependency:
pod 'YandexLoginSDK' -
Apply changes by runnning the following command:
$ 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>
- You can find the app's Client ID in its properties.
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:
Swift
Objective-C
import <YandexLoginSDK>
#import <YandexLoginSDK/YandexLoginSDK.h>
Was the article helpful?
Previous
Next