Class: FirebaseCloudMessenger::AuthClient

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase_cloud_messenger/auth_client.rb

Constant Summary collapse

AUTH_SCOPE =
"https://www.googleapis.com/auth/firebase.messaging".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials_path = nil) ⇒ AuthClient

Returns a new instance of AuthClient.



9
10
11
12
13
14
15
# File 'lib/firebase_cloud_messenger/auth_client.rb', line 9

def initialize(credentials_path = nil)
  @credentials_path = credentials_path

  raise_credentials_not_supplied if !credentials_supplied?

  @authorizer = Google::Auth::ServiceAccountCredentials.make_creds(cred_args)
end

Instance Attribute Details

#credentials_pathObject (readonly)

Returns the value of attribute credentials_path.



5
6
7
# File 'lib/firebase_cloud_messenger/auth_client.rb', line 5

def credentials_path
  @credentials_path
end

Instance Method Details

#fetch_access_token_infoObject



17
18
19
# File 'lib/firebase_cloud_messenger/auth_client.rb', line 17

def fetch_access_token_info
  authorizer.fetch_access_token!
end