I got the registration token from fcm but when I send Push Notification from FCM targeted single device entered the registration token and send it. I got no message on android simulator and fcm status failed.
Copy your google-service.json file to root folder (that contains www, config.xml etc).
Step 1:
Login to your firebase console.
Step 2:
On Project Overview Settings, Copy the Cloud Messaging ServerKey
My key ex:
`AAAAjXzVMKY:APA91bED4d53RX.....bla bla
Step 3:
Replace the key
define( "API_ACCESS_KEY", "My key");
Finally Test the app :D
Related
Currently I'm using Pushy to send Push Notification for iOS devices. Everything is working fine, except I'm getting exceptions for some devices with response (DeviceTokenNotForTopic)
Do we have any way to decode Device Token to get Topic associated?
The device token example as 195d2ab5bce448b692dbb6de91452e0fbac0e6c09a599525bce52accc8a6b34a
Thanks,
DeviceTokenNotForTopic can occur for the following reasons:
The iOS Bundle ID was changed since device was registered for notifications
The iOS Bundle ID configured in the Pushy Dashboard doesn't match the actual Bundle ID of the app installed on the device
The iOS device uninstalled your app, rendering the device token invalid.
The APNs Auth Key you uploaded to the Pushy Dashboard belongs to a different Apple Developer Account than the one your app is distributed under.
Please check the following:
Do the Pushy device tokens you're trying to send still have your app installed on those devices?
Does the iOS Bundle ID in Pushy Dashboard precisely equal the Bundle ID string in Xcode? Copy-paste to make sure there are no typos
Please uninstall your app completely on a test device. Install it and call pushy.register(). What device token is returned? Try sending a notification immediately to that device.
Please ensure you uploaded an APNs Auth Key to the Pushy Dashboard from the right Apple Developer Account that owns the app.
I am not able to send push message to iOS device from FCM console. I receive error message "Check APNs certificates in settings". My configuration is the same as in FCM guide:
I generated Auth Key in Apple Developer Account.
I uploaded auth key in Firebase project, put Key Id and prefix (Team Id).
I added FCM SDK to my iOS project (added Google-service.plist as well).
I saved registration token in Firebase Database.
Finally, I can send a message to all devices with my App ID (but cannot receive this message, I do not know why), but I cannot send a message to selected device with token.
Any ideas?
If the bundle ID that was used to generate the FCM token does not match the bundle ID in your Firebase App you will receive the error code: 'messaging/invalid-apns-credentials' even if your Auth key is configured correctly.
This seems like the most likely cause of this error ever occurring. Double and triple check that the FCM token was created by an app with the exact same bundle ID as what is listed in your Firebase console.
The GoogleServices-Info.plist does not verify that it contains the same Bundle ID as the app it is attached to so it is easy to make this mistake.
On the Android side you will get a compilation error if the appId is not present in your google-services.json thus preventing this issue.
Please check the app name in GoogleServices-Info.plist and Bundle ID in your app.
And also check you put the plist file in proper directory.
Uploaded auth key in Firebase project to both Dev and Prod ones.
This are the only reason for not having the push notfications to your app.
No I started use push notification in my project (it worked sometime ago), but can't make it work. I downloade sample-messages project and changed my account and application settings. But messaged don't delivered to receiver. Registration of device is ok. I see my subscribtion. No errors from response when sending notification. What I only got is the json description from logs, when i click my message from queue (but it's in status "sent") Can't get it work. Please, help.
{"notification":{"registration_ids":["APA91bEsqEY2OcaQpgU6Nmk6P7P0fSEdnGuXHSOnUwMJ3ZCAuZC0hGiE_7DX-TlvuAnivJ3Bt4nSM7eEN3AR2Qg2jjCGC8RRT7GbDJgpuy25plCohb23CpD5hLaHo7l-TZvgZhpXjCM0"],"delay_while_idle":false,"data":{"message":"fgjkkkkllkleddxccvvvcxfffffjhghvfg I was ","collapse_key":"event5711312"},"time_to_live":86400},"log":[{"device_token":null,"created_at":"2016-02-23T18:21:42Z","delivered_at":null,"failed_at":"2016-02-23T18:21:47Z","error_code":401,"error_description":"Unable to deliver notification 11778569, received error 401 (Unauthorized, check your App auth_key.)"}]}
I redid all the configuration steps in the link:http://quickblox.com/developers/SimpleSample-messages_users-android#Setup_GCM
Now it is back to work!
Attention to some details:
The API key you have to use in Google cloud console is of the SERVER type
Use the same package name on Android manifest and Google cloud console
Use your application ID from developer console to get GCM token on your Android application
don't forget to copy the google-services.json (generated when you enabled Google services for your app) to app/ directory on your project (the same directory of your src/)
When submitting my app to the app store, I get this warning:
Missing Push Notification Entitlement - Your app appears to include API used to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
I am aware that the push notification entitlement can be set in the mobile-config.js file, but i can't find out what I need to add to that file so that config.xml gets built with the push notification entitlement.
What do I add to my mobile-config.js file?
once i submitted app to app store by enabling push notifications for that particular app id and i generated the certificate fro production and i saved in my server.
now i want to test my push notifications are working or not,now my doubt is if i use the same bundle id for my another project and keeping the same certificate which i generated for production apns on my server. if i send notifications now to that certificate will notifications work or won't work. i was confused totally after having lot of discussion with my friend.
in my point of view they won't work,but i am unable to clarify him clearly,let me know what is process once we send a notification to apple server by using particular certificate. whether it looks fro bundle identifiers or any thing
thankyou......
The process of push notification is that your server send message with the attachment of device token you added in the server end.
On apple server apple fetch the device token and send the message to the device token you send.
Now when the message received in iPhone, iphone check the bundle identifier that was registered with the certificate you have created at server level while enabling push notification.
And if that identifier matches with any of the app you have in your iPhone whether it`s the same app you have registered your push or other. It will only check the bundle identifier and show the notification on your device.
Now both the production and developer certificates are different so it will not show the notification if you are sending push from certificates generated with developer mode and checking on production application.
Regards
Abhishek Goyal