We’ve just pushed JUCE in-app purchase support for Android and iOS on the develop branch.
This enables your app to use in-app purchases from the Apple and Google Play store.
You can find the API documentation for In-App purchases in the In-App purchase juce header for now. You’ll also find some sample code for a fun in-app purchase app here. Be careful, the in-app purchases in the sample app will really charge your credit card.
The API is still preliminary and is likely to change. If you want to give it a spin, then clone the develop branch from github as usual or download the latest develop branch from here:
In order to get Ableton Link in your iOS App you need a specific license (see http://ableton.github.io/linkkit/), so I don’t see how JUCE could provide it.
Seeing that your demo app “will really charge your credit card,” is there no sandboxing available? How else can we get this type of thing properly straightened out during production before hitting the public?
The sandboxes require white listing of test accounts. If the accounts are not whitelisted then the in-app purchase dialog won’t even open on Android. Obviously, white-listing every user who wants to test IAP would not be feasible, so we decided not to use the sandbox for the demo - so that the IAP purchase dialog will at least open. Obviously, you really shouldn’t go through with the purchase as it will charge your credit card.
Obviously, the JUCE team now has the enormous task of figuring out what to do with the money of fat-fingered IAP purchases . Here are some of our ideas:
Pay a London street poet to do a mash-up poem of the most popular forum posts and post it here
Buy a JUCE advert at the super bowl 2018
Pay a colour designer to add Colours::jetblack to the list of juce colours
I pulled the latest JUCE-develop branch, and ran the InAppPurchase demo on an iPhone 7 running iOS 11.0.2. When I run the app, after being prompted to sign in to the iTunes Store and entering my password, I receive a system dialog saying:
There’s no information available for In-App Purchases. Try again later.
21105
[Environment:Sandbox]
I then get an additional system dialog warning me that my credit card will be charged. None of the purchase items are available and they are unable to fetch their prices.
Hi @jdowning, sadly a recent update to the in-app purchases of the in-app purchase demo app was rejected by Apple as they do not allow in-app purchases for demo code - so all the in-app purchases are disabled atm. I’m trying to argue with apple that there is benefit in allowing in-app purchases for this demo app but I wouldn’t get my hopes high.
However, if you use your own app bundle id and purchase ids then the JUCE in-app purchase code will work. Also, the in-app purchase demo app does run on Android.
@leehu thanks for confirming. Its weird that we only crash on two different devices that have IAP. If we comment out that line nsStringToJuce (skProduct.priceLocale.languageCode) then it doesn’t crash but that obviously isnt the fix.