{"_id":"55f1baf839e3e8190068b306","parentDoc":null,"project":"55de06fa57f7b20d0097636b","__v":3,"category":{"_id":"55f1970d229b772300779a1f","version":"55de06fa57f7b20d0097636e","__v":4,"pages":["55f1baf839e3e8190068b306","55f1bbbb7dccfc0d00986b7d","55f1bc693936d52d00fb3cd2","55f1bcd039e3e8190068b30c"],"project":"55de06fa57f7b20d0097636b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-10T14:43:25.537Z","from_sync":false,"order":3,"slug":"unity-sdk","title":"Unity SDK"},"user":"55de06e19db51a0d0064947d","version":{"_id":"55de06fa57f7b20d0097636e","project":"55de06fa57f7b20d0097636b","__v":14,"createdAt":"2015-08-26T18:35:38.642Z","releaseDate":"2015-08-26T18:35:38.642Z","categories":["55de06fb57f7b20d0097636f","55f1962e3936d52d00fb3c8f","55f1970339e3e8190068b2b8","55f1970d229b772300779a1f","55f1971cfd98c42300acc605","55f1d5c7fd98c42300acc69f","563cbfe4260dde0d00c5e9d4","5644cf437f1fff210078e690","57dc1bbd3ed3450e00dc9ea7","58a600a2243dd30f00fd8773","58ed1bdc068f780f00f64602","58f13b3a4f0ee50f00e24e81","58f173f792f9020f009cad16","591b42f8e633fd0f00077c5a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-10T17:16:40.933Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Integrating the PushSpring SDK into your app is straightforward, with a basic integration taking around 15 minutes. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Request SDK Binary\"\n}\n[/block]\nEmail <support:::at:::pushspring.com> for the binary.\n\nInside the Unity SDK, you'll find a folder called **UnitySDK/Assets/Plugins**.  If you haven't used plugins in your project then copy the **Assets/Plugins** folder to your **Assets** folder otherwise merge the files in the **Assets/Plugins** folder into the same locations in your app's **Assets/Plugins** folder.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. iOS Builds\"\n}\n[/block]\nRe-generate your iOS Xcode project so that the new plugin files are copied into the **Libraries** folder in your Xcode project.\n\nThe next step is to add the iOS SDK to your generated Xcode project. Follow the instructions in our [iOS SDK](doc:getting-started-1) section but take note of the following differences:\n\n* Skip the \"App Delegate changes\" section. This was replaced with the Init method you added to the Unity project above.\n\n* The customization methods have correlated methods in the Unity Plugin with minor differences due to language syntax.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Configuring your API Key\"\n}\n[/block]\nBefore getting started, get your app's API key from the PushSpring Audience Console. You'll use this API key when initializing the SDK in the following steps.  You can share API keys between Android and iOS versions of the same app if you like, but each separate app that you integrate the PushSpring SDK into should be given its own API key so the audiences are tracked independently by PushSpring.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/25f4544-32fAEmN0SxiAlMuaslkv_Screen_Shot_2015-12-01_at_8.33.25_PM.png\",\n        \"32fAEmN0SxiAlMuaslkv_Screen Shot 2015-12-01 at 8.33.25 PM.png\",\n        2550,\n        1162,\n        \"#949495\"\n      ]\n    }\n  ]\n}\n[/block]\nThe final integration step in your Unity project will be to call the **PushSpringSDK.Init** method from the Start method of a script that runs when your game starts. Pass it the API key you got from the PushSpring dashboard.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"function Start () {\\n    PushSpringSDK.Init(\\\"YOUR-API-KEY\\\");\\n}\\n\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"Initial Integration with Unity SDK","slug":"getting-started-on-ios","type":"basic","title":"Getting Started on iOS"}

Getting Started on iOS

Initial Integration with Unity SDK

Integrating the PushSpring SDK into your app is straightforward, with a basic integration taking around 15 minutes. [block:api-header] { "type": "basic", "title": "1. Request SDK Binary" } [/block] Email <support@pushspring.com> for the binary. Inside the Unity SDK, you'll find a folder called **UnitySDK/Assets/Plugins**. If you haven't used plugins in your project then copy the **Assets/Plugins** folder to your **Assets** folder otherwise merge the files in the **Assets/Plugins** folder into the same locations in your app's **Assets/Plugins** folder. [block:api-header] { "type": "basic", "title": "2. iOS Builds" } [/block] Re-generate your iOS Xcode project so that the new plugin files are copied into the **Libraries** folder in your Xcode project. The next step is to add the iOS SDK to your generated Xcode project. Follow the instructions in our [iOS SDK](doc:getting-started-1) section but take note of the following differences: * Skip the "App Delegate changes" section. This was replaced with the Init method you added to the Unity project above. * The customization methods have correlated methods in the Unity Plugin with minor differences due to language syntax. [block:api-header] { "type": "basic", "title": "3. Configuring your API Key" } [/block] Before getting started, get your app's API key from the PushSpring Audience Console. You'll use this API key when initializing the SDK in the following steps. You can share API keys between Android and iOS versions of the same app if you like, but each separate app that you integrate the PushSpring SDK into should be given its own API key so the audiences are tracked independently by PushSpring. [block:image] { "images": [ { "image": [ "https://files.readme.io/25f4544-32fAEmN0SxiAlMuaslkv_Screen_Shot_2015-12-01_at_8.33.25_PM.png", "32fAEmN0SxiAlMuaslkv_Screen Shot 2015-12-01 at 8.33.25 PM.png", 2550, 1162, "#949495" ] } ] } [/block] The final integration step in your Unity project will be to call the **PushSpringSDK.Init** method from the Start method of a script that runs when your game starts. Pass it the API key you got from the PushSpring dashboard. [block:code] { "codes": [ { "code": "function Start () {\n PushSpringSDK.Init(\"YOUR-API-KEY\");\n}\n", "language": "javascript" } ] } [/block]