Version 1.x is now deprecated. We will continue to support 1.x through March 31, 2017 (End of Support - EOS). If you are currently using 1.x in your apps, you will need to upgrade your apps to 3.x before the EOS date. We have created a migration guide to help you.
This guide walks you through setting up your app with Kinvey.
- Xcode 8.1 or above.
- iOS 9 or above.
- Swift 2.3 or above. Refer to the download page for the Kinvey version that matches your preferred Swift version.
You can start using the Kinvey framework in one of three ways - using CocoaPods, using the Kinvey starter app, or using the SDK source code.
If you are using CocoaPods, add the Kinvey Pod to your target in the Podfile.
For a target called
MyProject, your Podfile will look like this:
target 'MyProject' do pod 'Kinvey' end
From the Terminal, run
pod install in the project folder to install the dependency.
pod 'Kinvey', '~> 3.2.1'
You can get started with the Kinvey iOS starter app. The starter app is bundled with the Kinvey framework.
We recommend updating the Kinvey framework in the app to the latest available on our downloads page before you begin.
The Kinvey iOS SDK is open source. If you prefer to compile your app against the SDK source code, you can follow the instructions on our github repo to set up the SDK.
Before you can communicate with the backend, you need to give the library your app key and secret. This is done with the following code snippet, substituting your app's key and secret (found in the management console header when viewing your app backend). We recommend adding this to your AppDelegate's
import Kinvey Kinvey.sharedClient.initialize( appKey: "<#Your app key#>", appSecret: "<#Your app secret#>" )
apiHostnameto your dedicated Kinvey host URL.
You can find the host URL in your console dashboard, next to your App Key and App Secret.
//Set the apiHostName to a sample url. //Replace the sample url with the url for your dedicated Kinvey backend. Kinvey.sharedClient.initialize( appKey: "<#Your app key#>", appSecret: "<#Your app secret#>", apiHostName: NSURL(string: "<#https://my-url.kinvey.com/#>")! )
//Set the apiHostName to a sample url. //Replace the sample url with the url of your dedicated Kinvey backend. Kinvey.sharedClient.initialize( appKey: "<#Your app key#>", appSecret: "<#Your app secret#>", apiHostName: URL(string: "<#https://my-url.kinvey.com/#>")! )
Your app will be used by a real-life human being. This person is represented by the Active User. This user object must explicitly be created, either with a username and password, OAuth sign-on (such as Facebook, Google+, LinkedIn, etc.), or Mobile Identity Connect. See the User Guide for more information.
You are now ready to start building your awesome apps! Next we recommend diving into the User Guide or Data Store Guide to learn more about our service, or explore the sample apps to go straight to working projects.