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

  • Home
  • SEARCH
  • 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 8532713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:46:41+00:00 2026-06-11T09:46:41+00:00

I am working with Sencha Touch and PhoneGap. The code is for iOS and

  • 0

I am working with Sencha Touch and PhoneGap. The code is for iOS and it’s waiting for url with suffix #phonegap-external ..

- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *url = [request URL];
if ( ([url fragment] != NULL) && ([[url fragment] rangeOfString:@"phonegap=external"].location != NSNotFound))
{
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
}

return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
}

So because I haven’t written any line of code in Obj-C, I need your help. Can someone edit code, so that it would open url without suffix.

EDIT:
If user opens url in app, it would open it inside webview but on occasion I would prefer that url is opened in Safari. So this code checks if url has suffix like this – http://google.com#phonegap-external and than it opens it in Safari. Only thing what bugs me, is url is not changed into http://google.com and it opens given url http://google.com/#phonegap-external. Could someone please fix this.

  • 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-06-11T09:46:42+00:00Added an answer on June 11, 2026 at 9:46 am

    If you’re sure that the part of the URL that indicates whether it’s to be opened inline or externally (i. e. the #phonegap-external string) is always the last one in the URL, then you can try removing this suffix by writing something like as follows:

    NSString *orig = [url absoluteString];
    size_t frLen = [@"phonegap-external" length];
    NSString *stripped = [orig substringToIndex:orig.length - frLen];
    NSURL *newURL = [NSURL URLWithString:stripped];
    
    [[UIApplication sharedApplication] openURL:newURL];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project using Sencha Touch 2.0 and PhoneGap. I need to
I'm working on a mobile web-app using sencha touch, HTML5 and phonegap as a
I have following code which is not working on sencha touch 2, is there
I am working with Sencha Touch 2 and I need to create a TitleBar
I am working on a Sencha Touch application and I am learning it great
I am working with this example to try and learn Sencha Touch. I have
Im working with Sencha touch and I am trying to update a panel after
I am working on a mobile application and using sencha touch charts. By default
I'm just working on a web application with sencha touch. I need to implement
So I just started Working with Sencha Touch 2 and I am already running

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.