Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onMessage(Context context, Intent intent) {
- Log.d(TAG, "onMessage - context: " + context);
- // Extract the payload from the message
- Bundle extras = intent.getExtras();
- if (extras != null)
- {
- // if we are in the foreground, just surface the payload, else post it to the statusbar
- if (PushPlugin.isInForeground()) {
- extras.putBoolean("foreground", true);
- PushPlugin.sendExtras(extras);
- }
- else {
- extras.putBoolean("foreground", false);
- // Send a notification if there is a message ORIGINAL HERE
- if (extras.getString("message") != null && extras.getString("message").length() != 0) { /// this is the line i edidted
- createNotification(context, extras);
- }
- }
- }
- }
- // Send a notification if there is a message ORIGINAL HERE
- if (extras.getString("message").length() != 0) {
- createNotification(context, extras);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement