Firebase FCM Push notification with Ionic3 Cordova - android

I try to send a push notification from Firebase FCM to my ionic application, but my application never receives the notification and, after 3 days of search, I can't find any solution! I am going crazy!
I've tried to create a new blank application (ionic start myApp blank),
I've enabled android (ionic cordova platform add android)
I've created my app in Firebase, downloaded google-services.json, and pasted it in my app root folder and in my app platform/android/app folder
I've installed phonegap-plugin-push (ionic cordova plugin add phonegap-plugin-push and npm install --save #ionic-native/push)
I've pasted this code https://ionicframework.com/docs/native/push/ in my app.component.ts
I've added my senderId in android conf (app.component.ts)
I've imported the push module in app.module.ts
Everything compiles right, but when I send notification in Firebase (with or without channel id), I don't receive anything
The most incredible thing is that: If I copy my registrationId in the console and try to a send test notification (button "test on a device" in FCM on the first step when I create a new message), this test notification is correctly received.
Also Incredible: Notifications has correctly worked 2 hours when I try my first notifications and suddenly stop working without any modification anywhere.
I've tried to restart many new apps from zero and impossible to receive any push notification.
Any idea? Does someone already have the same problem?
PS: Here's my console output:
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
Ionic Native: deviceready event fired after 430 ms
We have permission to send push notifications
Channel created
Channel deleted
List of channels Array(0) length: 0
Device registered
Object
registrationId:
"fbaXyRApJ2k:APA91bHdA5LkxeOfrpNRud0_jetEpb1j93Qn9Bm5TXDp6DpU1TpuWdYHWjKrSdLBaRLizezBJ0Ls1dOr_nYRvOlS4KXSJ6nspaDPKb4nGFUXKFDYclPf24rcYJfGITcImvxcHOpJGHhe"
registrationType: "FCM"
__proto__: Object

Related

Expo Push Notifications throwing internal stack error on Android Standalone build when calling getExpoPushToken()

Expo SDK 43.0
Expo-Notifications 0.13.3
Android Standalone build using Dev Client and EAS
Wondering if someone can give me a hand to understand what is going on with my Android build and getting a push token. I have followed the guides for both iOS and Android. Inclusive of adding in the FCM server key to expo. I can see it when I use the eas credential command and also if I just log into Expo.dev and look. However when I try to get an expo push token on an Android physical device, I receive this huge exception object that, unless I am missing something crucial, does not have any available information in it. I have attached a screenshot as has the object in it.
Screenshot of the error that I am receiving
As you can imagine, this works fine in iOS builds and fine in the Expo Go client. I also manually sent a notification/Campaign from firebase and every Android device with the application installed received it.

ionic 5 cordova fcm with firebase

I am trying to implement FCM using firebase which uses Push notification for my application. I had tried many times still not able to read the token from FCM. Where am I going wrong?
Code and snips.
Error response:
if i use ionic serve locally the following error and warning shows up
if i use ionic cordova run browser i get this before logging into my application
after logging
I took a build of the same app and tried remote debugging on it which had the following error
Before logging in
after logging in
In every instance the error message indicates to install Cordova-fm plugin which i have done.
my package.json
I have tried removing android plugin and install it like a new project didnt work, same error.
I have tried to run just firebase and fcm in a blank Ionic project, still the same error.
I have tried to downgrade the version to see if its works, the error didnt change.
I have tried most of the suggestions from online. Nothing is letting me access the FCM token.
PS: This is my first project with ionic and firebase.

Direct Update in MFP8 not working even deploy latest web resources

Good day,
I am currently developing an android mobile app in my local, with mfp8 server.
I can launch the app in my android phone, and successful fire a call to the mfp server.
I try to edit something on an HTML file in the angular project (mobile app front end). I run some command to deploy the web resource to mfp server:
npm run android
mfpdev app register
mfpdev app webupdate
From the mfp console, I can see that the application and web resources last updated date is matched with the time I run those command.
I am expected after I stop and run the app in my mobile, the app will be able to detect something changes and prompt for update. However, it didn't happen, and my app still nothing changes.
Anyone know what mistake on this? Changes in HTML file should be a correct way to test the direct update right?
Edit **
I just found that in MFP log, there is a line as follow:
[AUDIT ] CWWKS1100A: Authentication did not succeed for user ID ibs_mobile. An invalid user ID or password was specified.
However, I am still able to log in to my app. I am not sure of is this related to my direct update or not.
Use cordova command to prepare the app instead of npm run
Try the following steps
a. cordova prepare android
b. mfpdev app webupdate

Get iOS ID not FCM Id in Ionic 2 with Phonegap Push Plugin

I'm developing app in Ionic 2. I installed phonegap push plugin https://github.com/phonegap/phonegap-plugin-push to get notifications and get device ID.
When I'm in Android App the device ID of return is a GCM ID, but when I'm in iOS he return FCM Id, and I don't need that, I want get Push Plugin register:
This is example of my issue:
FCM Registration Token: cqs2H3ED5u8:APA91bEVQGi0SfbC1Yau1xN_PJB0SOmB50PgHMNG2zCqw4bzWfLruXfqKoIT7DeJnz5K37CqQLIs9F-CXfwurC-UhZjfLNUvnEfCZDpIleW_6xGZYZKokNcIPouGHdvdSnVMhHu6mITh
Push Plugin register success: <5c27c9a8 87e28030 735f8bc7 e27ab8de e6d6538f c9759e70 26c306a6 fa0ac2cc>
How to configure push plugin init to make this change?
I open issue on Phonegap project. https://github.com/phonegap/phonegap-plugin-push/issues/1982
The answer was
“Yes, when you remove the GoogleService-Info.plist from iOS it uses APNS but as long as you keep delivering google-service.json it uses FCM. Actually, Android won't work without the google-service.json file”
If you want use APNS on iOS platform you have to remove GoogleService-info.plist (is optional on iOS and necessary on Android)

how to install phonegap "push plugin" in ionic project(android)?

I am new to ionic framework, I am working on push notification in my android ionic project using phone gap push plugin referring the following documentation phonegap push plugin link
But I am unable to find how it gets worked. I need to send notifications to all the devices who already install as a gesture of revisit of my app.
Can any one give clear description step by step to solve this ?
Install plugin from http://ngcordova.com/docs/plugins/pushNotifications/
create one project on google Api console (https://console.developers.google.com/
).
There is method of Registration where you will get $cordovaPush.register(androidConfig).then(function(result) {console.log(result);
you will get device token. Register that device token and save that token on created project from Google API.

Categories

Resources