void UACJSDelegate::onLoggedIn(const string &token) { JSCallback* call = JSCallback::alloc(mObject, "onLoggedIn", 1); call->setArgumentString(0, token); CallbackManager::getInstance()->postCallback(call); call->release(); }
void IAPJSDelegate::onPaymentResult(PaymentResult result, int product, string message) { JSCallback *callback = JSCallback::alloc(mFunc, 3, mObject); callback->setArgumentInt(0, result); callback->setArgumentInt(1, product); callback->setArgumentString(2, message); CallbackManager::getInstance()->postCallback(callback); callback->release(); }
void recvCallback(string &data, TCPState state, void* userData) { TCPFD* pfd = (TCPFD*)userData; //CCLog("PTR(%d) CALL = %p", pfd->fd, pfd);//debug //recv callback JSCallback* call = JSCallback::alloc(pfd->func, 3, pfd->obj); call->setArgumentInt(0, pfd->fd); call->setArgumentString(1, data); call->setArgumentInt(2, state); CallbackManager::getInstance()->postCallback(call); //call->setDebugTag(data.c_str());//test call->release(); }