Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Configuration GCM

ZeroC0D3 Team edited this page Jan 10, 2018 · 1 revision

Google Cloud Messaging (GCM) Configuration

Install Dependencies

  • Add library to Gemfile
gem 'push-core'
gem 'push-gcm'
  • Run bundle
bundle install

Initialize GCM config/initializers/push_core.rb

if ENV['google_app_name'].present? && !Push::ConfigurationGcm.exists?
  Push::ConfigurationGcm.create(
    app: ENV['google_app_name'], 
    connections: 2, 
    enabled: true,
    key: ENV['google_sever_key']
  )
end rescue nil

Push::MessageGcm.send :include, Push::AdditionalModel

Configuration config/application.yml

default: &default
  app_name: ''
  app_key: ''
  version: ''

  # -----------------------------------------
  #  Googlemail
  # -----------------------------------------
  gmail_username: ''
  gmail_password: ''

  http_proxy: 'http://127.0.0.1:55558'
  https_proxy: 'http://127.0.0.1:55558'

development:
  <<: *default
  google_sever_key: ''
  google_app_name: ''
  google_app_id: ''
  google_browser_key: ''
  app_key: ''

staging:
  <<: *default
  google_sever_key: ''
  google_app_name: ''
  google_app_id: ''
  google_browser_key: ''
  app_key: ''

production:
  <<: *default
  google_sever_key: ''
  google_app_name: ''
  google_app_id: ''
  google_browser_key: ''
  app_key: ''

Clone this wiki locally