GCM push notifications for android devices are not working on MI and Letv mobiles
Asked Answered
I

1

11

We are facing the problem in sending GCM push notifications to all the android devices. We are developing an app on Ionic platform and using the plugin called cordova push for the push notifications. The device is registering with gcm and receiving device token. I am using 3 devices to test Moto g4 plus, MI4 and Letv.

The problem is push notification is reaching to moto g4 plus device but not to MI and Letv devices when the app is killed. MI and Letv devices are also receiving the notification only when the app is in the foreground or background.

I am receiving delivery receipts from gcm as delivered to all the devices in the app killed case too.

Please suggest some solution to overcome this problem. Thank you.

Impercipient answered 26/11, 2016 at 1:36 Comment(0)
A
5

I also faced this issue I have Xiaomi mobile that needs 'Autostart Permission' to receive FCM Notification when app is killed,you need to move your app in this list.

For Xiaomi device you can ask user for this permission Check the answer here

    String xiaomi = "Xiaomi";
    final String CALC_PACKAGE_NAME = "com.miui.securitycenter";
    final String CALC_PACKAGE_ACITIVITY = "com.miui.permcenter.autostart.AutoStartManagementActivity";
    if (deviceManufacturer.equalsIgnoreCase(xiaomi)) {
        DisplayUtils.showDialog(activity, "Ask for permission", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                try {
                    Intent intent = new Intent();
                    intent.setComponent(new ComponentName(CALC_PACKAGE_NAME, CALC_PACKAGE_ACITIVITY));
                    activity.startActivity(intent);
                } catch (ActivityNotFoundException e) {
                    Logger.e(TAG, "Failed to launch AutoStart Screen ", e);
                } catch (Exception e) {
                    Logger.e(TAG, "Failed to launch AutoStart Screen ", e);
                }
            }
        }, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {

            }
        });
    }

And as for Letv mobile i haven't checked it.If you have solved it then do tell me.

Atalie answered 2/12, 2016 at 12:23 Comment(2)
We wrote to someone very senior at Xiaomi. He reverted that they manually whitelist a few apps, and the rest are by default disallowed from accessing the notifications folder. This was the response. "This usually happens because of whitelisting of apps that can access notifications folder. This is a feature to ensure the user is protected from spam and also helps to ensure RAM/battery usage optimization." We asked what the process was to get an app whitelisted, and did not get a response.Impercipient
@shyam can u give me the customer support mail so i can get the confirmation for them and will be able to convince my client.Mcginn

© 2022 - 2024 — McMap. All rights reserved.