[英]There is no delegate or notification when user pressed facetime button from callkit
I had a VoIP app which should support video call.我有一个应该支持视频通话的 VoIP 应用程序。 So, I oppen the app, lock the screen, then receive an incoming audio call.
所以,我打开应用程序,锁定屏幕,然后接听来电。 The problem is I did not figure out how to get notify when user presssed on "facetime" (video call) button.
问题是我不知道如何在用户按下“facetime”(视频通话)按钮时获得通知。 Basicaly user is lead to the app but nothing is happening since I did know to what delegate or notification to listen.
基本上用户被引导到应用程序,但没有发生任何事情,因为我确实知道要收听的委托或通知。
I looked over Skipe app and it seems to get notified when video call button is pressed on the call screen.我查看了 Skipe 应用程序,当在通话屏幕上按下视频通话按钮时,它似乎会收到通知。 So when "facetime" button is pressed in Skipe app user is lead to the app and video stream begins.
因此,当在 Skipe 应用程序中按下“facetime”按钮时,用户会被引导到应用程序并开始视频流。
In short words, can some one points me which kind of delegate or notification should I listen in order to get notify when user pressed on video button from call kit?简而言之,有人可以指出我应该听哪种委托或通知,以便在用户按下呼叫工具包中的视频按钮时收到通知?
Acording to this post: https://stackoverflow.com/a/43487523/6296389 , there is an AppDelegate method that notify the app when video buttons is pressed from native CallKit screen when phone is locked.根据这篇文章: https ://stackoverflow.com/a/43487523/6296389,有一个 AppDelegate 方法可以在手机锁定时从原生 CallKit 屏幕按下视频按钮时通知应用程序。
Objective C delegate method is: Objective C 委托方法是:
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
You should check if:您应该检查是否:
[userActivity.activityType isEqualToString:@"INStartVideoCallIntent"]
to identify if received action is a start video intent.识别接收到的动作是否是开始视频意图。
Swift version迅捷版
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == "INStartVideoCallIntent" {
// treat start video
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.