bevy_ios_iap
Provides access to iOS native StoreKit2 Swift API from inside Bevy Apps. It uses Swift-Bridge to auto-generate the glue code and transport datatypes.

See also bevy_ios_gamecenter, bevy_ios_notifications, bevy_ios_alerts, bevy_ios_review & bevy_ios_impact
Features
- fetch products
- purchase products
- listen to changes in transaction states
- fetch list of all transactions (to restore old purchases of non-consumables)
Notes
- does not return locally un-signed/un-verified transactions
Todo
- support subscription product type
- remaining error handling in:
ios_iap_transactions_allandios_iap_products - allow access to signature for remote verification
- support offers
- support family sharing
- transaction revocation reason
Instructions
- Add to XCode: Add SPM (Swift Package Manager) dependency
- Add Rust dependency
- Setup Plugin
1. Add to XCode
-
Add
StoreKitframework:
-
Go to
File->Add Package Dependenciesand pastehttps://github.com/rustunit/bevy_ios_iap.gitinto the search bar on the top right:
-
Don't forget to configure your purchases like for any other iOS app, this guide will not focus on that, as it is the same no matter what engine you use. this guide focuses on setting things up in a bevy project.
Note:
The rust crate used must be exactly the same version as the Swift Package (for binary compatibility reasons).
I suggest using a specific version (like 0.2.0 in the screenshot) to make sure to always use binary matching versions!
2. Add Rust dependency
cargo add bevy_ios_iap
or
# always pin to the same exact version you also of the Swift package
= { = "=0.2.1" }
3. Setup Plugin
Initialize Bevy Plugin:
// request initialisation right on startup
app.add_plugins;
Process Response Events from iOS back to us in Rust:
License
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option. This means you can select the license you prefer.
Your contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.