Qt Purchasing API 1.0 (Technology Preview) Released!

Published Wednesday April 2nd, 2014 | by

When the Qt 5.3 beta was announced, we mentioned the upcoming release of our Qt Purchasing API for Qt Enterprise and Qt Mobile users. We now have a technology preview ready for you to try, and we’re really excited to hear your feedback.

The technology preview is available as a source package from the Qt Account, and the documentation is available online. For the final release (which will be out around the same time as Qt 5.3.0), we will also make binary packages available.

What is it?
The Qt Purchasing API contains cross-platform APIs that can enable in-app purchases in your Qt application. There are C++ and QML APIs available, and it currently supports both consumable and unlockable in-app products. The backends that are currently in place is for Android and iOS, but we’d like to add more later, such as the Windows Store and the Mac OS X Store.

Note that there are no source or binary compatibility guarantees for this technology preview, as one of the objectives of releasing it is to get feedback on the APIs. We want to ensure that the APIs we release match the requirements of our users as much as possible, so it’s possible that they change based on the feedback we get.

How do I build it?
As mentioned, the technology preview is only released as a source package, so you will need to build it manually. Since this is a Qt module which needs to be installed into your Qt directory, it has a couple of requirements which are not requirements for building applications. For you convenience, I’ll go through each of the steps required for building the package in Qt Creator here.

  1. First you have to download and install a copy of the Qt 5.3.0 beta for your target platform, as the Qt Purchasing APIs depend on Qt 5.3.0. If you want to create an application that works on both iOS and Android, get the combined package for your Mac.
  2. Set this up, as instructed in the documentation: For iOS and for Android.
  3. Get the Qt Purchasing API source package, and unpack this in a location of your preference.
  4. Open Qt Creator.
  5. In Qt Creator, open the project “qtpurchasing.pro” in the directory where you unpacked the Qt Purchasing source package.
  6. Select the kits for which you want to use Qt Purchasing.
  7. In the Projects page, under Build Steps, open Details for Make. Add the word install in the line edit for Make arguments.
  8. On the same page, make sure you deselect the Shadow build option.
  9. If this is an Android kit, the PATH environment variable needs to contain the javac compiler executable. If it does not already, add it by editing the PATH variable under Build Environment. On Windows, for example, the directory could be something like C:\Program Files\Java\jdk1.7.0_15\bin.
  10. Build the project by selecting Build project “qtpurchasing” in the Build menu.
  11. added 2014-04-15: Due to a bug which was discovered too late, there’s an extra step required when building for Android on Windows: After the build has completed, you need to go into the library directory of the Qt installation you are using (e.g. c:\Qt\5.3.0beta\5.3\android-armv7\lib) and rename the file libQt5Purchasing.so.5.3.0 to libQt5Purchasing.so. If you do not do this, applications using the purchasing API will fail on startup.

If you get an error that says Error 1 (ignored) you can safely ignore it, as it says.

Once you have completed these steps, the Qt Purchasing API should be ready to use in the Qt version where you chose to install it. Note that you have to execute steps 7 through 10 for each of the kits in which you want to enable Qt Purchasing.

Qt Hangman Rebeefed
To demonstrate the new APIs, we’ve taken the Qt Hangman example and beefed it up a bit.

Qt Hangman running on an iPhone 5S and a Nexus 5.

Qt Hangman running on an iPhone 5S and a Nexus 5.

The example source code is provided in the Qt Purchasing package, so you can build it yourself and run it as you please. The game will work out of the box, but you will have to provide your own store listings for it if you want to enable the in-app purchases in your custom build. If you just want to check out how it looks, an updated version is also available in Google Play for Android and the iOS App Store.

Qt Hangman Store screenshot

The Qt Hangman Store provides different products for purchasing. Screenshot from Nexus 5.

The game’s UI has been revamped with vowel awards and a score, and a more sensible monetization model has been implemented where you can pay for either bundles of 100 vowels or to unlock infinite vowels.

Next steps
If you are using the Enterprise or Mobile edition of Qt, and are interested in including in-app products in your applications, please download the package and let us know what you think. We’re accepting feedback on Qt.Purchasing@digia.com. Don’t hesitate to contact us, either with suggestions on changes to the APIs or with bug reports!

update: Qt.Purchasing@digia.com should now be working properly. I apologize for the inconvenience.

Did you like this? Share it:

Posted in Android, iOS, Mobile

