It means, Initialize the revenuecat lib. in your project with your API Key and your products. Have a look at the example project it shows which code you need.
I have the following code but RevCatUserId is just an empty string. no GUID is created
B4X:
inAppPurchases.Initialize("inAppPurchase")
KeyValue.Initialize(xui.DefaultFolder,"AppSettings") 'For saving relevant subscription data
Dim RevCatUserId As String = KeyValue.GetDefault("RevCatUserId",RevCat.GUID) 'If no user guid is saved, then generate a new
KeyValue.Put("RevCatUserId",RevCatUserId)
Log(KeyValue.Get("RevCatUserId"))
RevCat.Initialize("appl_KbpGgJnwZasKxJOgOdgxxxxxxxxx",RevCatUserId,Array As String("Pro"))
CheckPurchases
I have updated the example project.
Please do the following:
Add this function:
B4X:
'Generates a new GUID
Public Sub GUID As String
Dim sb As StringBuilder
sb.Initialize
For Each stp As Int In Array(8, 4, 4, 4, 12)
If sb.Length > 0 Then sb.Append("-")
For n = 1 To stp
Dim c As Int = Rnd(0, 16)
If c < 10 Then c = c + 48 Else c = c + 55
sb.Append(Chr(c))
Next
Next
Return sb.ToString
End Sub
And this is the updated code:
B4X:
KeyValue.Initialize(xui.DefaultFolder,"AppSettings") 'For saving relevant subscription data
Dim RevCatUserId As String = KeyValue.GetDefault("RevCatUserId",GUID) 'If no user guid is saved, then generate a new
KeyValue.Put("RevCatUserId",RevCatUserId)
RevCat.Initialize("RevenueCatAPIKey",RevCatUserId,Array As String("all_access_1_year","all_access_1_month"))
CheckPurchases
Putting a log statement in sub GUID it is generating an id but RevCatUserId is still an empty string.
It's like it doesn't wait for the string to be returned
Okay thats seems to be working and connect to sdk has now cleared.
There is one new user showing in the revenue cat site.
Now just to figure out processing the subscription. I stuffed something as product not found LoL
With this view you can easily and with little effort list your premium features and make it easier for the customer to choose the right premium package. This library is not free, because, it cost a lot of time and gray hair to create such views. You can buy the view here...
I have created an app with bundle identifier com.myapp Now I added two In App Purchase items. Following are the product ids com.myapp.product1 com.myapp.product2 Now when I fetch list of produc...