내가 내 안드로이드 인앱 NotificationComapt.Builder 속으로안드로이드 중포 기지 알림 푸시 알림 getSubText
public class NotificationMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
String title = remoteMessage.getNotification().getTitle();
String message = remoteMessage.getNotification().getBody();
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
NotificationCompat.Builder nb = new NotificationCompat.Builder(this);
nb.setContentTitle(title);
nb.setContentText(message);
nb.setSmallIcon(R.drawable.iconanotifica);
nb.setAutoCancel(true);
nb.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000});
nb.setLights(Color.BLUE, 3000, 3000);
nb.setContentIntent(pendingIntent);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, nb.build());
}
}
에 통지를 관리하기 위해이 클래스를 사용,라는 방법이있다. 그래서 "remoteMessage.getNotification(). getSubText()"를 어떻게 얻습니까?
예, 작동합니다. 하지만 안드로이드 애플 리케이션을 사용하여 알림을 보내고 이것은 PHP 파일에 의해 관리됩니다. 데이터베이스에서 notifcation을 전송할 때만 하위 텍스트가 표시되지만 응용 프로그램에서 보내는 경우에는 표시되지 않습니다. 도울 수 있니? – Simone
안녕하세요 @ 사이먼, 제발 좀 더 문제를 확장 해 주시겠습니까? 원본과 별개 인 경우 질문을 업데이트하거나 내 대답을 수락하고 새 스레드를 만드십시오. – weneedweeds
아니요 제가 따라야 할 해결책이 아닙니다. 안드로이드 앱에서이 알림을 보내고 하위 텍스트를 설정해야합니다. – Simone