Open eros2187 opened 7 years ago
Any luck here?
Firebase spec says
To send messages to specific devices, set the to key to the registration token for the specific app instance.
So, you should check the token count when coming into your code - if it is just one, use 'to'....
InvalidApnsCredential
you must add ( create ) your Apple Development Key with Push Notification Permission https://developer.apple.com/account/ios/authkey/
and app id prefix https://developer.apple.com/account/ios/identifier/bundle
to Firebase iOS app: Firebase Console -> Project -> Settings -> Cloud Messaging -> iOS app configuration
Good luck
I've uploaded my key, but still the same issue.. (InvalidApnsCredential) If I try to sent push with juste APNS and my key file it's work perfectly. (with this script http://thrysoee.dk/apns/)
My curl request :
$pushUrl = "FCM_PUSH_URL"; //https://fcm.googleapis.com/fcm/send
$key = "SERVER_KEY";//Server key get in FCM console
$ch = curl_init($pushUrl);
$headers = [];
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization:key=' . $key;
$data = array(
"notification" => array(
"title" => "Bonjour le monde !",
"body" => "Notif de test",
//"click_action" =>"FCM_PLUGIN_ACTIVITY",
"icon" => "fcm_push_icon",
),
"data" => array(
'msg' => 'hello',
'msg2' => 'world'
),
"to" => "MY_IOS_REGISTER_TOKEN"//token get on my ipad with the getToken method of cordova plugin,
"priority" => "high",
);
$json_data = json_encode($data);
curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
(No problem on android..)
well finally it's worked after 2 days without sucess... In the firebase console use always the teamID for the App prefix ID even if you have a custom prefix for your appID ..
Thank you now I have abandoned this project for a moment now i try to resume everything i can send an email to cloud2187@gmail.com i wanted to ask you some things thanks
Makaveli17, thank you, I was banging my head against the wall for 3 days and your comment fixed my problem. Use the team ID in Firebase config, NOT the app prefix as the docs explicitly tell you. I'm using the new push auth key system, not push certificates, so that may have something to do with it.
Oddly, when I created a test project from scratch and let Xcode do everything, but punched in the app prefix (not team ID) to Firebase config, pushes worked for that app. For my older legacy app, it needed the team ID. Both apps were using the same auth key.
If, by chance, you're porting from GCM to FCM, you MUST change "registration_id" to "to" as a failure to do so will cause the invalidAPNcredential message.
Uploading APNs Authentication Key to Firebase Cloud Messaging settings works for me.
@ostrichegret thank you saved my day!!!
well finally it's worked after 2 days without sucess... In the firebase console use always the teamID for the App prefix ID even if you have a custom prefix for your appID ..
Thank you so much. The ui now actually says Team ID after you save it so I had a really hard time figuring out what was going wrong here with some of my apps.
Solution for me in case with APNs Authentication Key : AuthKey has ID, when downloading key file it like AuthKey_XXXYYYZZZ.p8 When uploading key to firebase console you have to use XXXYYYZZZ as key id Team Id from your profile
@duca14036 Your solution worked for me. In my case, I was confused with the term key ID.
I was using the Auth key ID from apple account instead of AuthKey_XXXYYYZZZ.p8
how can resolved this error ?
{
"multicast_id": 2100425764565529008,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "InvalidApnsCredential"
}
]
Go to your FCM console and check all your credential settings and make sure you have your app ID set and are using the correct code.
Sent from my iPhone, please pardon typos and autocorrect.
On Dec 5, 2019, at 5:41 AM, Amit Kumar Gupta notifications@github.com wrote:
how can resolved this error ?
{ "multicast_id": 2100425764565529008, "success": 0, "failure": 1, "canonical_ids": 0, "results": [ { "error": "InvalidApnsCredential" } ]
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Solution for me in case with APNs Authentication Key : AuthKey has ID, when downloading key file it like AuthKey_XXXYYYZZZ.p8 When uploading key to firebase console you have to use XXXYYYZZZ as key id Team Id from your profile
This made me realize my mistake. Thank you!
Solution for me in case with APNs Authentication Key : AuthKey has ID, when downloading key file it like AuthKey_XXXYYYZZZ.p8 When uploading key to firebase console you have to use XXXYYYZZZ as key id Team Id from your profile
this work fine for me.
InvalidApnsCredential
you must add ( create ) your Apple Development Key with Push Notification Permission https://developer.apple.com/account/ios/authkey/
and app id prefix https://developer.apple.com/account/ios/identifier/bundle
to Firebase iOS app: Firebase Console -> Project -> Settings -> Cloud Messaging -> iOS app configuration
Good luck
Dear ostrichegret,
I have the APNS key with push notification permission. When I added it to Firebase Cloud Messaging iOS app configuration, I also correctly entered the key id and team id. But I am still getting the InvalidApnsCredential error when I use curl command to send push notifications. I can use the same curl command to send Android push notifications successfully. Just not iOS.
I have also tried removing the key and re-adding the key. That didn't make any difference. What do you suggest I try next?
Thanks a bunch!
InvalidApnsCredential
you must add ( create ) your Apple Development Key with Push Notification Permission https://developer.apple.com/account/ios/authkey/
and app id prefix https://developer.apple.com/account/ios/identifier/bundle
to Firebase iOS app: Firebase Console -> Project -> Settings -> Cloud Messaging -> iOS app configuration
Good luck
Solved my problem
Tks
InvalidApnsCredential you must add ( create ) your Apple Development Key with Push Notification Permission https://developer.apple.com/account/ios/authkey/ and app id prefix https://developer.apple.com/account/ios/identifier/bundle to Firebase iOS app: Firebase Console -> Project -> Settings -> Cloud Messaging -> iOS app configuration Good luck
Solved my problem
Tks
Thanks Charlston! I don't know what happened to my cert. I had our cert guy re-create the same cert, added that to Firebase, and then everything started working again. Weird.
InvalidApnsCredential you must add ( create ) your Apple Development Key with Push Notification Permission https://developer.apple.com/account/ios/authkey/ and app id prefix https://developer.apple.com/account/ios/identifier/bundle to Firebase iOS app: Firebase Console -> Project -> Settings -> Cloud Messaging -> iOS app configuration Good luck
Solved my problem Tks
Thanks Charlston! I don't know what happened to my cert. I had our cert guy re-create the same cert, added that to Firebase, and then everything started working again. Weird.
I saw that my certificate had expired, so I created another one and it worked
I'm experiencing this error by sending a notification ios me from InvalidApnsCredential error The certificate was generated and it has not expired and was exported and loaded into p12 in the firebase console Sending the message from the firebase console by the same error This and the script I use to send the message the same script for android works perfectly.
You have the same problem know how can I solve it?