This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void openNotificationSettings() | |
| { | |
| Context context = Application.getAppContext(); | |
| Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); | |
| intent.putExtra("app_uid", context.getApplicationInfo().uid); | |
| intent.putExtra("android.provider.extra.APP_PACKAGE", context.getPackageName()); | |
| intent.putExtra("app_package", context.getPackageName()); | |
| if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR1) | |
| { | |
| intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void onMessageReceived(RemoteMessage remoteMessage) | |
| { | |
| if (null != remoteMessage) | |
| { | |
| if (remoteMessage.getNotification() != null) | |
| { | |
| // The Message contains a notification payload. | |
| // Note, that this can only happen, when app is in FOREGROUND | |
| // Messages that contain a notification payload DO NOT TRIGGER onMessageReceived in background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "aps" : | |
| { | |
| "alert" : | |
| { | |
| "title" : "Game Request", | |
| "body" : "Bob wants to play poker", | |
| "action-loc-key" : "PLAY" | |
| }, | |
| "content-available" : 1, |