Firebase Delete push subscriptions - firebase

I am using FCM Firebase and Api for Server Reference.
I've used the Delete request to https://iid.googleapis.com/v1/web/iid/REGISTRATION_TOKEN to remove a device from all threads.
But now this device can not subscribe for any other topic.
How do I fix this problem?

Yes, same with me. My token was deleted too. But I solved it!!! Yeah!
I`d just removed the application and re-downloaded it!
Few seconds later, I could see that Firebase returns a new instance token!!
(after several tcp connections... in the Xcode debug window for simulation)
I think FCM can automatically assign the token!

Related

Push Notification not work correctly in custom app [Rocket.chat]

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

Firebase Cross Platform Push Notification Plugin Duplicating MainActivity

I'm using the following plugin for implementing and handling FCM push notifications in my xamarin application and there's one little unaddressed problem I'm facing.
I was hoping someone else has already figured it out and could help me.
THE PROBLEM:
It seems to be duplicating my MainActivity although I have the LaunchMode set to SingleTop.
There's an event called OnNotificationReceived that's provided by the library.
This event fires as expected, only once, when the application is in the foreground.
When I minimize the application (let it run in the background), send a notification to the device and tap on the notification, it opens the application, as expected, but if I send another notification after that, while the application is in the foreground, The OnNotificationReceived Event is fired twice.
I've tried changing the NotificationActivityFlags property to SingleTop.
I've tried changing my MainActivity's Launch Mode to SingleTop
I tried running the sample application they've provided to check if its something that I'm doing wrong, and still the same thing happens.
Logging the issue in their Github repository
None of the above have worked.
The issue can be reproduced by:
downloading the sample from the repository, link provided above
replacing their google-services.json file with your own from the Firebase
console.
change the package name of the sample of the application to the one you
have registered on Firebase
following the steps above that I've mentioned
ADDITIONAL INFO
Version Number of Plugin: 1.3.0
Device Tested On: Huawei P8 Lite Android Version 6.0
Version of VS: Visual Studio 2019
Version of Xamarin: 3.4.0.1009999
Update:
Unfortunately, the method below has not proven successful after attempting to implement it, I should have thought of the fact that I'm still going to need the notification object for iOS, earlier.
Myself and the team are going to implement a way to keep track of the users platform on the server and send them a notification either with or without the notification based on their platform, since iOS handles FCM notifications differently from Android. For now we're going to use Google's Instance ID service to determine what platform existing users are on.
Workaround:
I hope this helps someone in the future, if not I hope someone can provide me with a better solution.
In order to have my cake and eat it, basically be able to keep the notification object in the payload instead of removing it and having to further customise the payload to display notifications just for iOS, I changed the MainActivity's (the activity thats launched when a user taps on the notification) Launch mode to SingleInstance. That way I can keep my notification object in the payload and not have to worry about the OnNotificationReceived event being triggered twice.

How can I send push notification with fcm through jabber server

I have developed a chat application for android using ejabberd as XMPP server. I want to send FCM push notification, when user is offline.
Can anyone help me or give an example for this ?
You can add apllication to connect to FCM to your ejabberd, and send notification each time message goes to offline storage with this library
I got your mail, I am answering here so it can help others. You should look into this erlang library that I wrote.
https://github.com/softwarejoint/fcm-erlang
The read me section has all the details.
So, your app registers its push token on server. Then when there is a particular event on server, server uses that token to send fcm a message. fcm in-turn sends the message to you.
Best
Pankaj
I faced the same task and finally solved it by writing my own Ejabberd module. I've stumbled over many problems since a lot has changed in later / the latest version(s) of Ejabberd.
Here's my Stackoverflow question where I just added my now working code for the module.
Maybe that help.

Firebase FCM InternalServerError

I implemented Firebase FCM in my app about a month ago, and it has worked great ever since, until today. When I am trying to send a push notification from my console, nothing ever shows up. I find this very strange considering it worked before I went to bed yesterday. I do also have a PHP script that sends push notifications (FCM) as well, which also was working - but when I try to use this to send a push notification, I get this:
{"multicast_id":5593178441415796544,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InternalServerError"}]}
I find this very strange. I Googled this, and I read something about re-generating my APNS certificates (because they might be wrong or something), which I thought was weird as well, due to the fact that I created new certificates yesterday as well (which was working). Now I have once again tried to delete, and generate new - without any luck.
I also want to point out that when I go to my 'Cloud messaging' tab in Firebase, to configure my certificates, I am unable to delete - only re-upload.
What could this possibly be? I have checked my certificates and my API key is correct. It was working 100% 10 hours ago.
Could this be a Firebase problem, or how would I solve this? Help is much appreciated.
Most of the InternalServerError returned by FCM before February 2017,
were due to issues with the APNs certificates.
The API has now been updated.
Now if there an issue with the APNs certificate,
FCM will return error:InvalidApnsCredential

APNS-php fails to send to more than 1 recipient when using production certificate

We utilize php-apns to send push notifications to our iPhone app users. This worked great when we were developing, however once the app was in the app store and I switched to the production certificate, I'm only able to send to a single recipient. Any more than that and no one gets a push notification.
I've read elsewhere that others have experienced this problem. The only "solution" I'm aware of is to open & close a fresh connection to APNS for every push notification, but I'm not doing that. That's not a good solution.
Anyone have any thoughts?
I found the answer!
It appears to be an issue with sending to the development device tokens. Like most people, we have a database that stores the device tokens, and the earlier records were populated with our device tokens from testing.
As soon as I net out those device tokens from my list, all works!
I really hope someone finds this useful!

Resources