Reputation: 791
Can a Meteor template be packaged up and deployed as a PhoneGap application?
Upvotes: 68
Views: 15449
Reputation: 2533
As of 0.9.2 version of meteor it is easy to use Phonegap: https://www.meteor.com/blog/2014/09/15/meteor-092-iOS-Android-mobile-apps-phonegap-cordova
Upvotes: 8
Reputation: 41965
There is also this package: https://github.com/awatson1978/cordova-phonegap
I havn't tried it personally, but it seems the right approach.
Update: In the devshop of august, phonegap support has been announced from the core team with cool demos and stuff.
To play around with it:
meteor update --release CORDOVA-PREVIEW@3
Getting started: https://meteor.hackpad.com/Getting-Started-With-Cordova-Z5n6zkVB1xq
Upvotes: 2
Reputation: 426
Here is live demo on phonegap + meteorjs + oauth2.
I created this app with meteor on google play.
https://play.google.com/store/apps/details?id=com.youiest.tapmatrix&hl=en
It's a private work so could not disclose source code.
Please feel free to ask questions on it.
There are multiple ways I tried to work with meteor + phonegap.
Thanks.
Upvotes: 2
Reputation: 49
Here is simple steps to port Meteor app in mobile device using PhoneGap Meteor on Mobile Device using PhoneGap
Just change your stream_clientbf90.js
to port to your domain.it works.
Upvotes: 4
Reputation: 2480
Yes, this is possible, but not by packaging the meteor app on the phone. You have to point phonegap to your meteor server instead (you will still be able to use the API for accessing functionality on the device). Here are the instructions:
That's it. Compile and run the app.
A couple of time savers:
Upvotes: 39
Reputation: 1804
Well, I guess the best starting point is figuring out how far you want/need to go.
Would you want
A Meteor.js PhoneGap app that connects to a server somewhere? Then you´d probably want to use the Meteor classes in a PhoneGap project and connect to your server with Meteor.connect(url).
Offline App data persistence - That´s gonna get tough... That´s not
something Meteor was designed to do, although there surely are ways
to achive it. I remember that discussions from backbone, spine and
other client side JS frameworks. It´s easy to use local storage, but
the real effort there begins when you want to sync data between local
and the server.
That should help to get to the point...
Upvotes: 7
Reputation: 7659
I have done in crude way to some extent and here the process I followed:
meteor bundle ../todos.tgz
u.protoype._start = function(a, d, e, f){
d = d.replace("file://localhost","http://localhost:3000");
...
}
After this open the app.html file in browser and make sure the server is already running. This way you would most of the application working.
However this is not how would you like to use it in your real application but with more changes it is possible to use the client side in Phonegap with server running somewhere else.
Meteor has a method connect to connect to a different meteor application which might resolve the above url replace call, although I have not tried that yet.
Upvotes: 4