Can Meteor-based-ios app access data from my own server? - meteor

I'm new to Meteor and made a very simple meteor-based ios app for personal use and interest, which read data from MongoDB provided by Meteor. I have a quick question and I just want to make sure that I am not spending time on meaningless work.
What I have done is "meteor run ios-device", and it works pretty well that under the same network (wifi) the app on ios could read data from the localhost:3000 on laptop (Mac). Also, I have learned that it is easy to deploy a meteor app on my own server, just run "meteor build /path/to/buildFile --architecture..." and move the bundle to the server to set up; however, then I got confused about this: after the app is deployed to a server, is it possible that the app on ios also able to access to that server?
In short words, app ios works fine with localhost, so is there a way to make it works fine with web hosting so that the app does not need to connect to the same network as the host?
Note that I didn't purchase Apple developer account that could release app to AppStore, so I can only use "real machine debugging". Will this disallow me to make app on ios access the data from my own server?
Thanks for any advance!
Update:
I have successfully deployed my project on my own OpenShift server so that I could access it within any networks in browsers. So my point is how do I build an ios app for this project so that I can also access it in iPhone within any network. I have tired run "meteor run ios-device --mobile-server=[my own openshift server]:8000", and when I build the app for deploying I ran this "meteor build ~/some/path --server=[my own openshift server]:8000". This seems does not works. Still waiting for advance!

You are describing one of the main use case of Meteor.
Refer to:
Meteor Guide > Mobile > Configuring your server
Meteor Guide > Mobile > Building for production
To summarize:
When building your Meteor project, if you have ios and/or android platform(s), Meteor will require you to specify the --server option with the URL of the server where your Meteor server bundle will be deployed.
That way, your app will know where to connect to.
Note that you may not need to go through Apple App Store, as long as you do not need to distribute your app. You can simply use the Xcode project (generated by meteor build) to install your app directly on your iPhone.

Related

Debug Firebase hosted Flutter Web app locally in Android Studio

I have a Flutter web application that is hosted in Firebase.
I'm using the setup described here to load the correct firebase configurations depending on the Firebase environment the application is running in.
My trouble is now I want to be able to debug this locally in my IDE.
I can run the application locally using firebase serve, which starts the webapp (e.g. on localhost:5000) and serves the correct firebase config based on the environment/alias I'm using, that's all nice and good.
My question is whether it is now possible to debug that running application in Android Studio? I know there are ways to do this in Visual Studio code, but I'd rather find a setup that works with AS if possible.
I could also debug the application by clicking the debug button in Android studio, and that will try to launch the application, however it will fail to start since it wont be served the firebase config file correctly (since this is firebase serve does for us).
Is there a way to combine the debugging capabilities of Android Studio with the firebase serve command to give a working application that's debuggable in my IDE?
Thanks in advance,
Gary

Hosting Meteor Application

I am building Meteor application which I want to later publish it on IOS and Android.
My questions are:
1) Is it possible to host my Meteor application on my own Ubuntu server?
2) Because Meteor server and client sides are bundled into one. How will the Mobile versions connect to the server?
Yes. Ubuntu, Debian, and other Linux distributions will work well too.
Over DDP (WebSockets) or XHR, if WebSockets fail to connect. It's the same as in browser, in fact Cordova (which is used in Meteor to build "native" app) is a wrapper around Safari in iOS and Chrome in Android, kind of full-screen/interface-less browser, with bindings to native Swift/Objective-C/Java.
Yes. You can host a Meteor app in all sorts of places including your own server. Galaxy and Digital Ocean are both popular cloud options.
When you build for iOS and/or Android you end up with apps that you can post to the App Store and Google Play. The server code is not bundled into these. Meteor's mobile guide describes how all this works in detail. The server address is configured via the ROOT_URL (docs). Essentially the client has the server's address configured into it so it knows where "home" is. This should obviously not be an IP address since that can change.

is there a way to build meteor mobile app from build.phonegap.com?

I am new to meteor. I developed mobile application from meteor. Now I wish to build that app from build.phonegap.com site. I feel build.phonegap is easy instead of meteor build
To put it short its not possible to build an app using the phonegap build service.
The reason for this is meteor build does not exclusively build the apk. meteor build also takes your project and builds it up into what would be the /www directory in your phonegap project.
Secondly Meteor doesn't use the original phonegap/cordova build. There is a modification to phonegap so the files in /www are served using an on-device HTTP server at http://meteor.local. This is one of the reasons its not available on WP8, Blackberry, etc. The local webserver sorts out some issues related to routing.
So you would need to use meteor build to build your app.

How do I run Meteor shell in Heroku?

I've deployed my Meteor app to Heroku using the https://github.com/jordansissel/heroku-buildpack-meteor buildpack. My Meteor is v1.0+.
How do I access a server console to my app? Normally on my local dev machine I would run $ meteor shell.
Similarly, how can I meteor reset?
Thanks
If you used the oortcloud meteor buildpack, or a fork of it, the build uses a production mode build of meteor. meteor shell is a development tool and not available for use in production mode.
This is a tradeoff. You could theoretically use use a development mode instance in production but you would have terrible performance. Meteor in development struggles to cope with > 10 users. In production mode the figure is much larger.
meteor reset on the other hand clears the database of the development mode database. To clear up your database log into your database using mongo and drop all the collections. Alternatively run use db.dropDatabase(); (in mongo)

How does Meteor Up work?

I recently created a droplet on Digital Ocean, and then just used Meteor Up to deploy my site to it.
As awesome as it was to not have to mess with all of the details, I'm feeling a little worried and out of the loop about what's happening with my server.
For example, I was using the console management that Digital Ocean provides, and I tried to use the meteor mongo command to investigate what was happening with my database. It just errored, with command not found: meteor.
I know my database works, since records are persistent across accesses, but it seems like Meteor Up accomplished this without retaining any of the testing and development interfaces I grew used to on my own machine.
What does it do??? And how can I get a closer look at things going on behind the scenes?
Meteor Up installs your application to the remote server, but does not install the global meteor command-line utilities.
For those, simply run curl https://install.meteor.com | /bin/sh.
MUP does a few things. Note that this MUP is currently under active development and some of this process will likely change soon. The new version will manage deployment via Docker, add support for meteor build options, and other cool stuff. Notes on the development version (mupx) can be found here: https://github.com/arunoda/meteor-up/tree/mupx.
mup setup installs (depending on your mup.json file) Node, PhantomJS, MongoDB, and stud (for SSL support). It also installs the shell script to setup your environment variables, as well as your upstart configuration file.
mup deploy runs meteor build on your local machine to package your meteor app as a bundled and zipped node app for deployment. It then copies the packaged app to the remote server, unbundles it, installs npm modules, and runs as a node app.
Note that meteor build packages your app in production mode rather than the debug mode that runs by default on localhost when you call meteor or meteor run. The next version of MUP will have a buildOptions property in mup.json that you can use to set the debug and mobileSettings options when you deploy.
Also, since your app is running directly via Node (rather than Meteor), meteor mongo won't work. Instead, you need to ssh into the remote server and call mongo appName.
From there, #SLaks is right about how it sets things up on the server (from https://github.com/arunoda/meteor-up#server-setup-details):
This is how Meteor Up will configure the server for you based on the given appName or using "meteor" as default appName. This information will help you customize the server for your needs.
your app lives at /opt/<appName>/app
mup uses upstart with a config file at /etc/init/<appName>.conf
you can start and stop the app with upstart: start <appName> and stop <appName>
logs are located at: /var/log/upstart/<appName>.log
MongoDB installed and bound to the local interface (cannot access from the outside)
the database is named <appName>

Resources