【发布时间】:2023-03-06 22:46:01
【问题描述】:
我将 Firebase 云消息传递用于我的推送通知,它在其后端使用 APN。
当应用在前台时,调用didReceiveRemoteNotification并且不显示通知,完美。
当应用程序被杀死时,didReceiveRemoteNotification 不会被调用,但会显示通知,也可以。
但是,当应用程序处于后台时,didReceiveRemoteNotification 都会被调用并显示通知。如何隐藏它并只保留didReceiveRemoteNotification 被调用?
这是我的有效载荷的样子:
$fields = array(
'registration_ids' => $tokens,
'data' => $message,
'content_available' => true,
'priority' => 'high',
'notification' => array('body' => 'notifbody', 'title' => 'testtitle', 'sound' => 'default')
);
【问题讨论】:
-
你得到答案了吗?不可能吗?
标签: ios swift push-notification apple-push-notifications firebase-cloud-messaging