Closed cramrov closed 6 years ago
Hi,
Does the online demo work on your iOS and/or Android devices? https://runisland.github.io/meteor-ionic4/blaze-flowrouter/ (I have not updated it in a while, but it should already give some idea)
Does a normal Meteor+Blaze (without Ionic4) project work fine when you access it from your mobile devices?
FYI, I updated the online demos to version 4.0.0-beta.3
Hi @ghybs, The online demo works well on mobile, and any other Meteor+Blaze (without ionic4) works well either. I've followed the insructions here in order to reproduce the demo locally: https://github.com/runisland/meteor-ionic4/tree/master/examples/blaze-flowrouter
Finally, I've updated the ionic4 package and still not working.
Thank you for helping me.
Regards, /marc
Hi,
Ok I see what is happening.
Ionic4 assets are retrieved using Meteor.absoluteUrl
, so that they are not affected by subpaths or prefix.
However, during development, Meteor sets ROOT_URL
by default to http://localhost:3000
.
But when you try accessing your development server from another machine (typically from a mobile device), you connect to that localhost server typing the IP of your dev machine (e.g. http://192.168.1.10:3000
), instead of http://localhost:3000
.
Therefore Meteor.absoluteUrl
now gives an URL that cannot be accessed by the remote machine.
So Ionic4 assets cannot be loaded in the device browser, and the app screen remains blank.
I think there are 2 good news then:
ROOT_URL
might be different from how you actually connect to the Meteor dev server. There should be no issue at all after build and deployment.ROOT_URL
environment variable even during development, if you want to be able to test it on another machine that cannot access localhost
. For example on Linux and macOS:
$ ROOT_URL="http://<ip-address>:<port>" meteor run
@ghybs , thank you for the discovery, the workaround works fine, I close the issue.
Hi,
I'm running the Blaze demo on localhost, and when I open Safari or Chrome on my iOS or Android device pointing to the localhost IP of my LAN, I see a blank page. The demo runs OK on desktop.
Whats wrong?
Thank you! /marc