{"__v":9,"_id":"5735001ef07e9d0e003aacc0","category":{"__v":35,"_id":"55e67b5556007d23005fee7d","pages":["55e67b91de6fef23009480cb","55e67c28de6fef23009480ce","55e67c3cde6fef23009480d1","55e680e185a9741900314e96","55e682b7de6fef23009480dc","55ecd69bb2714d2100f227c0","55ecd6c554a67b1700edcf40","55ecd6edae66a30d00446ce7","55ecd777b2714d2100f227c2","55ecda5a7659d21700a7ef9b","55ecdaf6ae66a30d00446cf3","55ed006a0d968e2100de831e","55ed0258c9d5b3350072ae7a","55ee66a073d3941700f760e5","55f5ef61a1dea80d00a5dec5","55f5f38618b39b0d00c27eb0","55f9f86417b9d00d00969e29","55f9fdc8aba81f0d00a1156d","561b10b4c89cc30d0082154f","561b110a03bce90d00c4bd11","561c6195ad272c0d00a892dd","561c6ca0be5fb20d00077754","564f3e66c133343500286ca0","565b955b922c9a0d00d1f124","566784d2919aaa0d008e32db","566e1ee5972a290d00552084","569c58d77c3e44170014114f","56a2692f6928550d006c8327","56ca6c868014e417002bfe54","56cfa5386c5d7a13005eec0f","56e73d86555c030e00a52a73","56e7460c9000b120000ffe2e","56e8c19e99c6400e003820cf","56e8c53fc88bf80e00f8bed8","56f06ff4d386ce0e008e9b21"],"project":"55e67aaa9cc7c62b00c4a1ea","version":"55e67aab9cc7c62b00c4a1ed","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-02T04:30:13.305Z","from_sync":false,"order":1,"slug":"install-in-your-app","title":"Install in your app"},"parentDoc":null,"project":"55e67aaa9cc7c62b00c4a1ea","user":"55d29988486de50d00327118","version":{"__v":10,"_id":"55e67aab9cc7c62b00c4a1ed","project":"55e67aaa9cc7c62b00c4a1ea","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z","categories":["55e67aac9cc7c62b00c4a1ee","55e67b5556007d23005fee7d","55e67b5dde6fef23009480ca","55e680efde6fef23009480db","55e6829485a9741900314e99","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","589b8e1fdbb7cd190026732c","58b8ca5e3265d70f001788d4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["5803e840b3a7562d004208e1","59142f8dbb92601b00a4f9c4"],"next":{"pages":[],"description":""},"createdAt":"2016-05-12T22:13:50.181Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":23,"body":"Certain settings can prevent your device from receiving push notifications. This guide will help you understand the most common causes and will present steps to troubleshoot the issue. \n\nIf you are configuring push notifications for the first time, check [Integrate the SDK](doc:sdk-integration).\n\n\n## iOS\n* Double-check you have followed our [step by step guide](doc:push-notifications-for-ios).\n* iOS Simulator cannot receive push notifications. You will need to use a real device.\n* iOS will not display push notifications for your app if is currently open. Make sure your app is closed or in background.\n* Make sure Do Not Disturb is turned off.\n* Make sure you have an active internet connection.\n* In your network settings, make sure TCP Port 5223 is open. APNS uses this port to deliver push notifications. If you are behind a firewall or your corporate network blocks certain ports, try switching to your cellular connection (4G or LTE).\n* If you have a proxy enabled or a root certificate to intercept and debug HTTP traffic, make sure they are disabled. \n* Restart your device.\n* You are trying to push to a device in debug mode, but you did not [set the development flag](https://docs.carnival.io/v1.0/docs/testing-developer-push-notifications). \n\n### Check your device is marked as Push Enabled\nRun your app on your device. You should receive the notifications opt-in prompt. Tap **OK**.\nIn your app Dashboard, go to Settings -> Logs. Under Devices, look for your device. It should be marked as **Push Enabled**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b48a85e-ios_push_enabled.png\",\n        \"ios_push_enabled.png\",\n        549,\n        146,\n        \"#e1e9f1\"\n      ]\n    }\n  ]\n}\n[/block]\nIf your device is not marked as Push Enabled, it means it's failing to register for push. This happens if the user declined the push notification prompt or if the provisioning profile is misconfigured.\n\n### Check your device is getting a push token\nTo verify your device is getting a token, add a break point to `application:didRegisterForRemoteNotificationsWithDeviceToken:` to be sure a token is being generated. If this is not hit, try adding one to `application:didFailToRegisterForRemoteNotificationsWithError:` and inspect the error.\n\nIf you see the device is getting a push token, but fails to register in the Device Logs, consider [passing the token manually](doc:manually-passing-push-tokens-to-carnival).\n\n### Your device is not present in the Device Logs\nIf your device initially registers as Push Enabled, then disappears from the logs when you send a push, you may have forgotten to [mark it as a development device](https://docs.carnival.io/v1.0/docs/testing-developer-push-notifications).\n\n\n### Check your Entitlements file\nIf you migrated your project from a previous version of Xcode, disable your Push Notifications capability, than enable it again. Certain versions of Xcode do not generate the `entitlements.mobileprovision` file correctly, and this will force Xcode to include it again in your build. See [Push Notifications for iOS](doc:push-notifications-for-ios#enable-push-notification-xcode) for more details.\n\n1. Build your app, then locate the `.ipa` file. Change its extension to `.zip`.\n2. Expand the .zip file and locate the `Payload` folder\n3. Make sure a file named `embedded.mobileprovision` exists inside the `Payload` folder\n4. Check that the APNS gateway setting exists and is set to `production`. To do so, check \"Creating an .ipa file to check the entitlements of an iOS app store submission\" on [Apple Developer](https://developer.apple.com/library/content/qa/qa1798/_index.html).\n\n## In-App links are not working\nIf you find your website links, such as those that do not use https, are not loading in our Full Screen Messages windows, you may need to [disable App Transport Security](http://stackoverflow.com/questions/30731785/how-do-i-load-an-http-url-with-app-transport-security-enabled-in-ios-9). Remember, App Transport Security must be enabled before submitting your app to the App Store.\n\n## Android\n* Double-check you have followed our [step by step guide](http://docs.carnival.io/v1.0/docs/enable-push-notifications-for-android).\n* Go to Settings -> Developer. Under Android, make sure you have entered your GCM details.\n* In your device, make sure you have Google Play installed and you are logged in.\n* If you are behind a firewall or your corporate network blocks certain ports, try switching to your cellular connection (4G or LTE).\n* If you have a proxy enabled or a root certificate to intercept and debug HTTP traffic, make sure they are disabled. \n* Restart your device.\n\n### Check your device is marked as Push Enabled\nRun your app on your device. The device should register with Carnival when your main activity starts.\nIn your app Dashboard, go to Settings -> Logs. Under Devices, look for your device. It should be marked as **Push Enabled**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4634b2e-Screen_Shot_2016-12-02_at_10.59.54_AM.png\",\n        \"Screen Shot 2016-12-02 at 10.59.54 AM.png\",\n        556,\n        151,\n        \"#e1e9f0\"\n      ]\n    }\n  ]\n}\n[/block]\nIf your device is not marked as Push Enabled, check the Android Monitor Logcat. Your device should be able to register successfully with both GCM and Carnival. You should see something like this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ adb logcat\\n...\\n12-02 16:58:54.546 17444 17472 D Carnival: Device Registered with Carnival: 57e4277e6abcdabcdd5aabcd\\n12-02 16:59:13.921 17803 17836 D Carnival: Device registered with GCM\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIf the device fails to register with Carnival or GCM, you will see something similar to this (one or more of these events, not necessarily happening at the same time):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ adb logcat\\n...\\n12-02 17:41:23.726 20991 21013 E Carnival: GCM Registration Error java.io.IOException: INVALID_PARAMETERS\\n12-02 17:41:24.086 20991 21013 E Carnival: Carnival Registration Error com.carnival.sdk.HttpResponseException: Request unsuccessful: 401 Unauthorized\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n### Check your Google Play Services version\nCarnival requires Google Play Services 9.4.0 or later. If you fail to receive pushes, your version may differ or be outdated. In this situation, push notifications may fail with no error.\n\nIf you are starting a new project using the latest Android APIs, you should already be using the latest version of Google Play Services. You can also explicitly specify your Google Play Services version in your app's `build.gradle`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n    compile 'com.carnival.sdk:carnival:4.0.0'\\n    compile 'com.google.android.gms:play-services:10.0.1'\\n}\\n\",\n      \"language\": \"groovy\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you are still having issues, [contact our Support team](mailto:support:::at:::sailthru.com).\",\n  \"title\": \"Still having issues?\"\n}\n[/block]","excerpt":"Useful tips for the most common issues with push notifications","slug":"troubleshooting","type":"basic","title":"Troubleshooting"}

Troubleshooting

Useful tips for the most common issues with push notifications

Certain settings can prevent your device from receiving push notifications. This guide will help you understand the most common causes and will present steps to troubleshoot the issue. If you are configuring push notifications for the first time, check [Integrate the SDK](doc:sdk-integration). ## iOS * Double-check you have followed our [step by step guide](doc:push-notifications-for-ios). * iOS Simulator cannot receive push notifications. You will need to use a real device. * iOS will not display push notifications for your app if is currently open. Make sure your app is closed or in background. * Make sure Do Not Disturb is turned off. * Make sure you have an active internet connection. * In your network settings, make sure TCP Port 5223 is open. APNS uses this port to deliver push notifications. If you are behind a firewall or your corporate network blocks certain ports, try switching to your cellular connection (4G or LTE). * If you have a proxy enabled or a root certificate to intercept and debug HTTP traffic, make sure they are disabled. * Restart your device. * You are trying to push to a device in debug mode, but you did not [set the development flag](https://docs.carnival.io/v1.0/docs/testing-developer-push-notifications). ### Check your device is marked as Push Enabled Run your app on your device. You should receive the notifications opt-in prompt. Tap **OK**. In your app Dashboard, go to Settings -> Logs. Under Devices, look for your device. It should be marked as **Push Enabled**. [block:image] { "images": [ { "image": [ "https://files.readme.io/b48a85e-ios_push_enabled.png", "ios_push_enabled.png", 549, 146, "#e1e9f1" ] } ] } [/block] If your device is not marked as Push Enabled, it means it's failing to register for push. This happens if the user declined the push notification prompt or if the provisioning profile is misconfigured. ### Check your device is getting a push token To verify your device is getting a token, add a break point to `application:didRegisterForRemoteNotificationsWithDeviceToken:` to be sure a token is being generated. If this is not hit, try adding one to `application:didFailToRegisterForRemoteNotificationsWithError:` and inspect the error. If you see the device is getting a push token, but fails to register in the Device Logs, consider [passing the token manually](doc:manually-passing-push-tokens-to-carnival). ### Your device is not present in the Device Logs If your device initially registers as Push Enabled, then disappears from the logs when you send a push, you may have forgotten to [mark it as a development device](https://docs.carnival.io/v1.0/docs/testing-developer-push-notifications). ### Check your Entitlements file If you migrated your project from a previous version of Xcode, disable your Push Notifications capability, than enable it again. Certain versions of Xcode do not generate the `entitlements.mobileprovision` file correctly, and this will force Xcode to include it again in your build. See [Push Notifications for iOS](doc:push-notifications-for-ios#enable-push-notification-xcode) for more details. 1. Build your app, then locate the `.ipa` file. Change its extension to `.zip`. 2. Expand the .zip file and locate the `Payload` folder 3. Make sure a file named `embedded.mobileprovision` exists inside the `Payload` folder 4. Check that the APNS gateway setting exists and is set to `production`. To do so, check "Creating an .ipa file to check the entitlements of an iOS app store submission" on [Apple Developer](https://developer.apple.com/library/content/qa/qa1798/_index.html). ## In-App links are not working If you find your website links, such as those that do not use https, are not loading in our Full Screen Messages windows, you may need to [disable App Transport Security](http://stackoverflow.com/questions/30731785/how-do-i-load-an-http-url-with-app-transport-security-enabled-in-ios-9). Remember, App Transport Security must be enabled before submitting your app to the App Store. ## Android * Double-check you have followed our [step by step guide](http://docs.carnival.io/v1.0/docs/enable-push-notifications-for-android). * Go to Settings -> Developer. Under Android, make sure you have entered your GCM details. * In your device, make sure you have Google Play installed and you are logged in. * If you are behind a firewall or your corporate network blocks certain ports, try switching to your cellular connection (4G or LTE). * If you have a proxy enabled or a root certificate to intercept and debug HTTP traffic, make sure they are disabled. * Restart your device. ### Check your device is marked as Push Enabled Run your app on your device. The device should register with Carnival when your main activity starts. In your app Dashboard, go to Settings -> Logs. Under Devices, look for your device. It should be marked as **Push Enabled**. [block:image] { "images": [ { "image": [ "https://files.readme.io/4634b2e-Screen_Shot_2016-12-02_at_10.59.54_AM.png", "Screen Shot 2016-12-02 at 10.59.54 AM.png", 556, 151, "#e1e9f0" ] } ] } [/block] If your device is not marked as Push Enabled, check the Android Monitor Logcat. Your device should be able to register successfully with both GCM and Carnival. You should see something like this: [block:code] { "codes": [ { "code": "$ adb logcat\n...\n12-02 16:58:54.546 17444 17472 D Carnival: Device Registered with Carnival: 57e4277e6abcdabcdd5aabcd\n12-02 16:59:13.921 17803 17836 D Carnival: Device registered with GCM", "language": "shell" } ] } [/block] If the device fails to register with Carnival or GCM, you will see something similar to this (one or more of these events, not necessarily happening at the same time): [block:code] { "codes": [ { "code": "$ adb logcat\n...\n12-02 17:41:23.726 20991 21013 E Carnival: GCM Registration Error java.io.IOException: INVALID_PARAMETERS\n12-02 17:41:24.086 20991 21013 E Carnival: Carnival Registration Error com.carnival.sdk.HttpResponseException: Request unsuccessful: 401 Unauthorized", "language": "shell" } ] } [/block] ### Check your Google Play Services version Carnival requires Google Play Services 9.4.0 or later. If you fail to receive pushes, your version may differ or be outdated. In this situation, push notifications may fail with no error. If you are starting a new project using the latest Android APIs, you should already be using the latest version of Google Play Services. You can also explicitly specify your Google Play Services version in your app's `build.gradle`: [block:code] { "codes": [ { "code": "dependencies {\n compile 'com.carnival.sdk:carnival:4.0.0'\n compile 'com.google.android.gms:play-services:10.0.1'\n}\n", "language": "groovy" } ] } [/block] [block:callout] { "type": "info", "body": "If you are still having issues, [contact our Support team](mailto:support@sailthru.com).", "title": "Still having issues?" } [/block]