I referred this IOS url Scheme launch custom UIView inside my application, but i am not clear what he s trying to answer.
Is it possible to load custom UIVIew over my app login screen through URL Scheme ?
My Scenario- I am showing custom view as a pop up in login view process, where it checks, whether app has accepted terms and conditions or not. It works fine in when app s running in background as well app as app is launched from installed app.
But when i launch app from URL Scheme section, it works fine when app s running in background, but when app get terminated, I open app from URL Schemes, App is launched but custom view gets hide immediately.
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
self.isCalledFromSafariBrowser = true;
AppCodeViewController_iPad *appCodeViewController = [[AppCodeViewController_iPad alloc]init];
if (!url)
{
return NO;
}
NSString *URLString = [url absoluteString];
NSArray *arr = [URLString componentsSeparatedByString:@"?"];
arr = [[arr objectAtIndex:1] componentsSeparatedByString:@"&"];
NSArray *usernameArray = [[arr objectAtIndex:0] componentsSeparatedByString:@"="];
NSLog(@"user name = %@",[usernameArray objectAtIndex:1]);
NSArray *passwordArray =[[arr objectAtIndex:1] componentsSeparatedByString:@"="];
NSLog(@"password name = %@",[passwordArray objectAtIndex:1]);
NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults];
NSString * appcode = [standardUserDefaults stringForKey:@"Appcode"];
NSLog(@"app code vlaue == %@",appcode);
if (appcode == (id)[NSNull null] || appcode.length == 0 )
{
[appCodeViewController userLogin:[usernameArray objectAtIndex:1] andPassword:[passwordArray objectAtIndex:1]];
}
else
{
self.username =[usernameArray objectAtIndex:1];
self.SubscriberPwd = [passwordArray objectAtIndex:1];
[self chkPermissions];
}
return YES;
}