【发布时间】:2018-12-27 13:37:26
【问题描述】:
是否可以隐藏我通过我的 api 从 firebase 收到的通知。目前我正在访问 MyFirebaseMessagingService 中的通知,如下所示:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Intent intent = new Intent(INTENT_FILTER);
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
if (remoteMessage.getNotification().getBody() != null) {
setClientId(remoteMessage);
}
}
private void setClientId(RemoteMessage remoteMessage) {
RemoteMessage.Notification notification = remoteMessage.getNotification();
if (notification.getBody().equals("client_id")) {
putClientIdToSharedPrefs((notification.getTitle()));
}
}
我不想在状态栏中向用户显示消息,我只是为了接收消息并保存它。
【问题讨论】:
-
只是删除通知块,我认为你不能从 firebase 面板测试它
-
@OussemaAroua“删除通知块”?你到底是什么意思?
-
如以下答案所示
标签: java android firebase firebase-cloud-messaging