Android Question In-App Update Library - Returns version 0 (B4XPages)

djmainero

Member
Licensed User
Longtime User
Hello!
I was trying to implement In-App update published by @ArminKh1993 here https://www.b4x.com/android/forum/threads/in-app-update-library.126305/page-2#post-809707
Uploaded a new version to google play and left BridgeLogger true, when I debug the app the availableVersionCode is always 0 and never updates.
I can see on google play store the available update.

As the tutorial says i put in the main:
Main:
Sub InAppUpdate_onUserAcceptUpdate(accepted As Boolean)
        #IF JAVA
            public void _onactivityresult(int requestCode,int resultCode){
                com.khaan.iau.InAppUpdate.onActivityResult(activityBA,requestCode,resultCode);
            }
        #END IF
        
    CallSub2(B4XPages.MainPage,"InAppUpdate_onUserAcceptUpdate",accepted)
End Sub
And in the main page, B4XMainPage
B4XMainPage:
Private Sub CheckUpdate
    InAppUpdate.initialize(False)
    InAppUpdate.GetAppUpdateInfo
End Sub

Private Sub InAppUpdate_onAppUpdateInfoReceived(success As Boolean, inAppUpdateInfo As InAppUpdateInfo)
    Log($"InAppUpdate_onAppUpdateInfoReceived, Success: ${success}"$)
    If success Then
        If inAppUpdateInfo.updateAvailability = inAppUpdateInfo.UPDATE_AVAILABILITY_DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS Or inAppUpdateInfo.updateAvailability = inAppUpdateInfo.UPDATE_AVAILABILITY_AVAILABLE Then
            Log("Update")
            InAppUpdate.startImmediateUpdateFlow
        Else
            Log("Else")
            Log("Version: " & inAppUpdateInfo.availableVersionCode)
            Log("Inmediate? " & inAppUpdateInfo.isImmediateUpdateAllowed)
            Log("Availabity? " & inAppUpdateInfo.updateAvailability)
        End If
    End If
End Sub

And in B4XPage_Created I put the CheckUpdate call after loading the layout

Thanks in advance!
 
Top