2017-10-31 1 views

答えて

1

QiscusFirebaseServiceで拡張し、remoteMessegeをhandleMessageReceivedに設定する必要があります。

QiscusFirebaseService.handleMessageReceived(remoteMessage) https://gist.github.com/fauzisho/64b89df651c91b1dd6d4d096c8d826ca

は、私はそのはあなたの問題を解決するために役立つことを願ってディテール例えば

0
try { 
      NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 
      String title = "" + ""; 

      PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); 

      Uri defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); 

      if (defaultSound == null) { 
       defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); 
       if (defaultSound == null) { 
        defaultSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM); 
       } 
      } 

      Notification.Builder builder = new Notification.Builder(context) 
        .setContentTitle(title) 
        .setContentText(message) 
        .setContentIntent(intent) 
        .setSmallIcon(icon) 
        .setLights(Color.BLUE, 20, 80) 
        .setAutoCancel(true) 
        .setSound(defaultSound); 

      if (bitmap != null) { 
       builder.setLargeIcon(bitmap); 
      } 

      Notification not = new Notification.BigTextStyle(builder).bigText(message).build(); 

      if (defaultSound == null) { 
       not.defaults |= Notification.DEFAULT_VIBRATE; 
       not.defaults |= Notification.DEFAULT_SOUND; 
      } 

      notificationManager.notify(0, not); 
     } 
     catch (Exception e) { 
      e.printStackTrace(); 
     }` 
関連する問題