Android Question FirebaseNotifications not receives when app is not running

cenyu

Active Member
Licensed User
Longtime User
Hi friends, i try to implement FirebaseNotifications according Erels tutorial https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/
Everithing i do according this tutorial...Messages i send throw small B4A app.
My only problem is that: My app not receives messages when is killed (not in foreground or background).

My B4A is 8.0 also i update FarebaseNotification and FirebaseAdMob libs
Please geve me a clue...
 

DonManfred

Expert
Licensed User
Longtime User
Why it is killed? Killed using the Taskmanager?
Killed by swipe the recent list?

Did it work again after you start the app manually new?
 
Upvote 0

cenyu

Active Member
Licensed User
Longtime User
Hi DonManfred,
I close my app with command ExitApplication after that i not receive notifications...
When app is started again notifications work perfect
 
Upvote 0

cenyu

Active Member
Licensed User
Longtime User
When app is Killed using the Taskmanager or Killed by swipe the recent list do i receive notifications?

Accordin this post
https://stackoverflow.com/questions...on-works-when-app-is-swiped-from-task-manager
i must receive notifications even my app is killed...but i do not receive notifications

i thinking i have to add this lines to manifest

B4X:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
 <uses-permission android:name="android.permission.WAKE_LOCK" />

How to add these permissions?
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
It is posssible that android decide to put your app into stale-Mode or so.
If so then you need to manually start your app again to get it work again.

You can try to add
B4X:
SetActivityAttribute(Main, "android:excludeFromRecents", "true")
to your manifest
 
Upvote 0

cenyu

Active Member
Licensed User
Longtime User
I add this line to manifest...but problem is still there
Can you help me to add
B4X:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
 <uses-permission android:name="android.permission.WAKE_LOCK" />

to manifest
 
Last edited:
Upvote 0
Top