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

Conversation

Projects
None yet
2 participants
@janowsiany
Contributor

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.");

This comment has been minimized.

@benjamn

benjamn May 10, 2018

Member

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

@janowsiany

This comment has been minimized.

Contributor

janowsiany commented May 15, 2018

@benjamn Should i updated the docs, also?

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

@benjamn

This comment has been minimized.

Member

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

@benjamn benjamn merged commit b35aab6 into meteor:release-1.7 May 16, 2018

18 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci: Clean Up Your tests passed on CircleCI!
Details
ci/circleci: Docs Your tests passed on CircleCI!
Details
ci/circleci: Get Ready Your tests passed on CircleCI!
Details
ci/circleci: Isolated Tests Your tests passed on CircleCI!
Details
ci/circleci: Test Group 0 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 1 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 10 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 2 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 3 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 4 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 5 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 6 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 7 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 8 Your tests passed on CircleCI!
Details
ci/circleci: Test Group 9 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

benjamn added a commit that referenced this pull request May 16, 2018

@skirunman skirunman referenced this pull request Oct 12, 2018

Closed

Accessing settings in mobile-config.js #38

0 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment