[Vuejs]-Android App crashing on Android 12+ Devices on background in push notifications, Application compiled from Cordova

1👍

This Might help you,

Add this in FirebaseService class

                try {
                    //ToDo Update the code for S+
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
                        pendingIntent = PendingIntent.getActivity
                                (this, 101, intent,
                                        PendingIntent.FLAG_IMMUTABLE| PendingIntent.FLAG_UPDATE_CURRENT);
                    }
                    else
                    {
                        pendingIntent = PendingIntent.getActivity
                                (this, 101, intent, PendingIntent.FLAG_ONE_SHOT| PendingIntent.FLAG_UPDATE_CURRENT);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }

Leave a comment