I've created the following resumable sub and made a bit of a mess of it and can't see what's wrong
The page calls the login page at Microsoft via the Graph Rest API but then I get the following error:
java.lang.ClassCastException: anywheresoftware.b4a.keywords.Common$ResumableSubWrapper cannot be cast to java.lang.String
:
The page calls the login page at Microsoft via the Graph Rest API but then I get the following error:
java.lang.ClassCastException: anywheresoftware.b4a.keywords.Common$ResumableSubWrapper cannot be cast to java.lang.String
:
B4X:
Sub Login As ResumableSub
Dim WebView1 As WebView
WebView1.Initialize("WebView1")
Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
WebView1.LoadUrl("https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=XXXXXXXX-XXXX-XXXX-bde1-234b27c47ec8&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient&scope=user.read")
wait for WebView1_PageFinished (Url As String)
If Url.Contains("https://login.microsoftonline.com/common/oauth2/nativeclient") Then
Dim authCode As String
Dim urlParts() As String
urlParts = Regex.Split("https://login.microsoftonline.com/common/oauth2/nativeclient&code=&code=", Url)
If urlParts.Length > 1 Then
authCode = urlParts(1)
Log(authCode)
GetToken(authCode)
Else
Log("No Token Passed")
End If
End If
End Sub