Permalink
Browse files

Added Deep Linking

  • Loading branch information...
gliechtenstein committed Nov 5, 2016
1 parent b6f1f07 commit b359ab6d44f88d54ca9a5240f0e62e4ec0ca6852
Showing with 18 additions and 0 deletions.
  1. +18 −0 app/Jasonette/JasonAppDelegate.m
@@ -25,6 +25,24 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
if([[url absoluteString] containsString:@"://oauth"]){
[[NSNotificationCenter defaultCenter] postNotificationName:@"oauth_callback" object:nil userInfo:@{@"url": url}];
} else if ([[url absoluteString] containsString:@"://href?"]){
NSString *u = [url absoluteString];
NSString *href_url = [JasonHelper getParamValueFor:@"url" fromUrl:u];
NSString *href_view = [JasonHelper getParamValueFor:@"view" fromUrl:u];
NSString *href_transition = [JasonHelper getParamValueFor:@"transition" fromUrl:u];
NSMutableDictionary *href = [[NSMutableDictionary alloc] init];
if(href_url && href_url.length > 0) href[@"url"] = href_url;
if(href_view && href_view.length > 0) href[@"view"] = href_view;
if(href_transition && href_transition.length > 0) {
href[@"transition"] = href_transition;
} else {
// Default is modal
href[@"transition"] = @"modal";
}
[[Jason client] go:href];
} else {
// Only start if we're not going through an oauth auth process
[[Jason client] start];

0 comments on commit b359ab6

Please sign in to comment.