iOS Question In-App OwnedProducts

MarcoRome

Expert
Licensed User
Longtime User
Hi all.
There is the possibility to understand if the user has purchased the license from Apple store type like the code we use for Play Store:

B4X:
Sub manager_OwnedProducts (Success As Boolean, purchases As Map)
    Log(Success)
    If Success Then
        Log(purchases)
        For Each p As Purchase In purchases.Values
            Log(p.ProductId & ", Purchased? " & (p.PurchaseState = p.STATE_PURCHASED))
            If p.ProductId = "program_price" And p.PurchaseState = p.STATE_PURCHASED Then
                Starter.comprato = "1"
            End If
        Next
.....

Thank you
Marco
 
D

Deleted member 103

Guest
In the Sub PurchaseCompleted you save the purchase result in a logfile, at the next start you have to check that the logfile exists, if not, then you call the method "MyStore.RestoreTransactions".

Next problem is if the user has deleted the app, then there is no more logfile.

Dan would be better, except the logfile, also to have a database on the internet, with which you can check if the user has purchased the app.
But, where should I know the user if it is not possible to check the unique user id? :(

Here another strategy must be applied. :cool:
I do it this way: before the user uses the "in-app purchase", they must authenticate themselves with a Google account. So I have the user ID and can save it to my database.;)
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
What happens if the user switches iPhone and wants to install the app again? Is the ID the same?

I read:

identifierForVendor is an same UUID for all the apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

The best way i think that is this ( iOS 11 ) is the ---> DeviceCheck

So, What Is It?
The TL;DR is nothing more than this: It’s an Apple approved, and guaranteed way, to identify your app as running on a valid Apple device while maintaining absolute user privacy.

In this way also is delete, reinstall, etc is the same
For more information look:
https://codeburst.io/unique-identifier-for-the-ios-devices-590bb778290d
 
Upvote 0
Top