Android Question Problem with firebase notification (again).

Discussion in 'Android Questions' started by Eme Fibonacci, May 26, 2019.

  1. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    I have an android 8.1.

    I read a lot topics with same question. Nothing worked for me.
    I have a basic implementation of FCM and everything works fine.

    If I hit the home key the application goes to the background and everything still works fine.

    If I press the right button (I forgot the name) and then click on "clear all" the notification no longer works.

    If the app is left unused for a long time (Probably the android is killing it) the notification don't work anymore.

    What better way to solve it?

    Sorry for this repetitive question.

    Thank you for you time.
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you testing it in release mode? Are you sending the message with the B4J tool?
  3. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    Yes release mode.
    With firebase console and B4J tool.

    I've tried countless things.
    I found this in some tutorial. This seems to work.
    Service.StartForeground(nid, CreateNotification("..."))
    Maybe this code is incorrect but it seems to work.
  4. Erel

    Erel Administrator Staff Member Licensed User

    Don't. It will not work when your app is not running.

    Wrong solution. The app doesn't need to run for the notification to arrive.

    Firebase notifications work properly on almost all devices when implemented correctly. On some devices the OS limits background notifications based on all kinds of parameters. However if your app doesn't work on several devices then you did something wrong.
    Eme Fibonacci likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice