65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'lib/commonAPI/coreapi/RhoApplicationApi.rb', line 65
def self.processApplicationEvent(params)
applicationEvent = params['applicationEvent']
eventData = params['eventData']
eventData = {} unless eventData
case applicationEvent
when 'Activated'
puts "AppEvent #{applicationEvent}"
when 'Deactivated'
puts "AppEvent #{applicationEvent}"
when 'UICreated'
start_url = Rho::Application.startURI
start_url = "" unless start_url
if System.get_property('platform') != 'WP8'
invalid_security_token_start_path = Rho::Application.invalidSecurityTokenStartPath
if Rho::Application.securityTokenNotPassed
if invalid_security_token_start_path && invalid_security_token_start_path.length() > 0
start_url = invalid_security_token_start_path
else
puts 'security_token is not passed - application will closed'
System.exit
end
end
end
puts "on_ui_created.navigate to start url: '#{start_url}'"
WebView.navigate(start_url)
when 'UIDestroyed'
puts "AppEvent #{applicationEvent}"
when 'SyncUserChanged'
Rhom::Rhom.database_full_reset(false, false)
when 'ConfigConflict'
puts "on_reinstall_config_update: #{eventData.conflicts}"
when 'DBMigrateSource'
puts "default on_migrate_source - do nothing; old_version :#{eventData.old_version}; new_src : #{eventData.new_src}"
return true
end
end
|