Issue
You signed the build with the production certificate, you uploaded the same certificate (with the production gateway) to the configuration of your application in Pushwoosh. But in the logs you still see a different gateway:
x
| Pushwoosh request:
| Url: https://XXXXX-XXXXX.api.pushwoosh.com/json/1.3/registerDevice
| Payload: {"request":{"gateway":"sandbox","jailbroken":0,"app_version":"1.9",
"application":"XXXXX-XXXXX","sounds":["bubble.wav"],"device_type":1,"userId":
"FBCA07FE-05EE-4770-B4BA-AB6737BC1A98","language":"en","hwid":"FBCA07FE-05EE-4770-B4BA-AB6737BC1A98",
"package":"com.pushwoosh.pushon","timezone":"0","push_token":
"ae784019d1b8c8e38a1ea06f0800c17a4fa986d6e2d346fc79373e92439ff8f7",
"os_version":"15.7.7","v":"6.4.10","device_model":"iPhone7,1"}}
| Status: "200 no error"
| Response: {"status_code":200,"status_message":"OK","response":{"iosCategories":[]}}
x
In the Message History you see errors: Invalid Token/BadDeviceToken.
Resolution
In some cases, the "aps-environment
" string in the entitlements file could be missed.
The "aps-environment" string is usually added as a key-value pair in the Entitlements
file (usually named something like Entitlements.plist
) of your Xcode project. This file contains various entitlements required for specific features, such as push notifications, in-app purchases, and more.
Double-check that your entitlements file (Entitlements.plist
) contains the aps-environment
key, and it should have a value of production
. If you don't see this key in your entitlements file, you might need to add it manually with the value production
.
Please check your mobile provisioning profile (the one you have used for signing your build) if it has the "aps-environment" string. If it is not there, please note that you should recreate the mobile provisioning profile in the Apple Development Portal. Make sure the "aps-environment" value matches the gateway you are using: Sandbox for “development” and Production for “production” values.
To find the "aps-environment" string in your iOS project, follow these steps:
- Open your iOS project in Xcode.
- In the project navigator, select your app target.
- Select the "Signing & Capabilities" tab.
- In the "Entitlements" section, you should see an "aps-environment" entry with a value of either "development" or "production".
- If the "aps-environment" entry is not present, you can add it manually by clicking the "+" button and selecting "aps-environment" from the drop-down menu.
See also:
- The aps-environment is always development (https://stackoverflow.com/q/42292363)
- Invalid Token/BadDeviceToken
Comments
0 comments
Please sign in to leave a comment.