{"_id":"566c97739aa84517001b4fc2","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"},"project":"544494099be40214000dedb6","__v":0,"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"},"user":"544493a7a21e4d140055d913","updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-20T05:51:57.989Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":4,"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 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\": \"6. Include Pushmote header and calls\"\n}\n[/block]\nInclude the Pushmote header in your **AppDelegate.m** file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <PushmoteSDK/Pushmote.h>\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nadd following line as the first line of \"**application:didFinishLaunchingWithOptions**\" method\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\\n    [Pushmote startWithApplicationId::::at:::\\\"YOUR_APPLICATION_KEY_HERE\\\"];\\n    return YES;\\n}\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nadd following line as the first line of \"**application:didReceiveLocalNotification**\" method\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {\\n    [Pushmote handleNotification:notification];\\n}\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\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","type":"basic","title":"Import Pushmote iOS SDK"}

Import Pushmote iOS SDK


[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 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": "6. Include Pushmote header and calls" } [/block] Include the Pushmote header in your **AppDelegate.m** file: [block:code] { "codes": [ { "code": "#import <PushmoteSDK/Pushmote.h>", "language": "objectivec" } ] } [/block] add following line as the first line of "**application:didFinishLaunchingWithOptions**" method [block:code] { "codes": [ { "code": "- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n [Pushmote startWithApplicationId:@\"YOUR_APPLICATION_KEY_HERE\"];\n return YES;\n}", "language": "objectivec" } ] } [/block] add following line as the first line of "**application:didReceiveLocalNotification**" method [block:code] { "codes": [ { "code": "-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {\n [Pushmote handleNotification:notification];\n}", "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.