inAppBrowser not working

984 views
Skip to first unread message

Arya Garg

unread,
Jan 16, 2014, 10:18:55 AM1/16/14
to phon...@googlegroups.com
Hello Phonegap/Cordova Developers,

I want to open links inside the app, to do so I am using cordova's inappbrowser. As you can see in attached file I have done everything what was needed to open links in inappbrowser, however its behaving quite differently in ios. Yes its behaving differently in ios and working as expected in android. I am sick and tired of trying various methods but I am not sure what is the right way to implement.

I added locatio=true but its not working either.Even though no event is being fired on loardtart,loadstop,exit. 

I also tried using childbrowser plugin but as per phonegap docs they are no more supporting childbrowser plugin because inappbrowser is in core of phonegap/cordova now.

Please suggest me some.

Thanks,
Abhishek.
index.html
config.xml

WebSteve

unread,
Jan 16, 2014, 6:48:57 PM1/16/14
to phon...@googlegroups.com

Shazron

unread,
Jan 16, 2014, 7:01:10 PM1/16/14
to phonegap
You can't add event listeners to an InAppBrowser launched using _system, since we don't have control over Mobile Safari


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Arya Garg

unread,
Jan 17, 2014, 4:17:49 AM1/17/14
to phon...@googlegroups.com
I used _blank as well but I am not sure why its not working, none of the events is working. could you please share me code of working example. Its to be noted that its not working on ios only.

Arya Garg

unread,
Jan 17, 2014, 4:26:53 AM1/17/14
to phon...@googlegroups.com
no I even tried this way its not working could you please share some  sample code.

Shazron

unread,
Jan 17, 2014, 4:46:51 AM1/17/14
to phonegap
Try in a new project. Add the inappbrowser plugin, then add the sample code. It does work.


--

Arya Garg

