Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Meteor settings inside mobile-config #9873

Merged
merged 2 commits into from May 16, 2018
Merged

Expose Meteor settings inside mobile-config #9873

merged 2 commits into from May 16, 2018

Conversation

janowsiany
Copy link
Contributor

@janowsiany janowsiany commented May 9, 2018

Hello,
this PR allows to access Meteor.settings inside mobile-config.js file which leads to better developer experience for Cordova i.e. credentials sharing.

there is a feature-request meteor/meteor-feature-requests#37

Example

App.configurePlugin('phonegap-plugin-push', {
  SENDER_ID: Settings.pushNotifications.fcm.projectNumber
});

What is still missing?
Documentation needs to be updated

try {
settings = JSON.parse(files.readFile(options.settingsFile, 'utf8'));
} catch (e) {
throw new Error("METEOR_SETTINGS are not valid JSON.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check if e instanceof SyntaxError here… or better yet, use the optimisticReadJsonOrNull function to cache the parsed JSON.

@janowsiany
Copy link
Contributor Author

@benjamn Should i updated the docs, also?

@benjamn benjamn added this to the Release 1.7 milestone May 16, 2018
@benjamn
Copy link
Contributor

benjamn commented May 16, 2018

Heads up: I'm going to merge this into release-1.7 so that it will be available in Meteor 1.7, with one small modification: I'm going to move the settings to App.settings (more like Meteor.settings) rather than having a separate Settings namespace.

@benjamn benjamn changed the base branch from devel to release-1.7 May 16, 2018 16:22
@benjamn benjamn merged commit b35aab6 into meteor:release-1.7 May 16, 2018
benjamn added a commit that referenced this pull request May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants