What is the proper way to open a link in safari or external browser?

  • 3
  • Problem
  • Updated 7 years ago
  • Solved
Hi!, I've read a number of posts about opening up a link in safari. Some are for old versions of phonegap, while others I am not sure.

So, what's the working solution for the current versions?

Thanks!

Igor
Photo of Igor  Blinowski

Igor Blinowski

  • 27 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 3
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Well, I quickly searched your source code for "window.open" and found nothing. So it looks like you're not actually using the InAppBrowser.

Have a look at the docs on how to use it:
http://docs.phonegap.com/en/3.1.0/cor...
Photo of Trevor Miller

Trevor Miller

  • 34 Posts
  • 0 Reply Likes
My code has three steps:

I have four links with the same class in my index.html page:


I add click handlers in my document.ready function in my linked script file; these should run the "rate()" function when the links are tapped.


In the rate function I have the "window.open..." code as mentioned in the documentation you sent me:


More specific guidance would be greatly appreciated. I realize I am doing something wrong but the documentation you sent me is confusing and difficult to sift through. Thank you for your time.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
OK well I don't think you're doing anything wrong, as safari is succesfully being launched. It seems like safari isn't handling the url or forward very well.

What does your forward.html do?
Could you add an alert to forward.html to see if that page is successfully opening?
Could you skip that step and try opening the app store uri directly from your app?
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
For me, Safari is successfully launching the app store -- but the app store is blank (app doesn't exist?).

Edit: hrm I see that the app does exist. But I find that typing it directly into the safari address bar has the same effect. This may be an issue outside of PhoneGap, and rather with Safari. Maybe you should post somewhere more general like stackoverflow ...
Photo of paresh

paresh

  • 1 Post
  • 0 Reply Likes
I have search on internet and find solution at here may be helps you.

click here
Photo of Zahir

Zahir

  • 3500 Posts
  • 40 Reply Likes
Thank you all for the useful input.
Due to the thread inactivity, this issue is now closed.
The topic will be maintained as a reference.

Create a new issue if you have any other problem with PhoneGap Build.
Thanks

This conversation is no longer open for comments or replies.