I have a Web App running using Meteor 1.4.4.1 on http://www.fixonclick.com using angular1.6 and angular material. I want to build a separate app for mobile platforms and even for the mobile web (progressive) using Angular2-Meteor and Ionic2.
I have almost created the angular2-meteor/ionic2 boilerplate which connects with my www.fixonclick.com server. It brings the data, updates and call methods using MeteorObserables.call and even uploads images like a charm. (Thanks to Urigo for fantastic Whatsapp tutorial)
I am only stuck with the Meteor.loginWithService, as these require Meteor.absoluteUrl and oAuth._redirectUri.
Following is the code snippet from meteor-client.js
if (Meteor.isServer && isCordova) {
// 29
var rootUrl = process.env.MOBILE_ROOT_URL || // 30
__meteor_runtime_config__.ROOT_URL; // 31
// 32
if (isAndroid) {
// 33
// Match the replace that we do in cordova boilerplate // 34
// (boilerplate-generator package). // 35
// XXX Maybe we should put this in a separate package or something // 36
// that is used here and by boilerplate-generator? Or maybe // 37
// `Meteor.absoluteUrl` should know how to do this? // 38
var url = Npm.require("url"); // 39
var parsedRootUrl = url.parse(rootUrl); // 40
if (parsedRootUrl.hostname === "localhost") {
// 41
parsedRootUrl.hostname = "10.0.2.2"; // 42
delete parsedRootUrl.host; // 43
} // 44
rootUrl = url.format(parsedRootUrl); // 45
} // 46
// 47
absoluteUrlOptions = _.extend({}, absoluteUrlOptions, { // 48
// For Cordova clients, redirect to the special Cordova root url // 49
// (likely a local IP in development mode). // 50
rootUrl: rootUrl // 51
}); // 52
} // 53
// 54
return URL._constructUrl( // 55
Meteor.absoluteUrl('_oauth/' + serviceName, absoluteUrlOptions), // 56
query, // 57
params); // 58
Error is comming on Meteor.absoluteUrl line 56.
though i did below to fix the issues, but error persists.
__meteor_runtime_config__ = {
"meteorEnv": {},
DDP_DEFAULT_CONNECTION_URL: "https://www.fixonclick.com",
ROOT_URL: 'https://www.fixonclick.com/',
MOBILE_ROOT_URL: 'https://www.fixonclick.com',
};