我有一个像这样的网址 myApp://action/1?parameter=2&secondparameter=3
通过属性查询,我得到了我的部分内容 URL
parameter=2&secondparameter=3
Run Code Online (Sandbox Code Playgroud)
有没有什么方法可以把它放在一个NSDictionary
或一个Array
?
多谢
我开始在iOS应用程序中使用https://branch.io/.
我现在面临的问题是:如何使用其参数捕获传入链接?
遵循此处的文档.
我到了这一点,有这个链接:
http://myapp.app.link/A1bcDEFgHi?XP=315.0,419.0
我的代码是:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
Branch *branch = [Branch getInstance];
[branch initSessionWithLaunchOptions:launchOptions
andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
if (!error && params) {
NSLog(@"Here is params: %@",params.description); // I need to replace this, with code to get XP!
}
}];
return YES;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
{
BOOL handledByBranch = [[Branch getInstance] continueUserActivity:userActivity];
return handledByBranch;
}
Run Code Online (Sandbox Code Playgroud)
这是我在调试控制台中得到的:
2016-06-10 11:59:44.407 TheApp[1786:591391] Here is params: {
"$identity_id" = 2712491317999770034; …
Run Code Online (Sandbox Code Playgroud)