[英]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.
感谢所有评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.