We need different code to run on iOS or Android.
One way to do this would be to have different code in the package run at the outset (before all of the code runs) in the package files.
Meteor.isCordova allows the determination of whether on Cordova or browser.
How is it possible to determine, within Cordova, whether on iOS or Android.
Here is some code that doesn't work because Platform.isIOS() is not (yet) defined at this stage:
if (Meteor.isCordova && Platform.isIOS()) {
Meteor.startup(function () {
console.log('Using plugin for iOS');
});
} else {
console.log('Using plugin for Android');
}
This is not the same question asked here: PhoneGap - Detect device type in phonegap because the point is to detect this earlier in the process of a Meteor build (and also not using PhoneGap itself). The answers provided there do not work in the current context.