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
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>
The answer by @davealden is not a correct answer for Meteor. Meteor uses mobile-config.js
for 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With