Class: Fcmpush::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/fcmpush/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fcmpush/configuration.rb', line 5

def initialize
  @scope = ['https://www.googleapis.com/auth/firebase.messaging']

  # set file path
  @json_key_io = nil

  # Or Environment Variable
  # ENV['GOOGLE_ACCOUNT_TYPE'] = 'service_account'
  # ENV['GOOGLE_CLIENT_ID'] = '000000000000000000000'
  # ENV['GOOGLE_CLIENT_EMAIL'] = '[email protected]'
  # ENV['GOOGLE_PRIVATE_KEY'] = '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n'

  # regacy auth
  @server_key = ENV['FCM_SERVER_KEY']

  # THIS IS EXPERIMENTAL
  # NOT support `HTTPS_PROXY` environment variable. This feature not tested well on CI.
  # cf. https://github.com/miyataka/fcmpush/pull/39#issuecomment-1722533622
  # proxy
  @proxy = :ENV
end

Instance Attribute Details

#json_key_ioObject

Returns the value of attribute json_key_io.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def json_key_io
  @json_key_io
end

#proxyObject

Returns the value of attribute proxy.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def proxy
  @proxy
end

#scopeObject

Returns the value of attribute scope.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def scope
  @scope
end

#server_keyObject

Returns the value of attribute server_key.



3
4
5
# File 'lib/fcmpush/configuration.rb', line 3

def server_key
  @server_key
end