Home Game Development Update to Billing Library 4(sdkbox) – Third-Party

Update to Billing Library 4(sdkbox) – Third-Party

0
Update to Billing Library 4(sdkbox) – Third-Party

[ad_1]

Hi @chuoihottieu, are you certain you haven’t modified the rest in your replace? From your logs it’s exhausting to say what’s going on.

@bluewind00 Thanks for sharing, it’s a excellent “base” for the longer term enhancements. Please make it public once more :slight_smile:

@PCCSOARES
@kds

Thanks.
I make it public the repository once more.
Again, it is a pattern and isn’t assured to work.

2 Likes

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

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

bluewind00, thanks very a lot loads (you might be 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 challenge (appears not really easy).

These are information that may be copied instantly into your challenge.

C++:

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

Java:

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

Next is a set of information which will battle together with your challenge’s code.
Please incorporate the mandatory elements of your challenge.

proj.android/app/src/org/cocos2dx/cpp/AppExercise.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 exhausting (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 primary class for the listener (object) :

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

  1. Also there are tiny distinction in:

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

mPurchaseSupervisor = new PurchaseSupervisor(this); // is it potential to vary this file to make use of as listener not AppExercise class (object), however one thing else?

Thank you to your nice job! :slight_smile: Thanks to you, perhaps our Cocos video games will likely be alive for some extra time.

1 Like

This is an important level, however in an effort to create your individual buy course of, you need to depart the sdkbox.
This means making use of the next code to AppExercise.

public class AppExercise extends Cocos2dxActivity { 

If you apply my code as it’s beneath, you’ll not obtain the notification after the acquisition request with my code.
This is as a result of SDKBoxActivity will obtain the results of the method from the shop.

public class AppExercise extends com.sdkbox.plugin.SDKBoxActivity 

In different phrases, leaving the code above will not be an possibility for us.

mPurchaseSupervisor = new PurchaseSupervisor(this); // is it potential to vary this file to make use of as listener not AppExercise class (object), however one thing else?

Are you saying you need to reduce modifications to AppExercise?
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 unnecessary.

public class AppExercise extends com.sdkbox.plugin.SDKBoxActivity 

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

1 Like

Hi @bluewind00 ,

Thank you to your nice job. You have saved my challenge :smiley:

For those that get mingos::IAP to work by putting in the sport from Android Studio, however it crashes if you happen to 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

simply replace lately one among my video games to billing library 4, with this pattern and it’s working nice.
the one odd factor, is that generally I get these crashes:

Crashed: Thread: SIGSEGV  0x0000000000000000
#00 laptop 0x175f30  (std::__ndk1::__function::__func<Java_iap_PurchaseEventListener_onInitialized::$_1, std::__ndk1::allocator<Java_iap_PurchaseEventListener_onInitialized::$_1>, void ()>::operator()() [Java_iap_PurchaseEventListener.cpp:76])
#01 laptop 0x40ec34 (cocos2d::Scheduler::replace(float) [functional:1867])
#02 laptop 0x3f7d0c (cocos2d::Director::drawScene() [CCDirector.cpp:264])
#03 laptop 0x3fa14c (cocos2d::Director::mainLoop() [CCDirector.cpp:1392])

line 76 is:

listener->onInitialized(success);

undecided if we must always add a strive catch there for the case of the listener not being current anymore…
or perhaps its one thing else. any concepts?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here