Private Sub Application_Start (Nav As NavigationController)
Dim pg As Page
pg.Initialize("")
pg.RootPanel.LoadLayout("loading")
NavControl = Nav
NavControl.ShowPage(pg)
NavControl.NavigationBarVisible = False
Do While InternetConnection = False
Dim job As HttpJob
job.Initialize("", Me) 'note that the name parameter is no longer needed.
job.Download("https://www.google.com")
Wait For JobDone(job As HttpJob)
If job.Success Then
InternetConnection=True
End If
job.Release
If InternetConnection = False Then
sp.toastMessage("Internet Connection is Required")
Sleep(3000)
End If
Loop
sp.kvs.Initialize(File.DirDocuments,"tmpfiles")
Dim nativeObjectNotificationCenter As NativeObject
Try
firebaseAnalyticsInstance.Initialize
App.RegisterForRemoteNotifications
firebaseMessagingInstance.Initialize ("firebaseMessagingInstance")
App.RegisterUserNotifications (True, True, True)
nativeObjectNotificationCenter = nativeObjectNotificationCenter.Initialize ("UNUserNotificationCenter").RunMethod ("currentNotificationCenter", Null)
nativeObjectNotificationCenter.SetField ("delegate", Me)
firebaseMessagingInstance.FCMConnect
Do While sp.fbToken = ""
'Log("waiting...")
Sleep (200)
sp.fbToken = GetToken
Loop
login.Show
Try
LocManager.Initialize("LocManager")
Catch
Log(LastException)
End Try
Catch
Log(LastException)
End Try
End Sub
Private Sub firebaseMessagingInstance_FCMConnected
Try
firebaseMessagingInstance.SubscribeToTopic ("ios_general")
sp.fbToken = ""
Do While sp.fbToken = ""
Sleep (500)
sp.fbToken = GetToken
Loop
Catch
Log (LastException)
End Try
End Sub