mardi 30 octobre 2018

How to load new pages generated server-side into a PhoneGap or Cordova app?

I'm trying to figure out the easiest and quickest technique to adapt our company's website to an app that can be downloaded from the app stores. PhoneGap/Cordova looks the way to go. Using the InAppBrowser plugin looks like an obvious route but we're going to need access to some phone APIs via Cordova plugins and there seems no way to access data from them in the InAppBrowser (Webview?) window.

As an alternative I'm wondering why can't I simply replace the HTML content directly in my PhoneGap page (effectively a single page app) with new HTML page content loaded from our server? We're using Laravel templates server-side, so there is already a page wrapper into which Laravel injects page-specific content (on the server) before sending to the client. I could just move the page wrapper HTML to the front end (into the SPA compiled into my PhoneGap app) complete with all the JS and CSS needed across all pages, and then just live load new page content into the DOM (e.g. in the page BODY), and any JS would have access to phone APIs via Cordova plugins.

Is this feasible, or am I missing something? (any gotchas?)

Thanks.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2qlIycZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire