The reason im asking is that the sample projects that come with latest builds don’t seem to match with the guides apart from old legacy ones (store).
For instance Apple ones on the site seem to point to “plugin.apple.iap” but the sample project uses “store”.
The apple.iap plugin callback code in the guide doesn’t work and throws error as it receives userdata.
I have got purchases working, it does see products and it does purchase but it doesn’t restore.
I have one no consumable and if I buy it , it knows I have already bought it.
When using require(“store”) is used, no callback happens
when using require “plugin.apple.iap”, I get a callback and also the restored state but no product IDs.
I noticed a few years ago there was badger plugin but Im not sure of that status and seems odd that Solar provide this plugin already and have guides so maybe im just using it wrong.
OR has something happened with storekit 2 and iOS versions that have changed the way restore callback works?
Are the built in ones working as they should and are they supposed to be working with Native builds too? If standalone works but naive doesn’t then make im missing something in Xcode or maybe their listeners /delegates have changed recently?
Thanks
PS the sample project that comes with solar2d has store.init( “apple”, transactionCallback ) but neither the legacy store or apple,iap plugin guides say this .
Needless to say it’s well confusing what actually has to be done to make this happen especially when this used to be simple and just work.
Ive tried all sorts of versions today, different phones, different accounts but restore doesn’t pick. up any product ID
You’ve got kind of a rambling question, but I’ll hit a few points that I know the answers to.
Does IAP still works with iOS? Yes.
What’s up with the built-in Apple IAP vs. the new “plugin.apple.iap”? I honestly don’t know. I tried the plugin, didn’t like it, and went back to the built-in solution. That said, the old IAP doesn’t support a bunch of more recent developments in IAP functionality, but I don’t use them, so I don’t care.
What’s the deal with IAP Badger? It’s is a privately developed plugin that was taken over by the community when the original developer stepped back from supporting it. There’s an “official” version (which is to say that Prairiewest has a Git repository for it), and a lot of us have our own private versions that we’ve patched along the way.
As to why IAP isn’t working for you on iOS, I couldn’t tell you- setting up IAP has a lot of moving parts. All I can tell you is that local store = require ( "store" )
still works for me. I put out an update two days ago, and part of my pre-launch process is testing “restore” which worked fine.
Thanks for getting back to me. Yeah sorry about the rambling - I guess it reflects the documentation/guides/Sample projects fragmentation over the years,
Ive been using this with Native so I’ll try removing the apple.iap plugin and try the built in one and see what happens. If that doesn’t work, then I’ll try doing standalone build without Xcode and see if that works also. Im not sure if I need to include a library .a file in Xcode though as can only see the apple.iap one.
Thanks
I can confirm it is all working now.
The thing that completely threw me was the bit on Solar documentation for “store” :
" Notes
- This is the legacy version of the Apple store IAP, please use the new Apple IAP Plugin."
So I used the new one, also including the plugins in Xcode etc and it didn’t work for me.
After reverting back to the old version, and removing everything from the new one it works.
Thank you!