{"_id":"566c97739aa84517001b4fc3","category":{"_id":"566c97739aa84517001b4fbd","pages":["566c97739aa84517001b4fc0","566c97739aa84517001b4fc1","566c97739aa84517001b4fc2","566c97739aa84517001b4fc3","566c97739aa84517001b4fc4","566c97739aa84517001b4fc5","566c97739aa84517001b4fc6","566c97739aa84517001b4fc7","566c97739aa84517001b4fc8","566c97739aa84517001b4fc9"],"project":"544494099be40214000dedb6","version":"566c97729aa84517001b4fbb","__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-20T05:03:22.419Z","from_sync":false,"order":1,"slug":"how-to","title":"How to"},"user":"54449dc49be40214000dedda","version":{"_id":"566c97729aa84517001b4fbb","__v":1,"project":"544494099be40214000dedb6","createdAt":"2015-12-12T21:53:54.721Z","releaseDate":"2015-12-12T21:53:54.721Z","categories":["566c97739aa84517001b4fbc","566c97739aa84517001b4fbd","566c97739aa84517001b4fbe","566c97739aa84517001b4fbf"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.1.0","version":"2.1"},"project":"544494099be40214000dedb6","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-23T08:57:24.640Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":5,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Download Pushmote iOS SDK\"\n}\n[/block]\nDownload and unzip the Pushmote iOS SDK.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Copy Pushmote SDK to your Project\"\n}\n[/block]\nCopy PushmoteSDK folder into your project.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/N4xLgOl6RymWRE4FBAEL_copy1.png\",\n        \"copy1.png\",\n        \"1137\",\n        \"798\",\n        \"#425074\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nSelect \"Copy items if needed\"\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/QIWAi9CSe6aHNfFas49m_copy-items-if-needed.png\",\n        \"copy-items-if-needed.png\",\n        \"1134\",\n        \"541\",\n        \"#354b76\",\n        \"\"\n      ],\n      \"caption\": \"\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/v7g7rDvoRo64v15OBfVT_after-copy.png\",\n        \"after-copy.png\",\n        \"1136\",\n        \"604\",\n        \"#2f4e8c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Add libraries to your project\"\n}\n[/block]\nOpen your **Project Settings** and go to the **Build Phases** tab. On the **Link Binary With Libraries** section, click \"+\" (plus icon). On the popup window, click \"Add other...\" at the bottom and select these frameworks;\n\n  * CoreBluetooth.framework\n  * CoreLocation.framework\n  * MediaPlayer.framework\n  * MessageUI.framework\n  * Accelerate.framework\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3lMTgxgPRIOzGDkLWIdx_Screenshot%202015-06-14%2013.35.41.png\",\n        \"Screenshot 2015-06-14 13.35.41.png\",\n        \"894\",\n        \"619\",\n        \"#8b3d17\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Add \\\"Objective-c Bridging\\\"\"\n}\n[/block]\nGo to Build Settings section of project settings and search for \"Objective-c Bridging\". (You need to change :::at:::@[email protected]@ with yours.) Then add the following line:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$(PROJECT_DIR)/@@[email protected]@/Pushmote-Bridging-Header.h\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/GgBS1W8dTEGRTlwLlFC4_step5b.png\",\n        \"step5b.png\",\n        \"704\",\n        \"313\",\n        \"#2a4788\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. Create and Add Objective-c Bridging Header file\"\n}\n[/block]\nCreate \"**Pushmote-Bridging-Header.h**\" file and import \"**PushmoteSDK**\".\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//  Pushmote-Bridging-Header.h\\n\\n#import \\\"PushmoteSDK/Pushmote.h\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"6. Add capabilities to your project\"\n}\n[/block]\nSelect \"Capabilities\" to add these to your project:\n\n  * Background fetch\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/U59GnrcDQTego985heLO_background_modes.png\",\n        \"background_modes.png\",\n        \"1212\",\n        \"579\",\n        \"\",\n        \"\"\n      ],\n      \"caption\": \"Adding required capabilities to project\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"7. Include Pushmote header and calls\"\n}\n[/block]\nAdd the following line as the first line of \"**func application**\"\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Pushmote .startWithApplicationId(\\\"YOUR_APPLICATION_KEY_HERE\\\")\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\nAdd NSLocationAlwaysUsageDescription to your .plist file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\t<key>NSLocationAlwaysUsageDescription</key>\\n\\t<string>This is required for iBeacon experience.</string>\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Bravo!\"\n}\n[/block]\nThat's all! You successfully imported the Pushmote SDK into your iOS Mobile application.","excerpt":"","slug":"import-pushmote-ios-sdk-swift","type":"basic","title":"Import Pushmote iOS SDK (Swift)"}

Import Pushmote iOS SDK (Swift)


[block:api-header] { "type": "basic", "title": "1. Download Pushmote iOS SDK" } [/block] Download and unzip the Pushmote iOS SDK. [block:api-header] { "type": "basic", "title": "2. Copy Pushmote SDK to your Project" } [/block] Copy PushmoteSDK folder into your project. [block:image] { "images": [ { "image": [ "https://files.readme.io/N4xLgOl6RymWRE4FBAEL_copy1.png", "copy1.png", "1137", "798", "#425074", "" ] } ] } [/block] Select "Copy items if needed" [block:image] { "images": [ { "image": [ "https://files.readme.io/QIWAi9CSe6aHNfFas49m_copy-items-if-needed.png", "copy-items-if-needed.png", "1134", "541", "#354b76", "" ], "caption": "" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/v7g7rDvoRo64v15OBfVT_after-copy.png", "after-copy.png", "1136", "604", "#2f4e8c", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "3. Add libraries to your project" } [/block] Open your **Project Settings** and go to the **Build Phases** tab. On the **Link Binary With Libraries** section, click "+" (plus icon). On the popup window, click "Add other..." at the bottom and select these frameworks; * CoreBluetooth.framework * CoreLocation.framework * MediaPlayer.framework * MessageUI.framework * Accelerate.framework [block:image] { "images": [ { "image": [ "https://files.readme.io/3lMTgxgPRIOzGDkLWIdx_Screenshot%202015-06-14%2013.35.41.png", "Screenshot 2015-06-14 13.35.41.png", "894", "619", "#8b3d17", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "4. Add \"Objective-c Bridging\"" } [/block] Go to Build Settings section of project settings and search for "Objective-c Bridging". (You need to change @@[email protected]@ with yours.) Then add the following line: [block:code] { "codes": [ { "code": "$(PROJECT_DIR)/@@[email protected]@/Pushmote-Bridging-Header.h", "language": "text" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/GgBS1W8dTEGRTlwLlFC4_step5b.png", "step5b.png", "704", "313", "#2a4788", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "5. Create and Add Objective-c Bridging Header file" } [/block] Create "**Pushmote-Bridging-Header.h**" file and import "**PushmoteSDK**". [block:code] { "codes": [ { "code": "// Pushmote-Bridging-Header.h\n\n#import \"PushmoteSDK/Pushmote.h\"", "language": "text" } ] } [/block] [block:api-header] { "type": "basic", "title": "6. Add capabilities to your project" } [/block] Select "Capabilities" to add these to your project: * Background fetch [block:image] { "images": [ { "image": [ "https://files.readme.io/U59GnrcDQTego985heLO_background_modes.png", "background_modes.png", "1212", "579", "", "" ], "caption": "Adding required capabilities to project" } ] } [/block] [block:api-header] { "type": "basic", "title": "7. Include Pushmote header and calls" } [/block] Add the following line as the first line of "**func application**" [block:code] { "codes": [ { "code": "Pushmote .startWithApplicationId(\"YOUR_APPLICATION_KEY_HERE\")", "language": "objectivec" } ] } [/block] Add NSLocationAlwaysUsageDescription to your .plist file. [block:code] { "codes": [ { "code": "\t<key>NSLocationAlwaysUsageDescription</key>\n\t<string>This is required for iBeacon experience.</string>", "language": "text" } ] } [/block] [block:api-header] { "type": "basic", "title": "Bravo!" } [/block] That's all! You successfully imported the Pushmote SDK into your iOS Mobile application.