Installing the SDK
The SDK for iOS is installed from the CocoaPodsrepository:
Step 1. Register the app
Register your app on Yandex.OAuth.
Step 2. Configure Info.plist
Add the following lines to Info.plist :
<key>LSApplicationQueriesSchemes</key>
<array>
<string>yandexauth</string>
<string>yandexauth2</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>YandexLoginSDK</string>
<key>CFBundleURLSchemes</key>
<array>
<string>yx<Client id of you application></string>
</array>
</dict>
</array>
Step 3. Configure Entitlements
The SDK communicates with Yandex apps using Universal Links. For them to work, add applinks:yx{client app ID}.oauth.yandex.com
to Capability: Associated Domains
.
For example, if the client app ID is 333
, the added line will look like this: applinks:yx333.oauth.yandex.com
.
Step 4. Configure Podfile
To import the SDK from CocoaPods, configure Podfile. To do this:
- 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 running the following command:
$ pod install
Step 5. Import the header file
When working with the SDK, add the following header to each project file:
#import <YandexLoginSDK/YandexLoginSDK.h>