Class: MotionPrime::BaseAppDelegate
Instance Attribute Summary
#window
Instance Method Summary
collapse
#open_screen
#application, #content_controller, #main_controller, #on_load
#user_signed_in?
Instance Method Details
#api_client ⇒ Object
29
30
31
|
# File 'motion-prime/delegate/app_delegate.rb', line 29
def api_client
@api_client ||= ApiClient.new(access_token: current_user.try(:access_token))
end
|
#current_user ⇒ Object
16
17
18
19
20
|
# File 'motion-prime/delegate/app_delegate.rb', line 16
def current_user
@current_user ||= if defined?(User) && User.respond_to?(:current)
User.current
end
end
|
#on_apn_register_fail(application, error) ⇒ Object
13
14
|
# File 'motion-prime/delegate/app_delegate.rb', line 13
def on_apn_register_fail(application, error)
end
|
#on_apn_register_success(application, token) ⇒ Object
10
11
|
# File 'motion-prime/delegate/app_delegate.rb', line 10
def on_apn_register_success(application, token)
end
|
#reset_current_user ⇒ Object
22
23
24
25
26
27
|
# File 'motion-prime/delegate/app_delegate.rb', line 22
def reset_current_user
user_was = @current_user
@current_user = nil
NSNotificationCenter.defaultCenter.postNotificationName(:on_current_user_reset, object: user_was)
api_client.access_token = current_user.try(:access_token)
end
|