2

Has anyone used Craft to manage content within a Cordova/PhoneGap app? How successful was it? What are the pitfalls?

We have an idea to create a website managed by Craft CMS. We then want to "wrap" the website in Cordova/PhoneGap so we can make it available as an App. Our immediate questions:

• Is it possible?

• Is the App immediately updated as a website would be or are there further steps?

• Are there any issues to look out for?

Many thanks for any advice.

Martin

2 Answers 2

4

Several people are using Craft to power apps.

Here's a good hangout: Craft Powered Apps, with Aaron Berkowitz discussing how PBS Kids uses Craft to power multiple apps, by making the data in Craft available to the apps available via a JSON API. I believe they use Cordova, which runs independently of Craft but grabs all the data for the app via the API.

Aaron also discusses how publishing content via Craft helps them get around some app-update requirements.

3

You can't actually use server side scripting within PhoneGap

Q: CAN YOU USE PHP/ASP/JSF/JAVA/.NET WITH PHONEGAP?

A: A PhoneGap application may only use HTML, CSS, and JavaScript. However, you can make use of network protocols (XmlHTTPRequest, Web Sockets, etc) to easily communicate with backend services written in any language. This allows your PhoneGap app to remotely access existing business processes while the device is connected to the Internet.

So in answer to wrapping a Craft CMS within Phonegap, I'd say it's not possible. However you can always use the ElementApi Plugin by P&T to create endpoints on your Craft website that exposes content.

Then you could just create a client in HTML/JS (VueJS/Angular/jQuery/Ember) to query these endpoints and show the content on your app.

This approach has a wealth of benefits as it means you only need to have one backend (Craft install) that could serve multiple Clients (PhoneGap apps) and when you update content on Craft it will cascade through your apps in realtime (minus any caching you may have)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.