简体   繁体   English

推送通知横幅根本不会出现,即使应用程序在带有Swift 3.0的iOS中处于后台

[英]Push notification banner not at all coming even when app is in background in iOS with Swift 3.0

Push notification banner not at all coming even when app is in background in iOS - Swift 3.0. 即使在iOS-Swift 3.0中后台运行应用程序时,推送通知横幅也不会出现。 I followed following link to implement push notification for my app. 我按照以下链接为我的应用程序实现了推送通知。

Registering for Push Notifications in Xcode 8/Swift 3.0? 在Xcode 8 / Swift 3.0中注册推送通知?

I found them unreliable as well when I had the device connected to Xcode. 将设备连接到Xcode时,我也发现它们不可靠。 Try removing and installing the app again, and then disconnect it from Xcode. 尝试再次删除并安装该应用程序,然后将其与Xcode断开连接。 It should start showing up after that when it enters background but, it's definitely not that reliable. 进入后台后,它应该开始显示,但是绝对不是那么可靠。

Hope that helps. 希望能有所帮助。

Kind regards, Mukund 诚挚的问候,Mukund

Finally solved it. 终于解决了。 The "alert" keyword value in the userInfo was coming as a Dictionary from server. userInfo中的“ alert”关键字值是作为字典从服务器传入的。 When "alert" keyword is changed to string,(at server side) Banner started appearing. 当“ alert”关键字更改为字符串时,(在服务器端)开始出现横幅。 Thanks for all comments. 感谢所有评论。

在此处输入图片说明

Don't forget to make sure your phone is not in "DO NOT DISTURB" mode. 不要忘了确保您的手机未处于“请勿打扰”模式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS推送通知-检查应用程序在后台时横幅是否显示 - iOS Push Notification - check if the banner is showing when app is in background 当 iOS 应用程序在 Swift 后台时禁用推送通知主题 - Disable Push Notification topics when iOS App is in background in Swift 推送通知应用程序背景iOS 9 swift - push notification app background iOS 9 swift 应用程序在后台 swift 3 时的远程推送通知 - remote push Notification when app is in background swift 3 iOS应用程序在后台时的GCM推送通知 - GCM push notification when iOS app is in the background 当应用程序在后台或终止时,推送通知未进入 IOS 设备。 在 Flutter 的 IOS 设备中导航到下一个屏幕也不起作用? - Push notification not coming in IOS device when app in background or kill. Navigate to next screen also not working In IOS device in Flutter? iOS应用程序在后台时不会显示推送通知。 迅速 - IOS app won't display push notification when in background. Swift 当应用在后台运行时无法处理推送通知,收到推送但未点击横幅或警报 - Can't handle Push Notification when the app is running in Background, receives push but didn't click on the banner or alert 当我的应用程序处于后台时,仅当我触摸顶部的通知横幅时,才处理推送通知 - When my app is in background, push notifications are handled only if I touch the top notification banner 在Swift,iOS 8,9中的App Foreground时推送本地通知 - Push Local Notification when App Foreground in Swift, iOS 8,9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM