//
// AppDelegate+Deeplink.m
// iCemarose
//
// Created by Sanchew on 2017/6/29.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "AppDelegate+Deeplink.h"
#import <JLRoutes/JLRoutes.h>
@implementation AppDelegate (Deeplink)
- (void)registerRouter {
JLRoutes *routes = [JLRoutes routesForScheme:@"cemarose"];
[routes addRoute:@"/collections/*" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSArray *tags = parameters[JLRouteWildcardComponentsKey];
NSLog(@"trace tags %@",[tags componentsJoinedByString:@","]);
return YES;
}];
[routes addRoute:@"/products/:id" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSLog(@"product id %@",parameters[@"id"]);
return YES;
}];
}
- (BOOL)handleURL:(NSURL *)url {
return [JLRoutes routeURL:url];
}
@end