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

前端 未结 1 898
独厮守ぢ
独厮守ぢ 2020-12-05 06:20

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 f

相关标签:
1条回答
  • 2020-12-05 06:41

    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.

    0 讨论(0)
提交回复
热议问题