Push-Notification Sample

Thread is closed for posting
4 posts, 1 answers
  1. Max
    Max avatar
    3 posts
    Member since:
    Nov 2013

    Posted 16 Oct 2017 Link to this post


    I've tried to build the "Basic push" sample app (http://docs.telerik.com/platform/samples/backend-services-push-hybrid/) and I am able to receive notifications in the foreground or when app is minimized(hit the home key). If I close the application, I don't receive the notification.

    Is this possible to fix it?
    Is there any additional configuration required for the AndroidManifest or config.xml?

  2. Max
    Max avatar
    3 posts
    Member since:
    Nov 2013

    Posted 17 Oct 2017 in reply to Max Link to this post

    And one more question: Are notifications sent from firebase (https://console.firebase.google.com/)? It is not work for me now.
  3. Answer
    Martin avatar
    104 posts

    Posted 18 Oct 2017 Link to this post

    Hi Max,

    From your description you are successfully able to receive the push notification when the app is in the foreground - that means that the device is registered correctly in Telerik Platform Backend services and that the push notification setup is also correct.

    When the app is in the foreground, the received push notification are handled by the app code, more specifically by these functions here in Basic Push sample app.

    When the app is in the background, the received push notifications are handled on operating system (OS) level. On some Android devices though, the apps are not permitted by default to stay awaken in the background due to a rather aggressive phone's battery optimization feature. This way the push notifications not processed when the app is not running and is forbidden to be awaken in the background. This additional functionality is added to the OS by the phone manufacturers and should be allowed on the device by the user.

    Currently, this behavior is identified on devices from the following manufacturers:

    • Huawei
    • Xiaomi
    • Asus

    You need to modify certain settings on your device.

    Huawei devices

    1. Open Settings → Protected Apps
    2. Place your application in the list

    Xiaomi devices

    1. On the app screen tap on the Security app
    2. Select Permissions → Autostart
    3. Locate your app in the list and enable "Autostart"
    4. Restart the device

    Asus devices

    1. Locate the Auto-start Manager as noted here
    2. Locate your app in the list and enable "Allow"

    Let me know if this was the case or if the problem persists.

    As to your other question - Telerik Platform backend services is sending the push notifications to FCM (Firebase Cloud Messaging) but you would have to use Telerik Platform backend services Web portal or REST API endpoints to send push notifications.

    I hope this has helped.

    Progress Telerik

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

  4. Max
    Max avatar
    3 posts
    Member since:
    Nov 2013

    Posted 18 Oct 2017 in reply to Martin Link to this post

    Thanks for the help. The problem was in the device (Asus Zenpad)
Back to Top