IAP Manager - Easier In App Purchases for Google Play and Apple App Store

If you are planning to add IAPs to your game have a look at this module as an option to use if your needs are simple / use it as a supplement to existing examples and documentation on IAP.

There are no docs right now, just look at the example/source to see how it works. The main thing about it is if you use the same product ids for Google Play and Apple App Store it should just work.

This only has support for Google Play and Amazon App Store, but everything else could be added. Pull requests welcome!

8 Likes

Hello, i’ve some problem with this example.
I tried to bundle it for Android (with no changes) and it failed with following error:

/extension-iap/src/iap_android.cpp
    	Line 310: too few arguments to function call, expected 5, have 3
            dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
            ~~~~~~~~~~~~~~~~~~~                      ^
    	Line 310: 'JsonToLua' declared here
        int JsonToLua(lua_State* L, dmJson::Document* doc, int index, char* error_str_out, size_t error_str_size);
        ^
    	Line 346: too few arguments to function call, expected 5, have 3
                dmScript::JsonToLua(L, json, strlen(json)); // throws lua error if it fails
                ~~~~~~~~~~~~~~~~~~~                      ^
    	Line 346: 'JsonToLua' declared here
        int JsonToLua(lua_State* L, dmJson::Document* doc, int index, char* error_str_out, size_t error_str_size);
        ^
    warning: [options] bootstrap class path not set in conjunction with -source 8
	Note: /tmp/job3777207153139679010/upload/extension-iap/src/java/com/defold/iap/IapGooglePlay.java uses unchecked or unsafe operations.
	Note: Recompile with -Xlint:unchecked for details.
	For the full log, see /home/admin/iap_manager-master/build/armv7-android/log.txt

I also tried to implement extension_iap library to my game project and it gave to me the same error message while bundling. Don’t you know, what’s wrong?
Thank you (-:

@kovarskic if you are using the one of the more recent versions of extension-iap (Releases · defold/extension-iap · GitHub) they only work with Defold 1.4.0 and above. Which version of Defold and extension-iap are you using?

…yes, it was the problem. I updated from 1.3.6 and now it works nicely.

2 Likes