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:
-
Go to the directory with your Xcode project and create a text
Podfile
. -
Open the Podfile and add the dependency:
pod 'YandexLoginSDK'
-
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>
- 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>