Как указано в документах для разработчиков Firebase, я реализовал службу который расширяет FirebaseMessagingService и переопределяет обратный вызов onMessageReceived. Я поместил сообщение журнала в первую строку внутри метода onMessageReceived.
Приложение работает в фоновом режиме Я не вижу журнал в logcat, но вижу уведомление, размещенное в системе try.
Приложение на переднем плане Я не вижу ни журнала, ни уведомлений на панели задач
Есть идеи, что происходит?
Манифест
<service
android:name=".fcm.MovieMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
Класс обслуживания
public class MovieMessagingService extends FirebaseMessagingService {
private static final String LOG_TAG = MovieMessagingService.class.getSimpleName();
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.d(LOG_TAG, "From: " + remoteMessage.getFrom());
}
/**
* Create and show a simple notification containing the received FCM message.
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String messageBody) {
Log.d(LOG_TAG, "Presenting Notification with message body: " + messageBody);
//more code
}
}