@Leonard Harris It seems like you are having trouble setting up remote messaging with Azure Notification Hubs using a .p8 certificate for token-based authentication. According to the documentation, you can use a .p8 certificate for token-based authentication instead of a traditional .p12 push certificate. However, you are encountering an error when trying to deploy the app with the entitlements key "aps-environment" set to "production".
The error message you are seeing indicates that there is no valid "aps-environment" entitlement string found for the application. This is because you are using token-based authentication with a .p8 file, which does not require the "aps-environment" entitlement key.
It seems that you were able to get remote messaging working on iOS for AppStore build by including the "aps-environment" entitlement key with the value "production". However, this is not working for Adhoc build.
Based on the documentation, it seems that you should not include the "aps-environment" entitlement key when using token-based authentication with a .p8 file. Instead, you should use the following steps to configure your notification hub with APNS information:
- In the Azure portal, on the Notification Hub page, select Apple (APNS) on the left menu.
- For Authentication Mode, select Token.
- Enter the values for Key ID, Bundle ID, Team ID, and Token.
- Select Sandbox mode. Or, to send push notifications to users who purchased your app from the store, select Production mode.