|
@@ -9,6 +9,7 @@
|
|
|
|
|
|
#include "IAPPlatform.h"
|
|
|
#include "IAPDelegate.h"
|
|
|
+#include "cocos2d.h"
|
|
|
|
|
|
static iap::IAPUtils* mIAPUtils = nullptr;
|
|
|
iap::IAPUtils* iap::IAPUtils::getInstance() {
|
|
@@ -33,6 +34,12 @@ iap::IAPProductInfo iap::IAPUtils::getProductInfo(const std::string &productId)
|
|
|
}
|
|
|
|
|
|
void iap::IAPUtils::purchase(const std::string &productId) {
|
|
|
+ auto scene = Director::getInstance()->getRunningScene();
|
|
|
+ scene->scheduleOnce([=](float) {
|
|
|
+ if (_delegate != nullptr) {
|
|
|
+ _delegate->onProductPurchaseSuccess(productId);
|
|
|
+ }
|
|
|
+ }, 0.1, "SCH_SimPurchaseSuccess");
|
|
|
}
|
|
|
|
|
|
|