title: Meteor Cordova App: how to run different code on iOS or Android
body: <p>We need different code to run on iOS or Android.</p>
  
  <p>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.</p>
  
  <p>Meteor.isCordova allows the determination of whether on Cordova or browser.</p>
  
  <p>How is it possible to determine, within Cordova, whether on iOS or Android.</p>
  
  <p>Here is some code that doesn't work because Platform.isIOS() is not (yet) defined at this stage:</p>
  
  <pre><code>if (Meteor.isCordova &amp;&amp; Platform.isIOS()) {
      Meteor.startup(function () {
          console.log('Using plugin for iOS');
      });
  } else {
          console.log('Using plugin for Android');
  }
  </code></pre>
  
  <p>This is not the same question asked here:
  <a href="https://stackoverflow.com/questions/11077853/phonegap-detect-device-type-in-phonegap">PhoneGap - Detect device type in phonegap</a>
  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.</p>