I get the following error in the console when running the app:
[Firebase/Messaging][I-FCM012002] Error in application:didFailToRegisterForRemoteNotificationsWithError: no valid “aps-environment” entitlement string found for application
In Capabilities I have added "Push Notifications" but it only seems to be added to the Release build. In "All" it says Push Notifications (Release)
If I go to the Debug tab and add Capabilities, I can see Push Notifications; however, if I double click it or drag it in, nothing happens. It does not add nor show and there is no error thrown.
I presume the error I receive in the console is due to the missing capability for debug which I cannot seem to add unlike for release. Remote notifications are also checked in the "Background Modes" section.
2
Answers
i had also this problem.
I HAVE SOME WORK AROUND FOR THIS.. NOT SURE HOW ITS WORK IN PRODACTION.
what i did is copy the entitlements file and change is name from
testRelease.entitlements
to
test.entitlements
test is the name of app
Opening up Xcode, and go to the
Project Properties > Build Settings > Code Signing Entitlements > Ensure the name of the entitlement file should be the same for ‘Both Debug and Release Configuration’.
For Example… $(SRCROOT)/$(PRODUCT_NAME)/$(PRODUCT_NAME).entitlements
PRODUCT_NAME is your target name.