Push Notification - Background app



  • Hello. There is two question:
    Q1 Notification:
    I do not want send notification from google, Is it only the way?
    I want to show notification to user when app is in back ground
    Is there any resource help me around this problem?

    Is there any help to show notification on android?

    Q2: Is there any way to run app on background ? App stay running


  • Lifetime Qt Champion

    Hi,

    1. Are you looking for something like described here ?

    2. Do you mean like a service ?



  • You can also have a look at V-Play Engine for qt-based mobile apps and games, which offers ready-to-use plugins for notification services like Google Cloud Messaging, One Signal or Local Push Notifications.

    The plugins work cross-platform on iOS and Android and are usable directly from QML:

    import VPlayApps 1.0
    import VPlayPlugins 1.0
    
    App {
      // ...
    
     GoogleCloudMessaging {
       //  ...
       onNotificationReceived: {
         console.debug("Received notification payload is", JSON.stringify(data))
       }
     }
    }
    

    Best,
    GTDev



  • I have a similar question. I want to show toast notifications on Android. It is very easy to implement using this guide. Unfortunately it only works if I call the QAndroidJniObject::callStaticObjectMethod from the main application.

    If I call the notifications from service part, the service crashes. Why is this happening? How can I make it work even from service?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.