[英]iOS UILocalNotification for incomming sip notification
After getting sip notification how to show it to user using UILocalNotification
when app is in background. 收到UILocalNotification
通知后,当应用程序在后台UILocalNotification
时,如何使用UILocalNotification
将其显示给用户。
App's Background mode is ->voip
and it is always alive in background
. 应用程序的Background mode is ->voip
,并且always alive in background
。
just it can not show notification after getting sip call when it is in background. 只是在后台通话时无法显示通知。
It's a little difficult to tell what your question is, but I can tell you that a UILocalNotification will present itself to the user exactly as is described in Apple's documentation at "Local and Push Notification Programming Guide" > "Handling Local and Remote Notifications". 很难说出您的问题是什么,但是我可以告诉您,UILocalNotification会完全按照Apple文档 “本地和推送通知编程指南”>“处理本地和远程通知”中的描述向用户展示自己。 Specifically: 特别:
-application:didReceiveLocalNotification:
and present (or not present) the notification as you see fit. 如果您的应用程序位于前台,iOS不会自动显示您的通知-您必须实现UIApplicationDelegate的-application:didReceiveLocalNotification:
并在您认为合适的情况下显示(或不显示)通知。 And don't forget forget to actually schedule your UILocalNotification with -[UIApplication sharedApplication] using the -scheduleLocalNotification:
method. 并且不要忘记使用-scheduleLocalNotification:
方法使用-[UIApplication sharedApplication]实际调度UILocalNotification。 Just creating the UILocalNotification won't do anything. 仅创建UILocalNotification不会做任何事情。
AND, I think you need to use UIApplication's -registerForRemoteNotificationTypes:
even for local notifications. 而且,我认为您甚至需要使用UIApplication的-registerForRemoteNotificationTypes:
甚至用于本地通知。
Just as an aside unrelated to Local Notifications, because we struggled with VOIP backgrounding as well, note that just because you set the Background mode to VOIP, doesn't mean your app will always be running. 除了与本地通知无关之外,由于我们也对VOIP背景进行了挣扎,请注意,仅仅因为您将“背景”模式设置为VOIP,并不意味着您的应用将始终运行。 Any of the following will lead to iOS terminating your app: 以下任何一项都会导致iOS终止您的应用程序:
So you should confirm (through tracing or something else) that your VOIP signaling channel is, in fact, alive in the background when you're testing local notifications. 因此,当您测试本地通知时,您应该(通过跟踪或其他方式)确认您的VOIP信号通道实际上在后台还活着。
In conclusion, you have a lot of investigating & troubleshooting to do :) 总之,您需要进行大量调查和故障排除:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.