Pass all push configs to settings

pull/425/head
Rodrigo Nascimento 11 years ago
parent 229ecb160d
commit d51a3abb83
  1. 11
      packages/rocketchat-lib/settings/server/startup.coffee
  2. 35
      server/lib/cordova.coffee

@ -30,3 +30,14 @@ Meteor.startup ->
RocketChat.settings.add 'Meta:robots', '', { type: 'string', group: 'Meta' }
RocketChat.settings.add 'Meta:google-site-verification', '', { type: 'string', group: 'Meta' }
RocketChat.settings.add 'Meta:msvalidate.01', '', { type: 'string', group: 'Meta' }
RocketChat.settings.addGroup 'Push'
RocketChat.settings.add 'Push_debug', false, { type: 'boolean', group: 'Push' }
RocketChat.settings.add 'Push_enable', false, { type: 'boolean', group: 'Push' }
RocketChat.settings.add 'Push_production', false, { type: 'boolean', group: 'Push' }
RocketChat.settings.add 'Push_apn_passphrase', '', { type: 'string', group: 'Push' }
RocketChat.settings.add 'Push_apn_key', '', { type: 'string', multiline: true, group: 'Push' }
RocketChat.settings.add 'Push_apn_cert', '', { type: 'string', multiline: true, group: 'Push' }
RocketChat.settings.add 'Push_apn_dev_passphrase', '', { type: 'string', group: 'Push' }
RocketChat.settings.add 'Push_apn_dev_key', '', { type: 'string', multiline: true, group: 'Push' }
RocketChat.settings.add 'Push_apn_dev_cert', '', { type: 'string', multiline: true, group: 'Push' }

@ -3,21 +3,22 @@ Meteor.methods
console.log.apply console, arguments
Meteor.startup ->
Push.debug = true
Push.Configure
apn:
passphrase: '***'
keyData: Assets.getText 'certs/PushRocketChatKey.pem'
certData: Assets.getText 'certs/PushRocketChatCert_development.pem'
gateway: 'gateway.sandbox.push.apple.com'
'apn-dev':
passphrase: '***'
keyData: Assets.getText 'certs/PushRocketChatKey.pem'
certData: Assets.getText 'certs/PushRocketChatCert_development.pem'
gateway: 'gateway.sandbox.push.apple.com'
production: false
badge: true
sound: true
alert: true
vibrate: true
Push.debug = RocketChat.settings.get 'Push_debug'
if RocketChat.settings.get('Push_enable') is true
Push.Configure
apn:
passphrase: RocketChat.settings.get 'Push_apn_passphrase'
keyData: RocketChat.settings.get 'Push_apn_key'
certData: RocketChat.settings.get 'Push_apn_cert'
'apn-dev':
passphrase: RocketChat.settings.get 'Push_apn_dev_passphrase'
keyData: RocketChat.settings.get 'Push_apn_dev_key'
certData: RocketChat.settings.get 'Push_apn_dev_cert'
gateway: 'gateway.sandbox.push.apple.com'
production: RocketChat.settings.get 'Push_production'
badge: true
sound: true
alert: true
vibrate: true

Loading…
Cancel
Save