4 Replies Latest reply on Jul 11, 2016 1:56 PM by arnfinni93996012

    Inappbrowser not working

    arnfinni93996012

      Hi, I am trying to use the inappbrowser on my app, it works fine when using phonegap desktop and the app, but when I am in build, it does not work. In build it states that the plugin is installed, but when I run the apk and install the app, it does not work. Tried several inappbrowser plugins, but on of them responds.

       

      The app is here: Adobe PhoneGap Build

      And the repo is here: GitHub - s-dm/LFCSCN-v.0.1

       

      So what am I doing wrong?

        • 1. Re: Inappbrowser not working
          VectorP Level 4

          Several mistakes:

           

          a) You have cordova.js included in your assets. That's not correct and you should remove it

          b) You are using a very old version of the plugin. Instead, reference the latest version from npm (cordova-plugin-inappbrowser)

          cordova-plugin-inappbrowser

          Be aware that window.open() is replaced by another method, which is documented in the plugin's docs

          c) You are not waiting for the deviceready event to fire before the window.open() can be called. In your case, it won't matter in most cases, because it's called upon a user's click. You should still correct that.

          • 2. Re: Inappbrowser not working
            arnfinni93996012 Level 1

            Perhaps I am pretty stupid now, but I think I have done those things you said now, but still the same problem..

            • 3. Re: Inappbrowser not working
              VectorP Level 4

              The proper version is 1.4.0 at npm. And you are specifying the source as 'pgb'.

              Also, you now have a cordova.js in /js (which you should remove)

              You still have window.open() in your index.html. Be aware that the inappbrowser plugin requires an own open() method!

               

              Further suggestions:

              - Have you considered building with a more recent PGB version?

              - You are using whitelist version 1.2.0; the latest is 1.2.2

              - Where is app.initialize() defined? I seem unable to find the method.

              • 4. Re: Inappbrowser not working
                arnfinni93996012 Level 1

                I figured it all out thanks to you.. It is now working.. I have been bug testing with all versions, thats why it is not the latest. I was wondering if it was the versions that did not work with phonegap build.

                 

                Thanks once again..