2017-10-31 18 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(); 
     }`