/Meteor 1.5

Mobile Configuration

Documentation of Meteor's Cordova configuration API.

If your Meteor application targets mobile platforms such as iOS or Android, you can configure your app’s metadata and build process in a special top-level file called mobile-config.js which is not included in your application and is used only for this configuration.

The code snippet below is an example mobile-config.js file. The rest of this section will explain the specific API commands in greater detail.

// This section sets up some basic app metadata, the entire section is optional.
  id: 'com.example.matt.uber',
  name: 'über',
  description: 'Get über power in one button click',
  author: 'Matt Development Group',
  email: '[email protected]',
  website: 'http://example.com'


// Set up resources such as icons and launch screens.
  'iphone_2x': 'icons/[email protected]',
  'iphone_3x': 'icons/[email protected]',
  // More screen sizes and platforms...


  'iphone_2x': 'splash/[email protected]~iphone.png',
  'iphone5': 'splash/Default~iphone5.png',
  // More screen sizes and platforms...


// Set PhoneGap/Cordova preferences.
App.setPreference('BackgroundColor', '0xff0000ff');
App.setPreference('HideKeyboardFormAccessoryBar', true);
App.setPreference('Orientation', 'default');
App.setPreference('Orientation', 'all', 'ios');

// Pass preferences for a particular PhoneGap/Cordova plugin.
App.configurePlugin('com.phonegap.plugins.facebookconnect', {
  APP_ID: '1234567890',
  API_KEY: 'supersecretapikey'


// Add custom tags for a particular PhoneGap/Cordova plugin to the end of the
// generated config.xml. 'Universal Links' is shown as an example here.

    <host name="localhost:3000" />



Set your mobile app's core configuration information.


id, version, name, description, author, email, website String

Each of the options correspond to a key in the app's core configuration as described in the Cordova documentation.

App.setPreference(name, value, [platform])

Add a preference for your build as described in the Cordova documentation.


name String

A preference name supported by Cordova's config.xml.

value String

The value for that preference.

platform String

Optional. A platform name (either ios or android) to add a platform-specific preference.

App.accessRule(pattern, [options])

Set a new access rule based on origin domain for your app. By default your application has a limited list of servers it can contact. Use this method to extend this list.

Default access rules:

  • tel:*, geo:*, mailto:*, sms:*, market:* are allowed and are handled by the system (e.g. opened in the phone app or an email client)
  • http://localhost:* is used to serve the app's assets from.
  • The domain or address of the Meteor server to connect to for DDP and hot code push of new versions.

Read more about domain patterns in Cordova docs.

Starting with Meteor 1.0.4 access rule for all domains and protocols (<access origin="*"/>) is no longer set by default due to certain kind of possible attacks.


pattern String

The pattern defining affected domains or URLs.


type String

Possible values:

  • 'intent': Controls which URLs the app is allowed to ask the system to open. (e.g. in the phone app or an email client).
  • 'navigation': Controls which URLs the WebView itself can be navigated to (can also needed for iframes).
  • 'network' or undefined: Controls which network requests (images, XHRs, etc) are allowed to be made.
launchExternal Boolean

(Deprecated, use type: 'intent' instead.)

For example this Cordova whitelist syntax:

<access origin="https://www.google-analytics.com" />
<allow-navigation href="https://example.com" />

is equivalent to:

App.accessRule('https://example.com', { type: 'navigation' });

App.configurePlugin(id, config)

Set the build-time configuration for a Cordova plugin.


id String

The identifier of the plugin you want to configure.

config Object

A set of key-value pairs which will be passed at build-time to configure the specified plugin.


Set the icons for your mobile app.


icons Object

An Object where the keys are different devices and screen sizes, and values are image paths relative to the project root directory.

Valid key values:

  • iphone_2x (120x120)
  • iphone_3x (180x180)
  • ipad (76x76)
  • ipad_2x (152x152)
  • ipad_pro (167x167)
  • ios_settings (29x29)
  • ios_settings_2x (58x58)
  • ios_settings_3x (87x87)
  • ios_spotlight (40x40)
  • ios_spotlight_2x (80x80)
  • ios_spotlight_3x (120x120)
  • ios_notification (20x20)
  • ios_notification_2x (40x40)
  • ios_notification_3x (60x60)
  • iphone_legacy (57x57)
  • iphone_legacy_2x (114x114)
  • ipad_spotlight_legacy (50x50)
  • ipad_spotlight_legacy_2x (100x100)
  • ipad_app_legacy (72x72)
  • ipad_app_legacy_2x (144x144)
  • android_mdpi (48x48)
  • android_hdpi (72x72)
  • android_xhdpi (96x96)
  • android_xxhdpi (144x144)
  • android_xxxhdpi (192x192)


Set the launch screen images for your mobile app.


launchScreens Object

A dictionary where keys are different devices, screen sizes, and orientations, and the values are image paths relative to the project root directory.

For Android, launch screen images should be special "Nine-patch" image files that specify how they should be stretched. See the Android docs.

Valid key values:

  • iphone_2x (640x960)
  • iphone5 (640x1136)
  • iphone6 (750x1334)
  • iphone6p_portrait (1242x2208)
  • iphone6p_landscape (2208x1242)
  • ipad_portrait (768x1024)
  • ipad_landscape (1024x768)
  • ipad_portrait_2x (1536x2048)
  • ipad_landscape_2x (2048x1536)
  • android_mdpi_portrait (320x480)
  • android_mdpi_landscape (480x320)
  • android_hdpi_portrait (480x800)
  • android_hdpi_landscape (800x480)
  • android_xhdpi_portrait (720x1280)
  • android_xhdpi_landscape (1280x720)
  • android_xxhdpi_portrait (960x1600)
  • android_xxhdpi_landscape (1600x960)
  • android_xxxhdpi_portrait (1280x1920)
  • android_xxxhdpi_landscape (1920x1280)


Append custom tags into config's widget element.



element String

The XML you want to include

© 2011–2017 Meteor Development Group, Inc.
Licensed under the MIT License.