Private Sub Application_Start (Nav As NavigationController)
Salat_Times.LocManager.Initialize("LocManager")
NavControl = Nav
App.RegisterUserNotifications(True, True, True) 'request permission for notifications
App.ApplicationIconBadgeNumber = 0
'check whether the app was started from a notification
If App.LaunchOptions.IsInitialized Then
Dim ln As Notification = App.LaunchOptions.Get("UIApplicationLaunchOptionsLocalNotificationKey")
If ln.IsInitialized Then
'did not work
'Dim no As NativeObject = ln - did not work
' no.SetField("soundName", "adhan0.mp3")
hd.ToastMessageShow("Application was started from a notification: " & ln.AlertBody, True)
End If
End If
ge.Initialize("ge")
Salat_Times.ShowSalat(False)
End Sub
Sub btnNotification (alarmTime As Long)
Dim ln As Notification
ln.Initialize(alarmTime) 'alarmTime seconds from now
Dim no As NativeObject = ln
no.SetField("soundName", "adhan0.mp3")
ln.IconBadgeNumber = 1
ln.AlertBody = "Adhan Alarm"
ln.PlaySound = True
ln.Register
Log("Notification will fire in " & alarmTime & " seconds.")
End Sub
Sub Application_ReceiveLocalNotification (LN As Notification)
'this event will fire if the scheduled notification happend when the app was running
hd.ToastMessageShow("Notification arrived: " & LN.AlertBody,True)
End Sub