RPG Maker MV unofficial Android client with In-app Purchase

@Eliaquim
I was wondering if you managed to have different SKUs and retrieve a different in game item with them?

I've been trying myself, but I am actually walking on the wire because I am not familiar with Java. I could locate the code in Android Studio, but finding the place to put and how to arrange it is a leap.

By the way, thank you @onlimono. The client makes it all al lot easier for non-coders.
@Cezar_cr
Hi there!
Well, I have not managed to do it yet =/
But I'm learning how to code every day, so I think this year I will be able to make it ^^
When I saw this passage on github, I didn't know what to do
"private static final String PRODUCT_ID = "SKU"; -> SKU needs to be modified with your product ID which can be set in Google Play Console."
Because I have multiple product IDs, how should I write them all?
Is there anyone who can help with this?
Is this method still valid, how should we use it?
Is there anyone who can help with this?
Is this method still valid, how should we use it?
Hi, it is still valid, but Google asks me to upgrade library version3. This method which uses library version2 can be valid until August for new apps and November for new updates.
Is this valid for RPG Maker MZ? Also are you gonna update to V3?
For those who wants to setup In-game shop with many items there is very easy solution:

First of all edit MainActivity.java and add all items you want to sell. In this example I will sell 7 game chapters.
Java:
private static final String PRODUCT_ID1 = "chapter_1";
private static final String PRODUCT_ID2 = "chapter_2";
private static final String PRODUCT_ID3 = "chapter_3";
private static final String PRODUCT_ID4 = "chapter_4";
private static final String PRODUCT_ID5 = "chapter_5";
private static final String PRODUCT_ID6 = "chapter_6";
private static final String PRODUCT_ID7 = "chapter_7";

Then in the same file you'll need to edit and add:
Java:
    @JavascriptInterface
    public void purchaseChapter1() {
        bp.purchase(this, PRODUCT_ID);
    }
    @JavascriptInterface
    public void purchaseChapter2() {
        bp.purchase(this, PRODUCT_ID2);
    }
    @JavascriptInterface
    public void purchaseChapter3() {
        bp.purchase(this, PRODUCT_ID3);
    }
    @JavascriptInterface
    public void purchaseChapter4() {
        bp.purchase(this, PRODUCT_ID4);
    }
    @JavascriptInterface
    public void purchaseChapter5() {
        bp.purchase(this, PRODUCT_ID5);
    }
    @JavascriptInterface
    public void purchaseChapter6() {
        bp.purchase(this, PRODUCT_ID6);
    }
    @JavascriptInterface
    public void purchaseChapter7() {
        bp.purchase(this, PRODUCT_ID7);
    }

    @JavascriptInterface
    public boolean purchasedChapter1() {
        return bp.isPurchased(PRODUCT_ID1);
    }
    @JavascriptInterface
    public boolean purchasedChapter2() {
        return bp.isPurchased(PRODUCT_ID2);
    }
    @JavascriptInterface
    public boolean purchasedChapter3() {
        return bp.isPurchased(PRODUCT_ID3);
    }
    @JavascriptInterface
    public boolean purchasedChapter4() {
        return bp.isPurchased(PRODUCT_ID4);
    }
    @JavascriptInterface
    public boolean purchasedChapter5() {
        return bp.isPurchased(PRODUCT_ID5);
    }
    @JavascriptInterface
    public boolean purchasedChapter6() {
        return bp.isPurchased(PRODUCT_ID6);
    }
    @JavascriptInterface
    public boolean purchasedChapter7() {
        return bp.isPurchased(PRODUCT_ID7);
    }

You can also delete lines on public void onProductPurchased and public void onBillingError:
Java:
       finish();
       startActivity(getIntent());

It prevents restarting the game after successful or not successful purchase.

Now, the next part is setting things up in RPG Maker.

Script calls for call item buy window:
JavaScript:
window.IAP.purchaseChapter1()
window.IAP.purchaseChapter2()
window.IAP.purchaseChapter3()
window.IAP.purchaseChapter4()
window.IAP.purchaseChapter5()
window.IAP.purchaseChapter6()
window.IAP.purchaseChapter7()

Script calls for check if item is purchased:
JavaScript:
window.IAP.purchasedChapter1()
window.IAP.purchasedChapter2()
window.IAP.purchasedChapter3()
window.IAP.purchasedChapter4()
window.IAP.purchasedChapter5()
window.IAP.purchasedChapter6()
window.IAP.purchasedChapter7()

Check will return boolean, so it's a good idea to store it in a switch for every chapter.



I hope this will help 🙂
@RATISOFT hey does this still work? i thought android had upgraded pay to 3.0 or something?
@RATISOFT hey does this still work? i thought android had upgraded pay to 3.0 or something?

Yep,

You can just add to build.gradle (module level) in dependencies {}:
Java:
   def billing_version = "4.0.0"
   implementation "com.android.billingclient:billing:$billing_version"
If they update version just edit def billing_version 🙂

I've just tested it on my project: https://play.google.com/store/apps/details?id=pl.ratisoft.gryedukacyjne & I will implement it soon on the english version too.
wow... gonna try it. Great Colors on ur game. Very Pro! 🙂
Hi! Do you give direct customer service (work for a dev) setting this thing up?

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mv-unofficial-android-client-with-in-app-purchase.105187/