应用未运行时的通用链接 [英] Universal Links while app is not running

查看:71
本文介绍了应用未运行时的通用链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中实现通用链接.一切都对我有用,除非应用程序不在后台运行.在那种情况下,我如何在我的应用程序中打开特定页面?iOS启动了我的应用程序,但是我没有收到任何回调

I am implementing Universal Links in my app. Every things works for me, except when the app is not running in the background. In that case how i can open a specific page in my app? iOS launches my app but i am not getting any callback in

-(BOOL)应用程序:(UIApplication *)应用程序continueUserActivity:(NSUserActivity *)userActivity restoreHandler:(void(^)(NSArray *))restorationHandler
在此功能中,我在此行均未获取任何网址

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler
in this function neither i am getting any url with this line

NSURL * launchURL = [launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];

-(BOOL)应用程序:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 此功能.

有人知道我如何获取导致启动我的应用程序的网址.

Does anybody have an idea how i can get the url which caused to launch my application.

谢谢

推荐答案

使用您的应用打开通用链接

When you open a Universal Link with your app

 - (BOOL)application:(UIApplication *)app
        openURL:(NSURL *)url
        options:(NSDictionary<NSString *,
                         id> *)options

如果出现这种情况,将使用通用链接作为参数和选项来调用

.检查苹果文档以获取详细信息.

is called with the Universal Link as a parameter and options if it is the case. Check apple docs for details.

这篇关于应用未运行时的通用链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