Class: MotionPrime::BaseAppDelegate

Inherits:
Object
  • Object
show all
Includes:
DelegateBaseMixin, DelegateNavigationMixin, HasAuthorization
Defined in:
motion-prime/delegate/app_delegate.rb

Instance Attribute Summary

Attributes included from DelegateBaseMixin

#window

Instance Method Summary collapse

Methods included from DelegateNavigationMixin

#open_screen

Methods included from DelegateBaseMixin

#app_window, #application, #on_load

Methods included from HasAuthorization

#api_client, #user_signed_in?

Instance Method Details

#current_userObject



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_userObject



22
23
24
25
26
# 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)
end