17 comments to Qt Purchasing API 1.0 (Technology Preview) Released!

Nicola says:

Hi,
i think that this is a good news, but i preferred to have the first most important features for mobile, such as the compass, drag & drop on ios etc..

AlterX says:

That’s a good news, but you are losing the real target: a well-worked mobile functionalities!!
Actually compass doesn’t work, some connectivity using 3g causing crashing of apps, no working camera recording or just camera functions…you have introduced gps module after a so long period…that’s not a good strategy

Scorp1us says:

Could we use purchasing to provide automatic licensing and payments for a desktop app? I think that would be a killer feature! I don’t see why this should be limited to app stores!

Eskil Abrahamsen Blomfeldt says:

There are many financial and legal details to be handled, so such an API requires a back-end. But there are more and more application stores for the desktop popping up as well. Adding support for some of them is definitely an option if they support in-app purchases and the interest is high.

Scorp1us says:

Well if there was a Qt cross-platform app store, then Digia would attract even more developers. Especially if you had a special license where you allowed apps in the Digia App store to be commercial licenses paid by the app-store fee collected by the Digia app store. And you would get an instant policing point: either apps are free or they are commercial.

refaQtor says:

I’d like to ‘second’ this comment. I’d like to see this solution for desktop as well. Even Ubuntu is providing an application purchasing system.

Either way. Keep up the great work!

lasconic says:

Qt.Purchasing@digia.com doesn’t work. Where should we send feedback?


Your message can't be delivered because delivery to this address is restricted.
Diagnostic information for administrators:
Qt.Purchasing@digia.com
#550 5.7.1 RESOLVER.RST.AuthRequired; authentication required

Eskil Abrahamsen Blomfeldt says:

Sorry about this. It is being addressed as we speak, and I will post here as soon as it has been fixed.

Eskil Abrahamsen Blomfeldt says:

This should now be working. Sorry for the inconvenience :)

I’ve went through the documentation and through the source code of the plugin. I really liked how the encapsulation was done, all the way to QML. I have also tried to make something similar for iOS and Samsung Apps and I managed to get some apps with in-app purchases on the AppStore. One such example would be: https://itunes.apple.com/app/id848523747 . But I really really like this solution more and will try to include it in my apps.

Is this considered to be ready for production? If not what’s the ETA for the final version? Are you considering making this available for other stores, such as Samsung Apps and Amazon AppStore ?

Eskil Abrahamsen Blomfeldt says:

The final version is scheduled to be released along with Qt 5.3, since the backends require functionality that was added in Qt 5.3. Since neither Qt 5.3 nor Qt Purchasing is done yet, I would not recommend going into production with it currently.

Also note that there is no source or binary compability guarantee for this tech preview, since we want to collect feedback and improve the APIs based on this. I expect there to be some changes before the final release.

Secondly, is there any work in progress for a monetization plugin for AdMob or maybe Inneractive ? I really could use something like that for my apps. I’ve included interstitial ads in my Android and iOS apps. Interstitial ads are quite easy to implement, but I would also want to include banner ads ( for which I have no idea how to do implement them … yet! Or maybe a Server API approach ). A Facebook integration plugin would also be nice.

Eskil Abrahamsen Blomfeldt says:

Cross-platform APIs for including advertising in your app is something we have been looking at, but I don’t have any information to share on the timeline of this at the moment, sorry.

Ionut Dediu says:

I plus 1000 on this. I also want a Qt/QML solution for ads, preferably AdMob and Inneractive. Actually the Inneractive old SDK, from Qt 4.8/Symbian days was quite easy to port to other platforms. I was able to modify the Inneractive source QML plugin to port it on Qt 4.8 on Android with Necessitas and also on Blackberry 10. But an out of the box solution that just works from Digia would really be nice and convenient.

@Ionut & @Adrian:
If you are looking for AdMob, Chartboost, Facebook or Flurry analytics plugins, you can have a look at V-Play Plugins: http://plugins.v-play.net

We will release them soon (in the next weeks) for Qt 5. Just sign up for the developer list and we’ll notifiy you when we launch them.

Cutie says:

Will the source be available from Gitorious?

Eskil Abrahamsen Blomfeldt says:

No, since this is part of the offering to Qt Enterprise and Qt Mobile customers, the source (and later binary packages) is available through the Qt Account.

https://login.qt.digia.com/login

Commenting closed.