Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7086263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:31:41+00:00 2026-05-28T07:31:41+00:00

I am using PhoneGap for an iOS project and everything is working except I

  • 0

I am using PhoneGap for an iOS project and everything is working except I want to detect a click of the logout link in our web app and intercept it with local logout logic. I am able to detect the logout link, but the logic below ALSO thinks it is the logout page when about:blank fires in PhoneGap’s UIWebView. Any ideas what I’m doing wrong?

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    NSURL *url = [request URL];
    // If we detect the logout.jsp we need to go back to the login form and reset the credentials
    if ([[url path] rangeOfString:@"logout.jsp"].location == NSNotFound) {
        if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
            return YES;
        }
        else {
            return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
        }
    }
    else {
        // have PhoneGap go back to index page
        NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"www/index" ofType:@"html"];

        NSURL *url = [NSURL fileURLWithPath:urlAddress];
        NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
        [theWebView loadRequest:requestObj];
        return NO;
    }
}

EDIT:

I haven’t solved why this is happening, so for now I have added this workaround in the main else clause:

if ([[url path] rangeOfString:@"about:blank"].location != NSNotFound) {
    return YES;
}

The bounty will go to someone who can figure out why I even need that workaround when the initial IF is only checking for the logout.jsp string in the url and about:blank should never match that, but does in this case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:31:42+00:00Added an answer on May 28, 2026 at 7:31 am

    If the request url is “about:blank”, then [url path] returns nil.

    So [nil rangeOfString:@"logout.jsp"].location return 0 and NSNotFound != 0.

    That’s why the sentence ([[url path] rangeOfString:@"about:blank"].location != NSNotFound) is TRUE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use html5's web-database using phonegap for an iOS app for the
I am using phonegap and sqlite to develop cross-platform mobile app for android,ios,blackberry.For reference
I created iOS app using PhoneGap version 0.9.6 long back. Now I am going
I'm currently using phonegap to create and ios app. While getting familiar to the
I'm coding an app for iOS / WP7 / Android using PhoneGap and it
I am building a phonegap app for iOS which works perfectly and beautifully except
I am using Sencha Touch with Phonegap to bring my app to iOS. When
I'm building an iOS app with PhoneGap. I'm using translate3d CSS animations to create
I'm building an app using Phonegap and I'm using Urban Airship for iOS and
I have an app made using jquerymobile+phonegap, and running under iOS. The surpise arrived

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.