2
我使用OneSignal SDK作爲反應本機。我嘗試禁用焦點時應用程序的內部警報。你有一個想法如何做到這一點?ios:禁用應用程序焦點時的警報通知(OneSignal)
這裏是我的代碼:
OneSignal.configure({
onIdsAvailable: function (device) {
console.log('UserId = ', device.userId);
console.log('PushToken = ', device.pushToken);
getUserId(device.userId);
},
onNotificationReceived: function (notification) {
OneSignal.checkPermissions((permissions) => {
console.log(permissions);
});
OneSignal.inFocusDisplaying(0);
},
onNotificationOpened: function(message, data, isActive) {
console.log("MS TYPE", message);
switch(message.notification.payload.additionalData.type) {
case '1':
Actions.messenger({id: message.notification.payload.additionalData.userID});
break;
case '2':
Actions.overview();
break;
}
}
});