Hi,
I’m looking for solid iOS support for native iOS features such as notifications and in-app purchases. When I checked the repository with the “official” iOS plugin, it looked outdated to me. Is there any actively developed alternative?
Contribute to godot-sdk-integrations/godot-ios-plugins development by creating an account on GitHub.
Well, I see @Calinou was a contributor on that, so they might have an answer.
The godot-ios-plugins repository isn’t deprecated, but it lacks a maintainer.
However, I didn’t actively contribute code to it, just documentation changes.
See this issue:
opened 07:58PM - 03 Nov 23 UTC
enhancement
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:
- For consumable purchases, this is no problem
- For "permanent" purchases, this should mostly work. But if a malicious player buys and then quickly refunds your item, you would have no way of telling. There is no "event fired" in StoreKit 1. To detect refunds, you would need to [maintain your own server infrastructure](https://developer.apple.com/documentation/appstoreserverapi) that is constantly in contact with Apple's servers, and your app would have to contact your server to revoke the premium features. I guarantee this is out of scope for most Godot game developers.
- For "auto-renewing subscriptions", being able to read essential information like `expiry_date` involves maintaining your own server that can [decrypt the receipt data](https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/validating_receipts_with_the_app_store). If you want it to detect refunds, renewals, or cancellations, you need to implement the whole App Store Server Api on your server infrastructure. It's a mess.
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](https://telemetrydeck.com/blog/ios16-market-share-03-23/), 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.
There are a number of open pull requests awaiting review:
https://github.com/godot-sdk-integrations/godot-ios-plugins/pulls
If you have knowledge in Objective-C or Apple APIs, I suggest anyone to take a look at PRs and review them. You can also test the PRs locally and confirm they work (ideally on a physical device, but running the app on a Mac should work too). We often lack active reviewers on auxiliary Godot repositories, so any genuine effort helps.
4 Likes
I work primarily as an iOS developer, and I’d be happy to help with PRs and testing in my free time once I’ve finished my current game. My intended use of Godot is focused on mobile games, so I’m especially interested in improving mobile workflows, stability, and performance where possible.
3 Likes