@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.d("Msg", "Message received ["+remoteMessage+"]"); // Create Notification Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 1410, intent, PendingIntent.FLAG_ONE_SHOT); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_stat_name) .setContentTitle("Message") .setContentText(remoteMessage.getNotification().getBody()) .setAutoCancel(true) .setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(1410, notificationBuilder.build()); } }
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); }
@Override public void onDeletedMessages() { super.onDeletedMessages(); } }
@Override public void onNewToken(String token) { super.onNewToken(token); Log.d("DemoFirebaseService", "got new token: " + token); CountlyPush.onTokenRefresh(token); }
@Override public void onNewToken(String registrationId) { super.onNewToken(registrationId); Log.i(TAG, "Found Registration Id:" + registrationId); Applozic.getInstance(this).setDeviceRegistrationId(registrationId); if (MobiComUserPreference.getInstance(this).isRegistered()) { try { RegistrationResponse registrationResponse = new RegisterUserClientService(this).updatePushNotificationId(registrationId); } catch (Exception e) { e.printStackTrace(); } } } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); PLog.d(ParseFCM.TAG, "onMessageReceived"); String pushId = remoteMessage.getData().get("push_id"); String timestamp = remoteMessage.getData().get("time"); String dataString = remoteMessage.getData().get("data"); String channel = remoteMessage.getData().get("channel"); JSONObject data = null; if (dataString != null) { try { data = new JSONObject(dataString); } catch (JSONException e) { PLog.e(ParseFCM.TAG, "Ignoring push because of JSON exception while processing: " + dataString, e); return; } } PushRouter.getInstance().handlePush(pushId, timestamp, channel, data); } }
@Override public void onDeletedMessages() { super.onDeletedMessages(); }
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); final String requestId = remoteMessage.getData().get(ZD_REQUEST_ID_KEY); final String message = remoteMessage.getData().get(ZD_MESSAGE_KEY); if (StringUtils.hasLengthMany(requestId, message)) { handleZendeskSdkPush(requestId, message); } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.d("AnyAudioFirebase", "message rec"); // if payloads available if (remoteMessage.getData().size() > 0) { Log.d("AnyAudioFirebase", "message received"); AnyAudioPushHandler.getInstance(this) .setNotificationPayload(remoteMessage.getNotification()) .handlePush(remoteMessage.getData()); } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); EMLog.e(TAG, "EMFCMMSGService#onMessageReceived:" + remoteMessage.toString()); if (remoteMessage.getData().size() > 0) { String message = remoteMessage.getData().get("alert"); Log.i(TAG, "onMessageReceived: " + message); EMLog.e(TAG, "EMFCMMSGService#onMessageReceived"); UIProvider.getInstance().getNotifier().sendNotification(message); } } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage);
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); String message = remoteMessage.getData().get("message"); Log.d(TAG, "From: " + remoteMessage.getFrom()); Log.d(TAG, "Message: " + message); //Check first if notification related to Instabug or not if (Instabug.isInstabugNotification(remoteMessage.getData())) { //Shown notification related to Instabug Instabug.showNotification(remoteMessage.getData()); } else { sendNotification(message); } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.e(ExampleApplication.TAG, "onMessageReceived()"); logPushBundle(remoteMessage); final Map<String, String> data = remoteMessage.getData(); if (Apptentive.isApptentivePushNotification(data)) { Apptentive.buildPendingIntentFromPushNotification(new Apptentive.PendingIntentCallback() { @Override public void onPendingIntent(PendingIntent pendingIntent) { if (pendingIntent != null) { String title = Apptentive.getTitleFromApptentivePush(data); String body = Apptentive.getBodyFromApptentivePush(data); ApptentiveLog.e("Title: " + title); ApptentiveLog.e("Body: " + body); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(MyFirebaseMessagingService.this) .setSmallIcon(R.drawable.notification) .setContentTitle(title) .setContentText(body) .setAutoCancel(true) .setSound(defaultSoundUri) .setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(0, notificationBuilder.build()); } } }, data); } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); if (remoteMessage != null) { // check if message contains a data payload if (remoteMessage.getData() != null && remoteMessage.getData().size() > 0) { Notification notification = createNotificationObject(remoteMessage); storeNotification(notification); raiseSystemNotification(notification); } // Check if message contains a notification payload if (remoteMessage.getNotification() != null) { // TODO: Decide if any action is needed here } } }
@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage);