{"_id":"5579ab5fc7fb3f2100096fad","__v":33,"project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"parentDoc":null,"githubsync":"","user":"54aa7f3f9bb00c0b00cb899b","category":{"_id":"55781fe35129590d003ff4fb","version":"55781fe25129590d003ff4f7","__v":11,"pages":["55781fe45129590d003ff517","55781fe45129590d003ff518","55781fe45129590d003ff519","55781fe45129590d003ff51a","55781fe45129590d003ff51b","55781fe45129590d003ff51c","55781fe45129590d003ff51d","55781fe45129590d003ff51e","55781fe45129590d003ff51f","55781fe45129590d003ff520","55781fe45129590d003ff521","55781fe45129590d003ff522","5579ab5fc7fb3f2100096fad","55f7de1660cc850d008a7a22","55f7e1fbe32e9b0d00a2d4d0","561f72bacec1a50d00979598","561f764f61c0521700acc428","563337539c607719001b85dd","564318f1f49bfa0d002f5566","564f03454f000617007bd670","565ee80a23fd5f0d00a129f9","56793cd73473bc0d008e141b"],"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:43:51.897Z","from_sync":false,"order":3,"slug":"ios-sdk","title":"iOS SDK"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-11T15:38:07.351Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Pulsate iOS SDK is a static library built with slices for arm7, arm64 and simulator architecture. It's a bridge between your customers' mobile devices and the Pulsate server. **The SDK Supports iOS 8.0 - 11.0**. It's very easy to use, and even easier to install thanks to the [CocoaPods](https://cocoapods.org/) dependency manager.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1: Setup CocoaPods\"\n}\n[/block]\nCocoaPods is built in Ruby and you can install it with the Terminal:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ sudo gem install cocoapods\",\n      \"language\": \"shell\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\nAfter you install CocoaPods, you can setup the files needed to integrate by going to your XCode project folder and running:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ pod init\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIf you have any problems, please refer to the official [CocoaPods Getting Started](http://guides.cocoapods.org/using/getting-started.html) document.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2: Installing dependencies\"\n}\n[/block]\nThe last step should produce the *Podfile* file, where you declare all your dependencies. You need to add a *PULPulsate* dependency:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Uncomment this line if you're using Swift\\n# use_frameworks!\\n\\ntarget 'PulsateDemoProject' do\\n\\npod 'PULPulsate'\\n\\nend\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nAfter saving the *Podfile* you can run the command that will install your dependencies and set your project to use them:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ pod install\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"After integrating CocoaPods with your project, please remember to always use the \\\\*.xcworkspace file, not \\\\*.xcodeproj to open your project.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Manual installation\",\n  \"body\": \"It is highly recommended to use CocoaPods to integrate Pulsate with your project. If you wish to install the SDK manually please refer to the [Manually Installing the Pulsate SDK](http://pulsate.readme.io/v2.0/docs/manually-installing-the-pulsate-sdk) guide.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Updating your pods\",\n  \"body\": \"You can update your pods by using:\\n\\n*$ pod update*\\n\\nPlease be careful when updating the PULPulsate pod. It'll overwrite all the UI and language customizations you might have in your PULPulsateBasic.bundle. Please keep a copy of your customizations when updating.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 3: Adding CoreLocation Authorization Key\"\n}\n[/block]\niOS 8.0 and later requires adding \"NSLocationAlwaysUsageDescription\" to your *.plist file for CoreLocation to work.\niOS 11 and later requires adding the \"NSLocationAlwaysAndWhenInUseUsageDescription\" and \"NSLocationWhenInUseUsageDescription\" keys.\n\nAdd all three keys to your project’s *Info.plist* containing the message to be displayed to the user at the prompt. For example \"We use this to provide the best experience possible inside our store. We also send relevant communications based on your location.\"\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7783492-2017-09-19_11.57.22_am.png\",\n        \"2017-09-19 11.57.22 am.png\",\n        1756,\n        154,\n        \"#dcdede\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"When In Use Permission\",\n  \"body\": \"If your app already has the *When In Use* permission, there's no way to show the location prompt second time. The only way for the users to update the permission from *When In Use* to *Always* is in the settings. You can open the settings for the user programatically:\\n\\n `NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];`\\n `[[UIApplication sharedApplication] openURL:url];`\\n\\n or send them a campaign with `app-settings:` deeplink.\"\n}\n[/block]","excerpt":"","slug":"installing-the-pulsate-sdk","type":"basic","title":"Installing iOS SDK using CocoaPods"}

Installing iOS SDK using CocoaPods


Pulsate iOS SDK is a static library built with slices for arm7, arm64 and simulator architecture. It's a bridge between your customers' mobile devices and the Pulsate server. **The SDK Supports iOS 8.0 - 11.0**. It's very easy to use, and even easier to install thanks to the [CocoaPods](https://cocoapods.org/) dependency manager. [block:api-header] { "type": "basic", "title": "Step 1: Setup CocoaPods" } [/block] CocoaPods is built in Ruby and you can install it with the Terminal: [block:code] { "codes": [ { "code": "$ sudo gem install cocoapods", "language": "shell", "name": null } ] } [/block] After you install CocoaPods, you can setup the files needed to integrate by going to your XCode project folder and running: [block:code] { "codes": [ { "code": "$ pod init", "language": "shell" } ] } [/block] If you have any problems, please refer to the official [CocoaPods Getting Started](http://guides.cocoapods.org/using/getting-started.html) document. [block:api-header] { "type": "basic", "title": "Step 2: Installing dependencies" } [/block] The last step should produce the *Podfile* file, where you declare all your dependencies. You need to add a *PULPulsate* dependency: [block:code] { "codes": [ { "code": "# Uncomment this line if you're using Swift\n# use_frameworks!\n\ntarget 'PulsateDemoProject' do\n\npod 'PULPulsate'\n\nend", "language": "text" } ] } [/block] After saving the *Podfile* you can run the command that will install your dependencies and set your project to use them: [block:code] { "codes": [ { "code": "$ pod install", "language": "text" } ] } [/block] [block:callout] { "type": "info", "body": "After integrating CocoaPods with your project, please remember to always use the \\*.xcworkspace file, not \\*.xcodeproj to open your project." } [/block] [block:callout] { "type": "info", "title": "Manual installation", "body": "It is highly recommended to use CocoaPods to integrate Pulsate with your project. If you wish to install the SDK manually please refer to the [Manually Installing the Pulsate SDK](http://pulsate.readme.io/v2.0/docs/manually-installing-the-pulsate-sdk) guide." } [/block] [block:callout] { "type": "danger", "title": "Updating your pods", "body": "You can update your pods by using:\n\n*$ pod update*\n\nPlease be careful when updating the PULPulsate pod. It'll overwrite all the UI and language customizations you might have in your PULPulsateBasic.bundle. Please keep a copy of your customizations when updating." } [/block] [block:api-header] { "type": "basic", "title": "Step 3: Adding CoreLocation Authorization Key" } [/block] iOS 8.0 and later requires adding "NSLocationAlwaysUsageDescription" to your *.plist file for CoreLocation to work. iOS 11 and later requires adding the "NSLocationAlwaysAndWhenInUseUsageDescription" and "NSLocationWhenInUseUsageDescription" keys. Add all three keys to your project’s *Info.plist* containing the message to be displayed to the user at the prompt. For example "We use this to provide the best experience possible inside our store. We also send relevant communications based on your location." [block:image] { "images": [ { "image": [ "https://files.readme.io/7783492-2017-09-19_11.57.22_am.png", "2017-09-19 11.57.22 am.png", 1756, 154, "#dcdede" ] } ] } [/block] [block:callout] { "type": "warning", "title": "When In Use Permission", "body": "If your app already has the *When In Use* permission, there's no way to show the location prompt second time. The only way for the users to update the permission from *When In Use* to *Always* is in the settings. You can open the settings for the user programatically:\n\n `NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];`\n `[[UIApplication sharedApplication] openURL:url];`\n\n or send them a campaign with `app-settings:` deeplink." } [/block]