Foreground service when user disables notifications - android

I have the next doubt:
I am working on an app that needs to start a foreground service. I know that since Android O, you need to attach a notification to that foreground service. So far so good.
The question is: what happens if the user disables that notification from settings? I have been testing the app and everything seems to work, but I wanted to double check on internet and I couldn't find anything.
Should I force the user to have notifications enabled if he/she wants that feature (which needs the foreground service)?
Does anyone have some insights on it?

Yes, it is best practice to ask the user to enable notification services.
Nowadays most app does this exercise to show a notification to users. Even in some special manufacturer like MIUI it is compulsory to start notification service from setting. So many app shows prompt for same and on positive click they navigate the user to setting screen too

Related

Turned off "Allow background activity" setting stops location updates in foreground service

I have a foreground service requesting location updates and doing stuff with them.
When the app is not on screen, it still works because the service has an ongoing notification.
But there is a battery setting, at least on my samsung device, called "Allow background activity".
I wasn't paying attention to it because it says 'background', and as far as I know, as long as I have a foreground service with ongoing notification, my app is regarded by android as in foreground, and never in background.
But I've noticed that, if that setting is turned off, my ongoing notification is still there, but the gps icon disappears and location updates stop coming.
Is this normal behavior or I'm doing something wrong? Shouldn't my app be regarded as in foreground instead?
In case it is normal behavior, I'm aware now that I can detect this status with isBackgroundRestricted(), and I can use that to notify the user that they need to change it.
The other question is, is there a way to programmatically open the exact settings page where the user should make this change?
Thank you!
I had a similar question here. Short answer is I don't think there is an intent to go to the exact screen, but you can get the user there using android.provider.Settings.ACTION_APPLICATION_SETTINGS.

Receive Notifications even when my App's notification is turned off by user from Settings

I have a requirement of implementing a silent kind of notification where in if user turn off notification explicitly from settings menu but still receive a notification.
Checking notification is turned off/on is possible and can navigate to settings page where we can ask to user to toggle the button to make it off/on.
But my requirement is either dynamically on notification which is turned off. I searched a lot but did not find a solution.
In this link user who asked a question says that we can receive in android but not in iOS. As per my knowledge we can't because what is the use of giving option(from settings menu turn off) to user.
Will anyone let me know whether it is possible!!!
Thanks in advance.

Send notification to user when app full close

It is necessary that even after the application is completely turned off by the user, notifications come from the node server. Tried to do through Broadcastreceiver and Service, but they only output if the app is in the background. I'm considering The firebase messages option, but I can't fully understand if it will work when the application is completely turned off. If there are options as it is possible to make it on another, prompt, please, in what direction to go.
When the user did not force stop(Settings -> app -> Force stop) the app, FCM will work.
It means, Firebase Cloud Messaging will work after user close the app
normally

Force IOS/android user to check the notification

I am developing a IOS/android app which will used by our vendors, the app will send notifications to the vendors timely, i wonder if there is a way that the vendor MUST click "accept" or "read" for every notification, even he/she disable the notification permission for this app.
so, all of my perpose is the vendor must ready the notification and the server side should be able to know who is not read. the vendors should not has an execuse that he/she do not get a notice while the policy changed.
There is no way to 'force' a user to open a notification, but if you use a Push Notification service (AppBoy, etc) most of them have metrics and can track who has opened the notifications. So if your vendor comes back and says they never got it, you can say yes you did, and which device they opened it on. You could then continually send notifications to those who haven't opened it until they do.
This won't work if they have notifications disabled, though. No way to get past that without building a messaging system into your app.

How do you ship/enable a separate service in android?

Is it possible to launch a service whenever a phone is booted up?
My question is that, say, I want to have a background service running in the background when the phone is booted up, once it receives a notification, say, a stock price is now above a certain price, then the user will get notified and in the notification center it will launch the actual app if a user chooses to click on it.
My question is, where do I put the tag? In my application manifest? but again, I only want the service to run automatically without user launching my app.
I see here two possibilities for you:
Is the same approach that was proposed by #triad. You can have a broadcast receiver that will start your service.
You can use push notifications. As I understand from the question it is possible in your case. I guess using push notifications will be cheaper (in the context of power) in your case.

Categories

Resources