简体   繁体   English

带有来电的锁屏界面

[英]Lock Screen UI with incoming Call

I am working on a video/audio call app. 我正在使用视频/音频通话应用程序。 Now when my phone is locked and another user is calling me then from the lock screen I will get a notification and if I swipe the notification then the call automatically received. 现在,当我的电话被锁定并且另一个用户正在呼叫我时,我将从锁定屏幕中收到一条通知,如果我轻扫该通知,则该呼叫会自动收到。 I used UILocalNotification for getting notification. 我使用UILocalNotification获取通知。

But I don't want like this. 但是我不想这样。 I want to see the UI same as when another user call me when my phone is unlocked that is there will be receive/reject option with my UI. 我希望看到的UI与解锁手机时另一个用户给我打电话时看到的UI相同,UI上会有接收/拒绝选项。 I want to receive call like Viber or skype. 我想接Viber或Skype之类的电话。 How can I do that? 我怎样才能做到这一点?

You should be looking into the PushKit framework form Apple. 您应该查看Apple的PushKit框架。

The PushKit framework provides the classes for your iOS apps to receive VoIP pushes from remote servers. PushKit框架为您的iOS应用提供了类,以接收来自远程服务器的VoIP推送。 VoIP pushes provide the functionality that VoIP apps need to perform on-demand processing of the push before displaying a notification to the user. VoIP推送提供了VoIP应用程序在向用户显示通知之前执行推送的按需处理所需的功能。

Apple Documentation 苹果资料

There are some tutorials might help you. 有一些教程可能会对您有所帮助。

Tutorial 1 教程1

Tutorial 2 教程2

Update 更新

To display the system-calling UI for your app's VoIP services you can use CallKit . 要显示应用程序的VoIP服务的系统调用UI,可以使用CallKit

CallKit documentation CallKit文档

Sample code from Apple 苹果公司的示例代码

Here is a tutorial which explains it well. 这是一个很好解释的教程。

http://www.techjini.com/blog/enhance-voip-app-user-experience-using-pushkit-callkit/ http://www.techjini.com/blog/enhance-voip-app-user-experience-using-pushkit-callkit/

https://www.raywenderlich.com/150015/callkit-tutorial-ios https://www.raywenderlich.com/150015/callkit-tutorial-ios

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM