In my app iam using web view with URL:@"http://www.gmail.com/".
This web view was loaded when i clicked a button in the main page / home page
(IBAction)webClick:(id)sender { MailViewController *mail = [[MailViewController alloc]initWithNibName:@"MailViewController" bundle:nil]; [self.navigationController pushViewController:mail animated:YES]; }
Then the web view was loaded, i used code like thin this in mail view:
-(void)viewDidLoad { [super viewDidLoad]; NSString *urlAddress = @"http://www.gmail.com/"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; }
Here the gmail opened with login page. we need to enter username & password.
What i want is,
if we already login into my account through gmail application..
The loaded view directly loades my mail, instead of login page.
if i didn't already loged in, then show an alert as please login.
How to do it?
Please help me. Thanks in advance.