we setup everything as described in the Medium Link for setting up APNS with Cordova FirebaseX. Medium Link
Also we used the FirebaseX Demo application. Demo Application where a click on "Get APNS token" leaves us with "null" as a result. A "Get FCM ID" returns a valid device token. We don't receive APNS background messages, because of the missing APNS token.
It doesn't matter if we use a real device or simulator, the APNS field stays null.
We tried manual setting a provisioning profile and importing p12 certificates development/production to Firebase. Our next try was to go with the newer version, with a p8 certificate and automatic signing of the app, also there we had no luck.
Do you have any ideas what could be wrong in our setup, we tried literally anything to get this to work. We followed all instructions exactly, even multiple times.
We use the same versions as the demo application 1:1, changed from their bundle id to ours, and replaced both Firebase configuration files from our Firebase console setup.
Thanks,
Stefan
We finally fixed it.
There was no problem with APNS configuration.
If you test your code with an iPhone, which has never had a sim card inserted, then you don't get an APNS token.
After putting in a sim card we got an APNS token, even if we remove it later. Thank you Apple. 👎
Related
I followed the instructions in the Rocket.chat documentation:
Removed the check mark from the gateway
added GCM keys from firebase
rebooted the server
Pushs seem to come, but the listener "pushnotificationreceived" is triggered only if I open the application immediately after the push should come or I am in the application during the push, if I have minimized the application and send myself a message, then there is no push.
If I throw the push myself through the firebase API, then the push works out as needed.
There is a suspicion that this is due to the fact that Rocket.chat sends push data in the data key, not notification (https://github.com/RocketChat/Rocket.Chat/blob/develop/app/push/server/gcm.js).
I also have an error in the Rocket logs.Chat:
"For devices running Android 8.0 or later, you need to specify the android_channel_id identifier. See https://github.com/raix/push/issues/341 for more information", but even with this error, push writes that it was sent successfully.
Please, checkout this post:
https://forums.rocket.chat/t/apple-push-notification-service-update-from-legacy-binary-protocol/12425/4
Also, consider asking dev questions at:
https://open.rocket.chat/channel/dev
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.
Firebase Authentication with phone number is configured and tested on iOS via Testflight but seems that is not working when Apple is reviewing the app.
We provided a whitelisted phone number which worked with the build downloaded from Testflight.
I've found a couple of similar issues in GitHub but all was fixed... I'm using the latest version of Firebase auth plugin.
I added a GitHub issue as well but no reaction there: https://github.com/FirebaseExtended/flutterfire/issues/3800
Did somebody had to deal with this ?
Finally the app passed Apple review. Below is what we did, in case somebody will encounter this in the future:
We had two APN's created in Apple Developer account. The second one was configured in Firebase Console
===> we removed the first so now we have only one APN in Apple Dev account
In Firebase Console we had also certificates uploaded (Firebase states that
those are not used if a .p8 key is uploaded)
===> we removed the unused APN certificate and used only the APN .p8 key.
Resubmitted the app to review and it passed.
I have an IOS Xamarin project that uses firebase for push notifications. The push notifications are working on a debug build. I uploaded the project to Test Flight and push notification are not receiving anymore.
I have a development certificate and a production certificate. I am using an App Store provisioning profile. I have tried revoking and making new certs. I have added FirebaseAppDelegateProxyEnabled - Yes to the info plist. I am receiving firebase tokens in test flight.
Thanks
You must add as well the APNS/Certificate for Production on Firebase, it happens all the time. Check you have both of them.
Better still if you use the P8 Key. In this case you don't need any other certificates whatsoever. For Firebase is the best approach, comment if you need more help.
Cheers.
I have an issue with receiving notifications on Twilio Chat with Production APN Certifications, i get the error:
Error - 52131
Invalid APNs credentials
Possible Causes
Credential (certificate and private key) is invalid.
Certificate expired.
Possible Solutions
Make sure you have valid certificate and private key provided in your Credential.
When I test my sandbox APN certifcates the push notifications work perfectly.
However when I create APN PUSH SERVICES Certification and upload these and link them to my programmable chat function I get the error message: 52131 - Invalid APNs credentials... https://www.twilio.com/console/runtime/debugger/NOf2857a6c1db54e27984dd8fa9ff5100f
Just to clarify, the push notifications work perfectly on my development project. I use a Sandbox APN certificate, and selected the Sandbox tick box
However in the production version, where I am using:
Specific APN Apple Push Services Certificate, for a unique APP ID I
get the 52131 error.
I did not tick use for sending to Sandbox credential. As it is a
push credentiual
I followed all the instructions perfectly for exporting the
certificate keys.
I also use separate API Keys and a separate Programmable chat.
I get registration of bindings but no notifications as the
certificate is invalid, which I cannot see why as I checked by regenerating a certificate many times
I read in some responses to similar issues having the Sandbox and PUSH SERVICES APN certificate in the same App ID? Or not using the same CertificateSigningRequest to generate the Sandbox and PUSH? Why would this make a difference?
This was the thread: https://github.com/twilio/voice-quickstart-objc/issues/101
Finally after several weeks of emailing Twilio support I found the answer.
Basically the issue was probably because I extracted the Keys from my distribution certificate somehow and not the Push one. So make sure you are extracting the correct keys from the correct certification. Also because I was deleting and removing the push credentials from Twilio so often the bindings to my users were pointing to old Push Credentials that did not exist, so I removed the bindings allowing new bindings to be regenerated connecting to the new Push Certificate SID.
Other things that are important for production notifications on twilio programmable chat:
Make sure your environment entitlements file is set to "production"
Don't check the sandbox option on your production certificate (of
course)
Sometimes there can be issues when creating a Push Certificate using
a certsigningrequest that was used on a sandbox certificate. Try
creating a new Cert Signing file just for production
When you test your Production notifications these will only work on an appstore build built with your distribution certificate. You cannot receive notifications on the simulator (obviously). You cannot receive notifications from an app built using development certifcate...so you need to build and upload your app to testflight to test the notifications then preferably test between two real devices...or just send notifications from the simulator to a device with an appstore/adhoc build on it
I cannot thing of anything else for now that I came across. Twilio support is very good and will try and answer your question if you need help.