{"__v":0,"_id":"57ab7666f68f6e1900a8ab8d","category":{"__v":2,"_id":"551ef4ef4986f62b00a72036","pages":["551ef4f04986f62b00a72052","551ef4f04986f62b00a72053","551ef4f04986f62b00a72054","551ef4f04986f62b00a72055","55e762f559f5ed21004f554c"],"project":"542b6018044e1e2200413772","version":"551ef4ef4986f62b00a7202e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-20T19:30:55.496Z","from_sync":false,"order":1,"slug":"ios","title":"iOS"},"parentDoc":null,"project":"542b6018044e1e2200413772","user":"577c38505fd4de0e00cc3bcc","version":{"__v":10,"_id":"551ef4ef4986f62b00a7202e","forked_from":"542b6018044e1e2200413775","project":"542b6018044e1e2200413772","createdAt":"2015-04-03T20:15:43.149Z","releaseDate":"2015-04-03T20:15:43.149Z","categories":["551ef4ef4986f62b00a7202f","551ef4ef4986f62b00a72030","551ef4ef4986f62b00a72031","551ef4ef4986f62b00a72032","551ef4ef4986f62b00a72033","551ef4ef4986f62b00a72034","551ef4ef4986f62b00a72035","551ef4ef4986f62b00a72036","551ef4ef4986f62b00a72037","551ef4ef4986f62b00a72038","551ef4ef4986f62b00a72039","551ef4ef4986f62b00a7203a","551ef4ef4986f62b00a7203b","551ef4ef4986f62b00a7203c","551ef4ef4986f62b00a7203d","551ef4ef4986f62b00a7203e","55d7f1879510f00d007ec727","56b94a5a9fc0de1700b60ae9","56bd0e48ac1c5c1900b2dbe4","56d74afc3eb4dd0b0020196a","5723ab8a1f41110e003081ed","576b4dd327d6252b00085422","5792ca4369c5120e00efe023","5792ca55366dd20e004736d7","5792d30b23106419009c431b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"createdAt":"2016-08-10T18:45:58.762Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[1. Resetting the iOS Notification Permission Prompt](#1-resetting-the-ios-notification-permission-prompt)\n[2. iOS notifications with action buttons not displaying](#2-ios-notifications-with-action-buttons-not-displa)\n[3. Swift : No such module 'OneSignal'](#3-swift--no-such-module-onesignal)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Resetting the iOS Notification Permission Prompt\"\n}\n[/block]\n*(Pre iOS 9)*\niOS prompts the user to allow displaying of notifications with a system prompt. Our SDK's default setting is to request permissions as soon as your app is opened however we recommend you delay the prompt by disabling autoRegister and calling register at a later point. *(See the SDK API that applies to your app for details)* Delaying the prompt can get your app better opted rates if you prompt after they compete your tutorial for example. Since iOS remembers the answer to the notification permissions question even after a full reinstall it can be tricky to reset the prompt to test it again so we have written the following instructions below.\n<br>\n\n ** Clear Notification Permission Answer **\n1. Uninstall your app.\n2. Reboot the device.\n3. Set your system clock ahead 1 day.  \n*(Do no set your clock over 1 week ahead as you may no longer receive pushes)*\n4. Reboot the device again.\n5. Reinstall your app and it will prompt you again.\n\n<br>\n** Quick way to test displaying of the prompt **\n1. When you see the notification permission DO NOT answer it.\n2. Power the device off.\n3. After the device powers back on, fully uninstall then reinstall your app.\n\n<br>\n** IOS 9 **\n - Permission is now reset when the app is uninstalled.\n\n<br>\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. iOS notifications with action buttons not displaying\"\n}\n[/block]\nIn order for notifications with buttons to display the following must be true:\n\n**1.** You can not force close the app by double tapping the home button and swiping away your app.\n  - If this is the case you will see an entry in the device log in Xcode like the following.\n  - `apsd[83] <Warning>: Low Priority Push: com.onesignal.example - App killed`\n\n**2.** Go to Settings>General>\"Background App Refresh\" and mke sure it is enable for both the device and your app.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f646977-5bsj3MgMRIOtFFRejroN_Screen_Shot_2015-12-17_at_1.54.25_PM.png\",\n        \"5bsj3MgMRIOtFFRejroN_Screen Shot 2015-12-17 at 1.54.25 PM.png\",\n        768,\n        410,\n        \"#edecf1\"\n      ]\n    }\n  ]\n}\n[/block]\n**3.** Make sure \"Remote notifications\" are checked under Capabilities>Background Modes shown in [step 2. Add Required Capabilities](https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk#2-add-required-capabilities). Note: This is automatic for some plugins like Cordova and Corona.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Swift : No such module 'OneSignal'\"\n}\n[/block]\n**CocoaPods:** Pods written in Swift can be imported with the use_frameworks!, and CocoaPods will complain if you don't do this and try to import the pods in Swift code. OneSignal SDK is currently not written in swift and any pods not written in Swift, will require the use of a bridging header.\nReferencing to the OneSignal pod, the getting-started guide instructs applications using Swift to include a bridging header in order to use the pod. [OneSignal: Getting Started Guide](https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk#3a-swift-only-add-bridging-header-click-to-expand)\n\n**Manual Import:** One way to solve your issue is to go into your build settings and defining the **Framework Search Paths** to a folder which contains the frameworks in question. If the OneSignal framework is placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive.\n\n<br><br>\n\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Add Required Capabilities\"\n}\n[/block]\n**4.1** Select the root project and Under Capabilities Enable \"Push Notifications\".\n**4.2** Next Enable \"Background Modes\" and check \"Remote notifications\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e21c2d8-Xcode_capabilities.png\",\n        \"Xcode capabilities.png\",\n        961,\n        774,\n        \"#f0f0f0\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Still having problems? We're happy to help!\",\n  \"body\": \"We answer most support queries in under 4 hours during the week, and under 24 hours on weekends. Simply email us at support:::at:::onesignal.com. \\n\\nInclude as much as you can of the following to help us find your issue quicker: \\n\\n- Version of our SDK \\n- Device OS version\\n- Xcode crash lock or stack trace of the app starting and the problem point\\n- Any other libraries or plugins in your app\\n- Details on reproducing your problem.\"\n}\n[/block]","excerpt":"","slug":"common-problems-1","type":"basic","title":"Troubleshooting"}
[1. Resetting the iOS Notification Permission Prompt](#1-resetting-the-ios-notification-permission-prompt) [2. iOS notifications with action buttons not displaying](#2-ios-notifications-with-action-buttons-not-displa) [3. Swift : No such module 'OneSignal'](#3-swift--no-such-module-onesignal) [block:api-header] { "type": "basic", "title": "1. Resetting the iOS Notification Permission Prompt" } [/block] *(Pre iOS 9)* iOS prompts the user to allow displaying of notifications with a system prompt. Our SDK's default setting is to request permissions as soon as your app is opened however we recommend you delay the prompt by disabling autoRegister and calling register at a later point. *(See the SDK API that applies to your app for details)* Delaying the prompt can get your app better opted rates if you prompt after they compete your tutorial for example. Since iOS remembers the answer to the notification permissions question even after a full reinstall it can be tricky to reset the prompt to test it again so we have written the following instructions below. <br> ** Clear Notification Permission Answer ** 1. Uninstall your app. 2. Reboot the device. 3. Set your system clock ahead 1 day. *(Do no set your clock over 1 week ahead as you may no longer receive pushes)* 4. Reboot the device again. 5. Reinstall your app and it will prompt you again. <br> ** Quick way to test displaying of the prompt ** 1. When you see the notification permission DO NOT answer it. 2. Power the device off. 3. After the device powers back on, fully uninstall then reinstall your app. <br> ** IOS 9 ** - Permission is now reset when the app is uninstalled. <br> [block:api-header] { "type": "basic", "title": "2. iOS notifications with action buttons not displaying" } [/block] In order for notifications with buttons to display the following must be true: **1.** You can not force close the app by double tapping the home button and swiping away your app. - If this is the case you will see an entry in the device log in Xcode like the following. - `apsd[83] <Warning>: Low Priority Push: com.onesignal.example - App killed` **2.** Go to Settings>General>"Background App Refresh" and mke sure it is enable for both the device and your app. [block:image] { "images": [ { "image": [ "https://files.readme.io/f646977-5bsj3MgMRIOtFFRejroN_Screen_Shot_2015-12-17_at_1.54.25_PM.png", "5bsj3MgMRIOtFFRejroN_Screen Shot 2015-12-17 at 1.54.25 PM.png", 768, 410, "#edecf1" ] } ] } [/block] **3.** Make sure "Remote notifications" are checked under Capabilities>Background Modes shown in [step 2. Add Required Capabilities](https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk#2-add-required-capabilities). Note: This is automatic for some plugins like Cordova and Corona. [block:api-header] { "type": "basic", "title": "3. Swift : No such module 'OneSignal'" } [/block] **CocoaPods:** Pods written in Swift can be imported with the use_frameworks!, and CocoaPods will complain if you don't do this and try to import the pods in Swift code. OneSignal SDK is currently not written in swift and any pods not written in Swift, will require the use of a bridging header. Referencing to the OneSignal pod, the getting-started guide instructs applications using Swift to include a bridging header in order to use the pod. [OneSignal: Getting Started Guide](https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk#3a-swift-only-add-bridging-header-click-to-expand) **Manual Import:** One way to solve your issue is to go into your build settings and defining the **Framework Search Paths** to a folder which contains the frameworks in question. If the OneSignal framework is placed in your project directory, simply set the framework search path to $(SRCROOT) and set it to recursive. <br><br> [block:api-header] { "type": "basic", "title": "4. Add Required Capabilities" } [/block] **4.1** Select the root project and Under Capabilities Enable "Push Notifications". **4.2** Next Enable "Background Modes" and check "Remote notifications". [block:image] { "images": [ { "image": [ "https://files.readme.io/e21c2d8-Xcode_capabilities.png", "Xcode capabilities.png", 961, 774, "#f0f0f0" ] } ] } [/block] [block:callout] { "type": "info", "title": "Still having problems? We're happy to help!", "body": "We answer most support queries in under 4 hours during the week, and under 24 hours on weekends. Simply email us at [email protected]. \n\nInclude as much as you can of the following to help us find your issue quicker: \n\n- Version of our SDK \n- Device OS version\n- Xcode crash lock or stack trace of the app starting and the problem point\n- Any other libraries or plugins in your app\n- Details on reproducing your problem." } [/block]