Hello everyone, I have over 25k users I want to send push notifications to using FCM. I have implemented the example made by Erel and have been using it for some time now but I was very curious about something so I add my analytics tracking code to the event of when a new notification arrives. I noticed that even though in the past 30 days I have more than 6k active users, only about 490 received my push notifications. I thought this is weird as the example in the forum said that it would work both in foreground and background mode which I tested it but today I decided to sit down and test it with multiple phones, I tested it with android 7, 8 and I noticed that I only receive it when
1) The app is open currently
2) Or when I minimized or pressed the back button and the app is still in my recently open android app list.
I don't know if this is normal or not but my aim with push notifications was even if you just turned on your phone or haven't opened my app in a long time I can use it to make you remember about my app so I did something; I made a service that uses StartServiceAt() and auto-starts every 1 hour with the Firebase code :
CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")
and then I retested my app in release mode again and I quit it and even cleared the recently used app list and I pushed a notification with
@Erel Fcm sending tool and the notification works perfectly well even without my app been opened at all.
So I am confused is something wrong with my first code or its normal and for what I want, it's better I use the second code to achieve it.
Thanks!
EDIT:
The first code I meant is
EREL example .. here
and the second code is just the example but I added a new service that uses StartServiceAt to call the sub below every 1 hour
CallSubDelayed(FirebaseMessaging, "SubscribeToTopics")