Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding info.plist entries in Meteor?

How should an entry in the info.plist file be added in Meteor?

Is there a mobile-config setting or similar?

The Uber documentation has an example of why you would want to add an entry: https://developer.uber.com/docs/deep-linking

like image 932
Jamie Loberman Avatar asked Mar 13 '16 02:03

Jamie Loberman


2 Answers

I've not used Meteor, but you might be able to use the cordova-custom-config plugin to define custom config in project/cordova-build-override/config.xml (see Meteor Advanced Build Customization) and have it applied to the platform config at build time:

meteor add cordova:cordova-custom-config

config.xml:

<platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="LSApplicationQueriesSchemes">
        <array>
          <string>uber</string>
        </array>
    </config-file>
</platform>
like image 155
DaveAlden Avatar answered Oct 16 '22 09:10

DaveAlden


The answer by @davealden is not a correct answer for Meteor. Meteor uses mobile-config.jsfor mobile configurations. You should configure this file and avoid 3rd party workarounds as Meteor checks this file in making the build and using a 3rd party would lead inconsistency.

The mobile-config.js file is located in your Meteor project's root folder and might be as follows;

// This section sets up some basic app metadata, the entire section is optional.
App.info({
  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.
App.icons({
  'iphone_2x': 'icons/[email protected]',
  'iphone_3x': 'icons/[email protected]',
  // More screen sizes and platforms...
});

App.launchScreens({
  'iphone_2x': 'splash/Default@2x~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.
App.appendToConfig(`
  <universal-links>
    <host name="localhost:3000" />
  </universal-links>
`);

To modify Info.plist you can use App.appendToConfig object. For example to request access to device's Microphone you should add the following snippet in your mobile-config.js;

App.appendToConfig(`
  <edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>Need microphone access to enable voice dialogs</string>
  </edit-config>
`);

The official documentation provides comprehensive information.

like image 23
Gokhan Karadag Avatar answered Oct 16 '22 09:10

Gokhan Karadag