godot-sdk-integrations / godot-ios-plugins

MIT License
141 stars 54 forks source link

Update StoreKit integration to StoreKit 2 #57

Open PickleJesus123 opened 1 year ago

PickleJesus123 commented 1 year ago

There is a vulnerability with the way most Godot users are currently using this "inappstore" plugin.

Unlike the Android Billing plugin, there is no way to query_purchases() and find out what the user has purchased/subscribed to when the app starts up. This is due to the plugin using StoreKit 1. From what I've seen, it seems like most Godot game developers using this plugin have the following logic:

func check_events():
    while in_app_store.get_pending_event_count() > 0:
        var event = in_app_store.pop_pending_event()
        if event.type == "purchase":
            if event.result == "ok":
                // save a local variable somewhere that "purchased = true"

Some notes about this:

There is a solution to this however: upgrading the plugin to Apple's new StoreKit 2, which is designed to simplify this whole process. You would be able to simply query active purchases through the Transaction History methods - that's it! Here's a breakdown:

Transactions retrieved through StoreKit 2 include detailed information such as product identifiers, purchase dates, and expiration dates for subscriptions, all in a decoded and easy-to-use format. This information was previously only obtainable by decoding the opaque receipt file.

Developers can access the complete transaction history, which provides the context necessary for supporting features like restoring purchases or verifying the entitlements of a user at any point in time.

StoreKit 2 requires iOS 15+, but it is installed on 99%+ of iOS devices, so there are no compatibility concerns there. Creating a StoreKit 2 branch would make it a lot easier for your average solo developer or small studio to monetize their Godot games.

Calinou commented 1 year ago

The iOS plugins need to be updated for Godot 4 first before this can be tackled. We currently lack contributors available to do so.

dinopanagos commented 1 year ago

This has been lacking contributors and is pushing people away from Godot. Is there any way we can all chip in an just pay someone to take care of it. Been over 6 months with no updates or timeline. Godot is amazing and its just going to fade if independent devs cant monetize.

Calinou commented 1 year ago

Is there any way we can all chip in an just pay someone to take care of it.

While you are free to contact a developer and pay them to work on this (or organize your own crowdfunding campaign), we don't use a bounty system. This is something you will have to organize on your own, including finding that developer (likely the hardest part) and ensuring they do their work correctly. There's a lot of risk involved in this process by design.

djordjije commented 11 months ago

I am more than willing to work on the iOS plugins if I can successfully find some information on how to code them. Just give me some time.

dinopanagos commented 11 months ago

almost finished with it ! no worries :)

djrain commented 4 months ago

@dinopanagos hey, did you make any progress on this? If so, would you mind sharing the files?

RocketRonz commented 1 month ago

Almost a year since the OP and the InAppStore plugin is still using StoreKit 1, which Apple deprecated a few months back:

StoreKit 1 deprecation

Are there any plans in the dev pipeline to upgrade this plugin to StoreKit 2? The freemium model is the only realistic revenue stream on the App Store so in-app purchase support is vital for mobile developers.

hayderkharrufa commented 1 month ago

See: https://github.com/rktprof/godot-ios-extensions