{"__v":19,"_id":"55a9094827a17d210052522a","category":{"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","_id":"55b9ff90eb08801900f833e5","pages":[],"__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T10:42:24.499Z","from_sync":false,"order":21,"slug":"xamarin","title":"Xamarin"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"55a5003a750a9a23005332b6","version":{"__v":31,"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["55e0b20e6bad670d0081f2e8","55e0b37d186ca30d00f9b4fb","56c1d550d3199a0d00694bab"],"next":{"pages":[],"description":""},"createdAt":"2015-07-17T13:55:20.403Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[**Download Module**](https://github.com/Pushwoosh/pushwoosh-xamarin/tree/master/iOS/Pushwoosh)\n[**Download Sample**](https://github.com/Pushwoosh/pushwoosh-xamarin/tree/master/iOS/PushwooshSample) \n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"iOS Simulator can neither subscribe to nor receive push notifications.\"\n}\n[/block]\nTo integrate Pushwoosh with your Xamarin iOS application:\n\n**1.** Add  **Pushwoosh** project to your solution:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/s9hgXs3hTZGYZlDC1QUg_xam1.png\",\n        \"xam1.png\",\n        \"817\",\n        \"613\",\n        \"#3e499b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n**2.** Open **References** tree of your project, and choose **Edit References…**:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3DOGI5rwSoClzrHczAAq_xam2.png\",\n        \"xam2.png\",\n        \"509\",\n        \"323\",\n        \"#404a99\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vZbpmzA3QxCMZGr7KE4x_xam3.png\",\n        \"xam3.png\",\n        \"574\",\n        \"441\",\n        \"#88390b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n**3.** Locate and check **Pushwoosh** project in the list.\n\n**4.** In your project, open  **AppDelegate.cs** and connect Pushwoosh by adding the `using Pushwoosh` line.\n\n**5.** In your **Info.plist** add `Pushwoosh_APPID` key with your Pushwoosh Application ID string value.\n\n**6.** Add the methods below to **AppDelegate class**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)\\n{\\n    PushNotificationManager.PushManager.HandlePushRegistration (deviceToken);\\n}\\n \\npublic override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)\\n{\\n    PushNotificationManager.PushManager.HandlePushRegistrationFailure (error);\\n}\\n \\npublic override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)        \\n{\\n     PushNotificationManager.PushManager.HandlePushReceived (userInfo);\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**7.** Add the code below to `public override bool FinishedLaunching(UIApplication app, NSDictionary launchOptions)` method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PushNotificationManager pushmanager = PushNotificationManager.PushManager;\\npushmanager.Delegate = this;\\n \\nif (options != null) {\\n     if (options.ContainsKey (UIApplication.LaunchOptionsRemoteNotificationKey)) { \\n       pushmanager.HandlePushReceived(options);\\n     }\\n}\\n \\npushmanager.RegisterForPushNotifications();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**8.** To use Geozones, add the line below to the same method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pushmanager.StartLocationTracking();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you receive “Error executing task CreateEmbeddedResources: Task does not have property “BundleResources” defined” error while building your app:\\n\\n1. Open your **Pushwoosh.csproj** (binding project) in any text editor and remove the following line:\\n`<Import Project=\\\"$(MSBuildExtensionsPath)\\\\Xamarin\\\\Xamarin.ObjcBinding.CSharp.targets\\\" />`\\n2. Insert the following line (if it is not there already):\\n`<Import Project=\\\"$(MSBuildExtensionsPath)\\\\Xamarin\\\\iOS\\\\Xamarin.iOS.ObjCBinding.CSharp.targets\\\" />`\"\n}\n[/block]","excerpt":"Integrating Pushwoosh SDK into your Xamarin iOS project","slug":"xamarin-ios-sdk","type":"basic","title":"Xamarin iOS SDK"}

Xamarin iOS SDK

Integrating Pushwoosh SDK into your Xamarin iOS project

[**Download Module**](https://github.com/Pushwoosh/pushwoosh-xamarin/tree/master/iOS/Pushwoosh) [**Download Sample**](https://github.com/Pushwoosh/pushwoosh-xamarin/tree/master/iOS/PushwooshSample) [block:callout] { "type": "info", "body": "iOS Simulator can neither subscribe to nor receive push notifications." } [/block] To integrate Pushwoosh with your Xamarin iOS application: **1.** Add **Pushwoosh** project to your solution: [block:image] { "images": [ { "image": [ "https://files.readme.io/s9hgXs3hTZGYZlDC1QUg_xam1.png", "xam1.png", "817", "613", "#3e499b", "" ] } ] } [/block] **2.** Open **References** tree of your project, and choose **Edit References…**: [block:image] { "images": [ { "image": [ "https://files.readme.io/3DOGI5rwSoClzrHczAAq_xam2.png", "xam2.png", "509", "323", "#404a99", "" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/vZbpmzA3QxCMZGr7KE4x_xam3.png", "xam3.png", "574", "441", "#88390b", "" ] } ] } [/block] **3.** Locate and check **Pushwoosh** project in the list. **4.** In your project, open **AppDelegate.cs** and connect Pushwoosh by adding the `using Pushwoosh` line. **5.** In your **Info.plist** add `Pushwoosh_APPID` key with your Pushwoosh Application ID string value. **6.** Add the methods below to **AppDelegate class**: [block:code] { "codes": [ { "code": "public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)\n{\n PushNotificationManager.PushManager.HandlePushRegistration (deviceToken);\n}\n \npublic override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)\n{\n PushNotificationManager.PushManager.HandlePushRegistrationFailure (error);\n}\n \npublic override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) \n{\n PushNotificationManager.PushManager.HandlePushReceived (userInfo);\n}", "language": "csharp" } ] } [/block] **7.** Add the code below to `public override bool FinishedLaunching(UIApplication app, NSDictionary launchOptions)` method: [block:code] { "codes": [ { "code": "PushNotificationManager pushmanager = PushNotificationManager.PushManager;\npushmanager.Delegate = this;\n \nif (options != null) {\n if (options.ContainsKey (UIApplication.LaunchOptionsRemoteNotificationKey)) { \n pushmanager.HandlePushReceived(options);\n }\n}\n \npushmanager.RegisterForPushNotifications();", "language": "csharp" } ] } [/block] **8.** To use Geozones, add the line below to the same method: [block:code] { "codes": [ { "code": "pushmanager.StartLocationTracking();", "language": "csharp" } ] } [/block] [block:callout] { "type": "info", "body": "If you receive “Error executing task CreateEmbeddedResources: Task does not have property “BundleResources” defined” error while building your app:\n\n1. Open your **Pushwoosh.csproj** (binding project) in any text editor and remove the following line:\n`<Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\Xamarin.ObjcBinding.CSharp.targets\" />`\n2. Insert the following line (if it is not there already):\n`<Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.ObjCBinding.CSharp.targets\" />`" } [/block]