gpt4 book ai didi

ios - UIApplicationLaunchOptionsURLKey 究竟何时被填充?

转载 作者:行者123 更新时间:2023-11-28 21:42:01 28 4
gpt4 key购买 nike

自定义 URL 何时填充到 AppDelegate.m 文件的 launchOptions 中?我已经在 Safari 中加载了我的应用程序的自定义 URL,但未填充 UIApplicationLaunchOptionsURLKey

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

NSLog(@"app launch options");
NSLog([launchOptions valueForKey:UIApplicationLaunchOptionsURLKey]);
}

最佳答案

当您尝试通过以下方式打开应用程序时,UIApplicationLaunchOptionsURLKey 会被填充:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"yourapp://"]];

...yourappnot running .

然后(BOOL)application:(UIApplication *):didFinishLaunchingWithOptions:(NSDictionary *) 将被执行并且 NSDictionary 将填充两个键值UIApplicationLaunchOptionsURLKeyUIApplicationLaunchOptionsSourceApplicationKey

关于ios - UIApplicationLaunchOptionsURLKey 究竟何时被填充?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31669041/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com