foreground service without notification

佐手、 提交于 2019-12-06 10:41:17

问题


I want to start a foreground service that doesn't show notification, apps like instagram, telegram, zapya, ... have a foreground service and they show no notifications. I have tested ways like answers here, but android shows a notification that yourAppName is running. I want to know how is that possible to have a foreground service with no notification or warning from OS?


回答1:


How to do it

Here's an up-to-date technique to make it work on all Android versions:

  • When the app is running on an Android version prior to 7.1, use this technique.
  • When the app is running on Android 7.1 or higher, use this technique.

I know this involves more work than you might like, but it does work, in my experience.



来源:https://stackoverflow.com/questions/42933657/foreground-service-without-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!