我在 onesignal 启动选项中禁用了聚焦、自动提示、启动 url 和应用程序警报,但是当应用程序处于前台时仍然显示横幅,是缺少某些东西还是我写了一些额外的东西,这是我的代码,请查看下面的代码和帮帮我。
//For One Signal
let notificationReceivedBlock: OSHandleNotificationReceivedBlock = { notification in
print("Received Notification: \(notification!.payload.notificationID)")
}
let notificationOpenedBlock: OSHandleNotificationActionBlock = { result in
// This block gets called when the user reacts to a notification received
let payload: OSNotificationPayload = result!.notification.payload
var fullMessage = payload.body
print("Message = \(String(describing: fullMessage))")
if payload.additionalData != nil {
if payload.title != nil {
let messageTitle = payload.title
print("Message Title = \(messageTitle!)")
}
let additionalData = payload.additionalData
if additionalData?["actionSelected"] != nil { …
Run Code Online (Sandbox Code Playgroud) 当iPhone改变其电源模式时,我需要获得低功耗模式状态,天气低功耗模式在我的应用程序中打开或关闭警报.
请通过解决方案帮助我.
谢谢
ios ×1
ios10 ×1
ios9.1 ×1
iphone ×1
objective-c ×1
onesignal ×1
swift3 ×1
uialertview ×1
xcode7 ×1
xcode8 ×1