Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Try
bm.Initialize(Me, "Authenticate")
Dim res As String = bm.CanAuthenticate
If res = "SUCCESS" Then
btnAuth.Enabled = True
Else
btnAuth.Enabled = False
Label1.Text = "Can't authenticate: " & res
End If
Catch
MsgboxAsync(LastException,"Erro")
End Try
End Sub
Sub btnAuth_Click
Try
bm.Show("Please authenticate")
Wait For Authenticate_Complete (Success As Boolean, ErrorMessage As String)
Label1.text = $"Success: ${Success}
ErrorMessage: ${ErrorMessage}"$
Catch
MsgboxAsync(LastException,"Erro")
End Try
End Sub