unread,
Jan 17, 2014, 5:10:15 AM1/17/14
to phon...@googlegroups.com
No luck :(. Here is dropbox link https://www.dropbox.com/s/bw43mfasm39id6z/TestAppIos.zip  to newly created project but nothing is working.

Shazron

unread,
Jan 17, 2014, 6:51:56 AM1/17/14
to phonegap
I downloaded your app, ran it in the emulator -- every single test works.

> cordova prepare
> cordova emulate ios

Arya Garg

unread,
Jan 17, 2014, 6:53:45 AM1/17/14
to phon...@googlegroups.com
did you test on ios?

Arya Garg

unread,
Jan 17, 2014, 6:54:45 AM1/17/14
to phon...@googlegroups.com
I tested on ipad with ios 7 and ios 6 simulator but no results.

Shazron

unread,
Jan 17, 2014, 7:05:02 AM1/17/14
to phonegap
Yes, like I said, it works fine. I even specified what I ran:
> cordova prepare
> cordova emulate ios

Arya Garg

unread,
Jan 17, 2014, 7:21:18 AM1/17/14
to phon...@googlegroups.com
you executed code without changes?

Shazron

unread,
Jan 17, 2014, 7:31:17 AM1/17/14
to phonegap
For the final time - yes. I  just ran those two commands

Arya Garg

unread,
Jan 17, 2014, 7:34:38 AM1/17/14
to phon...@googlegroups.com
I am sorry that I am asking you again and again but its not working on any of my emulator or device :(. Could you please share screenshots?

Shazron

unread,
Jan 17, 2014, 7:47:49 AM1/17/14
to phonegap
I don't think screenshots will help convince you. You'll have to wait for others to grab your code to verify my results, which I have double checked by unzipping your code fresh -- it still works.

Print out the cordova version you are using:
cordova -v

All they need to do is grab your code, run these two commands below in the folder, and try your tests manually. I'm confident it will work unless their cordova environment is faulty.

$ cordova prepare
$ cordova emulate ios

Arya Garg

unread,
Jan 17, 2014, 10:07:17 AM1/17/14
to phon...@googlegroups.com
Hi, I updated cordova build but still its not working.

Shazron

unread,
Jan 17, 2014, 7:00:36 PM1/17/14
to phonegap
I asked about your cordova version, run:
cordova -v


Message has been deleted

Arya Garg

unread,
Jan 19, 2014, 11:39:39 PM1/19/14
to phon...@googlegroups.com
Abhisheks-Mac-mini:~ abhishekgarg$ cordova -v
3.3.1-0.1.2

Arya Garg

unread,
Jan 20, 2014, 5:08:59 AM1/20/14
to phon...@googlegroups.com

https://drive.google.com/file/d/0BxYSHjZ3x4uiRi1HellpYmc3Z0E/edit?usp=sharing  is output what I get upon clicking links. As you can see there is no address bar or close button.

jcesarmobile

unread,
Jan 20, 2014, 6:33:00 AM1/20/14
to phon...@googlegroups.com
I've downloaded your project and didn't work, but after running the "cordova prepare" command it worked

Arya Garg

unread,
Jan 20, 2014, 6:35:35 AM1/20/14
to phon...@googlegroups.com
could you please share screenshots?

jcesarmobile

unread,
Jan 20, 2014, 8:24:34 AM1/20/14
to phon...@googlegroups.com
I've already deleted the app and the project, but it worked after running the "cordova prepare" command

Arya Garg

unread,
Jan 20, 2014, 8:31:16 AM1/20/14
to phon...@googlegroups.com
hmm, I am not saying its not working it is working but its not working as expected.


https://drive.google.com/file/d/0BxYSHjZ3x4uiRi1HellpYmc3Z0E/edit?usp=sharing  is output what I get upon clicking links. As you can see there is no address bar or close button.

jcesarmobile

unread,
Jan 20, 2014, 9:04:01 AM1/20/14
to phon...@googlegroups.com
The files you are sharing are protected, we can't see them

Arya Garg

unread,
Jan 20, 2014, 9:08:19 AM1/20/14
to phon...@googlegroups.com
its available for public now, please check and confirm the same.

jcesarmobile

unread,
Jan 20, 2014, 9:21:31 AM1/20/14
to phon...@googlegroups.com
You get that using any of the options?
I got it as it was described, the firt one with toolbar and location bar, the second just with the toolbar, the third with "return" instead "ok"

Arya Garg

unread,
Jan 20, 2014, 9:29:55 AM1/20/14
to phon...@googlegroups.com
Its not working, please share the screenshots if you can.
Message has been deleted

jcesarmobile

unread,
Jan 20, 2014, 9:43:28 AM1/20/14
to phon...@googlegroups.com
the 3 first options
Captura de pantalla de Simulador iOS 20.01.2014 15.40.22.png
Captura de pantalla de Simulador iOS 20.01.2014 15.40.14.png
Captura de pantalla de Simulador iOS 20.01.2014 15.40.03.png

Arya Garg

unread,
Jan 20, 2014, 9:51:09 AM1/20/14
to phon...@googlegroups.com
hmm, did you make any changes? what version you are using?

On Monday, January 20, 2014 8:13:28 PM UTC+5:30, jcesarmobile wrote:
the 3 first options

jcesarmobile

unread,
Jan 20, 2014, 10:19:57 AM1/20/14
to phon...@googlegroups.com
didn't change anything

I've 3.1.0-0.2.0 installed

Arya Garg

unread,
Jan 20, 2014, 1:04:43 PM1/20/14
to phon...@googlegroups.com
Issue has been resolved. I deleted existing project updated to latest version and all is working.

Dan Allen

unread,
Jan 24, 2014, 5:59:06 PM1/24/14
to phon...@googlegroups.com
I also got this to work, but I had to run the simulator through xcode.

I downloaded the code from drop box to my MacBookPro running OSX 10.9.  My cordova version is 3.3.1-0.1.2

In the terminal, I navigated to the project directory (testappios, containing the downloaded files.)

I ran cordova prepare, that ran ok, but when I run cordova emulate ios, I get an error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Running on emulator for platform "ios" via command "/Users/boss/Documents/_Jay/ProjectEntry/PhoneGapProjects/TestAppIos/platforms/ios/cordova/run" --emulator

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occurred while emulating/deploying the ios project.
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/emulate.js:67:22)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

Now that I have a project that works, from this sample, need to get it working in my own project!

Arya Garg

unread,
Jan 24, 2014, 10:57:26 PM1/24/14
to phon...@googlegroups.com
First use Cordova build instead Cordova prepared, second make sure you Cordova.js and Cordova_plugins.js are on same location, 3rd make sure path to plugins is correct in Cordova_plugins.js

Dan Allen

unread,
Jan 25, 2014, 10:40:44 AM1/25/14
to phon...@googlegroups.com
Sorry for duplicate post, but I wanted to get any comment you might have regarding what happened when I tried reproducing your result.  I did get the project to run in xcode, with InAppBrowser working as you did, but when I ran  cordova prepare then cordova emulate, I got the following (My cordova version is 3.3.1-0.1.2):

Generating config.xml from defaults for platform "ios"
Preparing ios project
Running on emulator for platform "ios" via command "/Users/boss/Documents/_Jay/ProjectEntry/PhoneGapProjects/TestAppIos/platforms/ios/cordova/run" --emulator

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occurred while emulating/deploying the ios project.
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/emulate.js:67:22)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

Any idea why I would get this result?

Justin

unread,
Feb 27, 2014, 10:31:23 AM2/27/14
to phon...@googlegroups.com
Arggg.  The inapp browser will not load the done button for me.  When I ran the prepare command, it screwed up my waiting dialog amongst other things.  Very frustrating.

Justin

Justin

unread,
Feb 27, 2014, 10:57:19 AM2/27/14
to phon...@googlegroups.com
My fault.  Apparently, I don't understand the new paradigm shift introduced in 3.0.  The prep command just overrode all of my changes in the xCode project with a copy of what was in the root www folder.

However, the prep command also got the done button to show up.
Reply all
Reply to author
Forward
0 new messages