Method: Urbanairship::Client#initialize

Defined in:
lib/urbanairship/client.rb

#initialize(key: required('key'), secret: nil, server: Urbanairship.configuration.server, token: nil, oauth: nil) ⇒ Object

Initialize the Client

Parameters:

  • key (Object) (defaults to: required('key'))

    Application Key

  • secret (Object) (defaults to: nil)

    Application Secret

  • server (String) (defaults to: Urbanairship.configuration.server)

    Airship server to use (“api.asnapieu.com” for EU or “api.asnapius.com” for US). Used only when the request is sent with a “path”, not an “url”.

  • token (String) (defaults to: nil)

    Application Auth Token

  • oauth (Object) (defaults to: nil)

    Oauth object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/urbanairship/client.rb', line 22

def initialize(key: required('key'), secret: nil, server: Urbanairship.configuration.server, token: nil, oauth: nil)
  @key = key
  @secret = secret
  @server = server
  @token = token
  @oauth = oauth

  if @oauth != nil && @token != nil
    raise ArgumentError.new("oauth and token can't both be used at the same time.")
  end
end