0
특정 fcm 토큰 (사용자 당)으로 완벽하게 작동합니다. 지금은 '주제'알림을 추가 할, 그래서 구독 추가 한 : Android : Firebase "topics"알림이 내 앱에서 처리되지 않습니다.
public class MyInstanceIDListenerService extends FirebaseInstanceIdService {
private static final String TAG = LogUtils.makeLogTag(MyInstanceIDListenerService.class);
/**
* Called if InstanceID token is updated. This may occur if the security of
* the previous token had been compromised. Note that this is also called
* when the InstanceID token is initially generated, so this is where
* you retrieve the token.
*/
@Override
public void onTokenRefresh() {
// Get updated InstanceID token.
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
LogUtils.LOGD(TAG, "Refreshed FCM token: " + refreshedToken);
...
subscribeTopics();
}
/**
* Subscribe to any FCM topics of interest, as defined by the TOPICS constant.
*/
private void subscribeTopics() {
for (String topic : MyFcmListenerService.TOPICS) {
FirebaseMessaging.getInstance().subscribeToTopic(topic);
}
}
}
그리고 내 수신기
알림 이런 종류의 처리하지 않습니다 는public class MyFcmListenerService extends FirebaseMessagingService {
private static final String TAG = LogUtils.makeLogTag(MyFcmListenerService.class);
// Topics
public static final String TOPIC = "/topics/";
public static final String UPGRADE = "upgrade";
public static final String[] TOPICS = {UPGRADE};
// Downstream type messages
public static final String PROFIL = "profil";
...
protected WebServicesModule getWebServicesModule() {
return MyApplication.getInstance().getDataHolder().getWebServicesModule();
}
public MyFcmListenerService() {
}
/**
* Called when message is received.
*
* @param message
*/
@Override
public void onMessageReceived(RemoteMessage message) {
String from = message.getFrom();
Map data = message.getData();
LogUtils.LOGD(TAG, "[FCM] Topic message received from [" + from + "]");
...
onMessageReceived 기능은()이다 호출되지 나는 (우편 배달부)에서이 통지를 보낼 때이 헤더 구성
을 :
여러분의 도움에 감사드립니다!