Notification shown each time I open the app
See original GitHub issueHi everyone, I’m using code presented by Jen looper to recieve FCM messaging. in android each time I open the app, an empty dialog.alert jumps even though there is not FCM message sent by Firebase, any idea please ?
here is a snapshut of the code, thanks in advanced:
setTimeout(function () {
let firebase = require("nativescript-plugin-firebase");
firebase.init({
onPushTokenReceivedCallback: function (token) {
console.log("Firebase push token: " + token);
},
onMessageReceivedCallback: function (message) {
dialogs.alert({
title: "Push message: " + (message.title !== undefined ? message.title : ""),
message: JSON.stringify(message),
okButtonText: "W00t!"
});
},
//persist should be set to false as otherwise numbers aren't returned during livesync
persist: false,
//storageBucket: 'gs://yowwlr.appspot.com',
onAuthStateChanged: (data: any) => {
console.log(JSON.stringify(data));
if (data.loggedIn) {
BackendService.token = data.user.uid;
}
else {
BackendService.token = "";
}
}
}).then(
function (instance) {
console.log("firebase.init done");
},
function (error) {
console.log("firebase.init error: " + error);
}
);
}, 3000);
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Control notifications on Android - Google Support
Open your phone's Settings app. · Tap Notifications and then · Under "Most recent," find apps that recently sent you notifications. To find...
Read more >Use notifications on your iPhone or iPad - Apple Support
Tap a single notification to open the app that it's from. Tap a group of notifications to view all recent notifications from that...
Read more >Notification is showing every time I open my application
Notification is showing every time when I opens the application. I searched alot to this bug but I cant rectify this bug.. This...
Read more >Turn App Notifications On / Off - Android - Verizon
1. From a Home screen, do one of the following: Swipe screen then navigate: Settings > Apps & notifications > App info.Navigate: Settings...
Read more >Change notification and quick settings in Windows
Change your action center settings at any time from the Settings app. Select Start , then select Settings . Select System > Notifications...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@souly1 thanks for your awsome reply 😃, I 'll try your work around and get back to you with the result. Thanks again
Hi @rkhayyat , I’ve noticed in our app that the event ‘onMessageReceivedCallback’ is called each time app returns from background, so in your code should show alert each time. Simple workaround for us in the meantime was to look and the message data structure which is different than an actual push notification in our system, so if not in correct structure ignoring.
Hope this helps, Thanks