No reply from SDK::IAP with no internet

Hello there.

I’m using SDKBox with IAP. I’ve noticed that whenever there’s no internet on the device, none of the callbacks is triggered. I’m currently implementing these:

void onInitialized(bool ok) override;
void onSuccess(sdkbox::Product const& p) override;
void onFailure(sdkbox::Product const& p, const std::string &msg) override;
void onCanceled(sdkbox::Product const& p) override;
void onRestored(sdkbox::Product const& p) override;
void onProductRequestSuccess(std::vector<sdkbox::Product> const &products) override;
void onProductRequestFailure(const std::string &msg) override;
void onRestoreComplete(bool ok, const std::string &msg) override;

I expected SDKBox to call onFailure if no internet is available on the device, but it looks like this is not the case.
Is this working as intended? How can I change this?

Thanks,

Davide

1 Like

it should be shown no internet connection message if internet is unavailable.

Hi!

I can’t see any message from SDKBox. Moreover, isn’t there a way to get notified if no internet connection is found?

Check internet connection by yourself with HttpRequest.

Thanks, I’ll try that.

On a side note, I noticed that I got this error from Google Play Console

java.lang.NullPointerException
	at com.sdkbox.plugin.util.iap.IabHelper.getAllPurchases(IabHelper.java:1126)
	at com.sdkbox.plugin.SDKBoxIAPGooglePlay.getPurchases(SDKBoxIAPGooglePlay.java:269)
	at com.sdkbox.plugin.SDKBoxIAPGooglePlay.restorePurchase(SDKBoxIAPGooglePlay.java:256)
	at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
	at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:128)
	at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:277)
	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

looks like a problem in SDKBOX iap API?

Thanks

which version of SDKBOX IAP are you using?

Hi nite

 _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2015 SDKBOX Inc. v1.0.0.13

This is was I get with sdkbox info command. how can I check the plugin versions?

Thanks

You can check the plugin version by running sdkbox info command under your project path

Hi nite!

Here’s the output

  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2015 SDKBOX Inc. v1.0.0.13
A newer version of SDKBOX is available, would you like to update v1.0.0.13 to v1.0.0.14?
Type [Y]es, [n]o or [q]uit 
n
 installed packages:
     v2.2.3.5 flurryanalytics
     v2.2.3.5 googleplayservices
     v2.2.3.5 iap