Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong callback code in IAPWrapper.mm (for iOS) and in ProtocolIAP.cpp (for Android) #168

Open
shkatulo opened this issue Sep 3, 2015 · 0 comments

Comments

@shkatulo
Copy link

shkatulo commented Sep 3, 2015

Current callback code in onPayResult:withRet:withMsg method is next:

...
if (iapPlugin) {
        iapPlugin->onPayResult(cRet, chMsg);
}else if(callback){
        std::string stdmsg(chMsg);
        callback(cRet,stdmsg);
} else {
        PluginUtilsIOS::outputLog("Can't find the C++ object of the IAP plugin");
}
...

So, if plugin was successfully instantiated callback(cRet,stdmsg); will be newer called.
I think, code should be equivalent to other plugins, where all works properly:

...
if (iapPlugin) {
        PayResultListener *listener = iapPlugin->getResultListener();
        if(listener) {
            iapPlugin->onPayResult(cRet, chMsg);
        }
        else if(callback) {
            std::string stdmsg(chMsg);
            callback(cRet,stdmsg);
        }
}
else {
        PluginUtilsIOS::outputLog("Can't find the C++ object of the IAP plugin");
}
...

The same problem on Android - in file ProtocolIAP.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant