【发布时间】:2017-10-03 18:13:14
【问题描述】:
我正在使用 Firebase 管理 SDK 从我的节点服务器发送推送通知。但在 iOS 上,我只想在应用程序处于后台/终止时显示通知,而不是在前台显示通知。目前它会一直显示通知。
这是我的有效载荷:
const payload = {
data: {
data: 'data',
more: 'moreData',
},
notification: {
title: 'Incoming Call',
body: 'Someone is calling you',
text: 'This is some text',
sound: 'default',
click_action: 'com.example.INCOMING_CALL',
}
};
const options = {
priority: 'high',
time_to_live: 30,
collapse_key: 'Video Call',
content_available: true,
};
admin.messaging().sendToDevice(tokensList, payload, options);
是我的有效载荷中的某事还是我必须在 AppDelegate.swift 中执行的某事?
【问题讨论】:
标签: ios swift firebase push-notification firebase-admin