Sunday, November 6, 2022
HomeGame DevelopmentReplace to Billing Library 4(sdkbox) - Third-Occasion

Replace to Billing Library 4(sdkbox) – Third-Occasion


Hello @chuoihottieu, are you certain you haven’t modified the rest in your replace? Out of your logs it’s arduous to say what’s going on.

@bluewind00 Thanks for sharing, it’s a superb “base” for the long run enhancements. Please make it public once more :slight_smile:


@PCCSOARES
@kds

Thanks.
I make it public the repository once more.
Once more, this can be a pattern and isn’t assured to work.



2 Likes

hello @kds @bluewind00
i change sdkbox::IAP with mingos::IAP comply with the directions, it’s work perfert on system help native arm64-v8a, however crash on armeabi-v7a with out cause.
for instance Samsung Galaxy A13 5G: ABI help: armeabi-v7a, armeabi.
Anyhow thanks you guys atleast i upgraded to billing v4 earlier than 1.11.2022!

chuoihottieu
Simply change
PROP_APP_ABI=arm64-v8a
with
PROP_APP_ABI=armeabi-v7a:arm64-v8a
in ‘proj.androidgradle.properties’

bluewind00, thanks very a lot so much (you’re our hero); I’ve up to date your code a bit, to get amount of bought merchandise; it really works even on Android 4.4.2. (debug and launch)

…Now I’ll attempt to insert it into my venture (appears not really easy).

These are recordsdata that may be copied instantly into your venture.

C++:

Courses/widespread/JsonParser.cpp
Courses/widespread/JsonParser.h
Courses/dropbox/json11/json11.cpp
Courses/dropbox/json11/json11.hpp
Courses/iap/MingosIAP.h
Courses/platform/android/Java_iap_PurchaseEventListener.cpp
Courses/platform/android/MingosIAP.cpp

Java:

proj.android/app/src/iap/Product.java
proj.android/app/src/iap/PurchaseEventListener.java
proj.android/app/src/iap/PurchaseManager.java

Subsequent is a set of recordsdata that will battle together with your venture’s code.
Please incorporate the mandatory components of your venture.

proj.android/app/src/org/cocos2dx/cpp/AppActivity.java
proj.android/construct.gradle
proj.android/app/construct.gradle
proj.android/app/proguard-rules.professional



2 Likes

After two days of crashes and black screens, eventually appears I used you code. It was arduous (for me), as a result of:

  1. I used separate object (in my c++ code):

sdkbox::IAP::setListener(m_IAP_obj); // m_IAP_obj class extends : sdkbox::IAPListener

And you employ the principle class for the listener (object) :

class SampleScene : public cocos2d::Scene, public mingos::IAPEventListener { // your code
class HelloWorld : public cocos2d::Layer // my previous code

  1. Additionally there are tiny distinction in:

proj.androidappsrcorgcocos2dxcppAppActivity.java
:
public class AppActivity extends Cocos2dxActivity { // your code
public class AppActivity extends com.sdkbox.plugin.SDKBoxActivity { // my code

mPurchaseManager = new PurchaseManager(this); // is it attainable to alter this file to make use of as listener not AppActivity class (object), however one thing else?

Thanks on your nice job! :slight_smile: Because of you, possibly our Cocos video games shall be alive for some extra time.



1 Like

This can be a essential level, however with the intention to create your individual buy course of, you could depart the sdkbox.
This implies making use of the next code to AppActivity.

public class AppActivity extends Cocos2dxActivity { 

For those who apply my code as it’s under, you’ll not obtain the notification after the acquisition request with my code.
It is because SDKBoxActivity will obtain the results of the method from the shop.

public class AppActivity extends com.sdkbox.plugin.SDKBoxActivity 

In different phrases, leaving the code above isn’t an choice for us.

mPurchaseManager = new PurchaseManager(this); // is it attainable to alter this file to make use of as listener not AppActivity class (object), however one thing else?

Are you saying you need to reduce adjustments to AppActivity?
Then you are able to do that by making PurcahaseManager a singleton.
If the intent of this query is to maintain the next code as defined earlier, it is mindless.

public class AppActivity extends com.sdkbox.plugin.SDKBoxActivity 

I’ve modified PurcahseManager to singleton in my newest code.



1 Like

Hello @bluewind00 ,

Thanks on your nice job. You have got saved my venture :smiley:

For individuals who get mingos::IAP to work by putting in the sport from Android Studio, nevertheless it crashes in case you set up it from APK… DON’T FORGET TO ADD THESE LINES TO YOUR proguard-rules.professional:

-keep class iap.** { ; }
-dontwarn iap.
*

:person_facepalming:



1 Like

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments