Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Push Notification on Android Phone with Qt
Forum Updated to NodeBB v4.3 + New Features

Push Notification on Android Phone with Qt

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 527 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • michaelLM Offline
    michaelLM Offline
    michaelL
    wrote on last edited by
    #1

    Hi,

    I tried this example https://doc.qt.io/qt-5/qtandroidextras-notification-example.html
    but I didn't receive any notification on the phone.
    I am running Qt5.12 and here is my main:

      QQmlApplicationEngine engine;
        NotificationClient *notificationClient = new NotificationClient(&engine);
        engine.rootContext()->setContextProperty(QLatin1String("notificationClient"),notificationClient);
        engine.load(QUrl(QStringLiteral("qrc:/assets/page.qml")));
        engine.addImportPath(QStringLiteral("qml"));
        return app.exec();
    

    And on qml I just do this:

    notificationClient.notification = "Notification!"
    

    Any idea why? Do I need permission?
    Is there also a way to play sound on the notification like an alarm?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Android are you using ?
      Something is not clear, are you experiencing that with the example or with your own application ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • michaelLM Offline
        michaelLM Offline
        michaelL
        wrote on last edited by
        #3

        @SGaist I am using Android with OS 9 on a Samsung S9 with Qt5.12 and it is on my own application.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What do you mean by own application ? I thought you were using the notification example ?

          Just one thing, your thread title mentions push notifications, this example doesn't implement them.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved