This is a migrated thread and some comments may be shown as answers.

Push-Notification Sample

3 Answers 104 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 16 Oct 2017, 02:08 PM
Hi

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?

3 Answers, 1 is accepted

Sort by
0
Max
Top achievements
Rank 1
answered on 17 Oct 2017, 08:28 AM
And one more question: Are notifications sent from firebase (https://console.firebase.google.com/)? It is not work for me now.
0
Accepted
Martin
Telerik team
answered on 18 Oct 2017, 11:26 AM

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.

Regards,
Martin
Progress Telerik
 

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

 
0
Max
Top achievements
Rank 1
answered on 18 Oct 2017, 11:48 AM
Thanks for the help. The problem was in the device (Asus Zenpad)
Tags
General Discussion
Asked by
Max
Top achievements
Rank 1
Answers by
Max
Top achievements
Rank 1
Martin
Telerik team
Share this question
or