Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)handleDeepUrlLink:(NSURL *)url {
- self.deepLinkUlr = nil;
- NSString *defURLScheme = nil;
- #ifdef DEBUG
- defURLScheme = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"kURLSchemeDebug"];
- #else
- defURLScheme = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"kUrl_scheme"];
- #endif
- if ([[url scheme] isEqualToString:defURLScheme]) {
- NSMutableArray *parameters = [[[[url path] stringByReplacingOccurrencesOfString:@"/" withString:@""] componentsSeparatedByString:@"="] mutableCopy];
- if ([parameters containsObject:@"reset"]) {
- if (![AOCredentialStore isLogged]) {
- [self handleResetPasswordDeepLinkWithParameters:parameters];
- } else {
- __weak typeof(self) weakSelf = self;
- [AOCredentialStore logoutActionWithCompletion:^{
- [weakSelf handleResetPasswordDeepLinkWithParameters:parameters];
- }];
- }
- } else {
- if (parameters.count >= 2) {
- //access code should be second parameter
- [AOCredentialStore loginWithAccessCode:parameters[1] andComplitionBlock:^{
- [[NSNotificationCenter defaultCenter] postNotificationName:kAOCredentialStoreDidLoginAccessCodeNotification object:nil userInfo:@{@"SetNewPinFlag" : @"Y"}];
- }];
- }
- }
- }
- else if ([url isFileURL]) {
- [[NSNotificationCenter defaultCenter] postNotificationName:kNotificationDidReceiveOpenInFile
- object:nil
- userInfo:@{kNotificationDidReceiveOpenInFileUrlKey:url}];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement