Created
March 26, 2018 07:11
-
-
Save buixuanhai/e5b1cb11c944fb334a734b6555ee0805 to your computer and use it in GitHub Desktop.
Get query params on launching app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { | |
NSLog(@"Opened by url %@", url.query); | |
NSDictionary *params = [self parseURL:url]; | |
for(id key in params) | |
NSLog(@"key=%@ value=%@", key, [params objectForKey:key]); | |
NSString *amount = [params objectForKey:@"amount"]; | |
self.amount = [amount intValue]; | |
[[NSUserDefaults standardUserDefaults] setObject:amount forKey:@"amount"]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment