4 Replies Latest reply on Nov 28, 2017 11:56 PM by Opolo Webdesign

    wrap website in app

    Opolo Webdesign Level 1

      I have been asked to build an app based on an existing website so I started with inAppBrowser. This however won't cut it, since my client wants to be able to use native functions like the camera. So now I have put the following inside my config.xml file which works perfectly:


      <content src="https://domain.tld" />

      <allow-navigation href="https://domain.tld/*" />


      Now the tricky part: using native functions. I read that inAppBrowser does not support this due to security reasons, which I can understand. But is this something that can be done the way I'm now handling this?


      I have also looked at this plugin which states it "allows you tu access plugins and other Cordova resources", cordova-second-webview, however I can't seem to find how to get this to work. I have included a toast plugin in my project (cordova-plugin-x-toast) and put the following code in the HTML on the URL that is called:


      <a href="#" onclick="window.plugins.toast.show('testmelding','short','center');">test</a>


      Should I include the phonegap.js inside the URL or more? Or is this simply not possible?

        • 1. Re: wrap website in app
          Chris W. Griffith Adobe Community Professional

          That is not that correct path forward. There is another question that you need to look at with your client. Just wrapping a website in Cordova/PhoneGap will usually get rejected by Apple for approval into the App Store. It really needs to be an app, just adding Camera functionality to the site may not cut it. With that said, you will need to take the website and extend it with the code to access the Camera.



          • 2. Re: wrap website in app
            Opolo Webdesign Level 1

            I don’t completely understand your answer. Currently I’m hoping to get my situation working and figure out what to do with the appstore at a later stage in the project. Can you tell me if it is possible what I’m looking to do or not and if yes how?


            I would like to add that dominos pizza has a similar app in the Dutch Appstore that only loads a website, but also features push notifications. So maybe Apple has become more flexible?

            • 3. Re: wrap website in app
              Chris W. Griffith Adobe Community Professional

              The answer is basically no. The content within the InAppBrowser is sandboxed from the other web content/app. It can not directly interact with other plugins. I am not sure if the IAB supports the HTML 5 Camera functionality, I doubt it. You are taking the wrong approach to using Cordova. It is not about taking your web content and making an app, it is meant to let you use web technology to create an app.


              Apple has actually become tighter in their restrictions on what an 'app' is. Without knowing how the Domino's app was built, I would suspect that the app calls the CMS and renders the content within the app. Thus the app and web experiences and stay aligned.


              PS: Also, "figuring it out later" is going to cause a lot of heartache and frustration.

              • 4. Re: wrap website in app
                Opolo Webdesign Level 1

                Like I said I’m not using the IAB, I’m using the webview. No difference in that what using plugins concerns?