How to get TapPoints of User

186 Views Asked by At

I am using marmalade extension for TapJoy and using the SDK and sample project from here.
The function used here for getting TapPoints of user is:

 s3eResult TapjoyGetTapPoints(TapjoyGetTapPointsCallbackFn callbackFn, void* userData)

Which returns s3eResult type showing just success or failure of the query. But how do I get the actual points in int or any other number type?
What I am using is like this:

int TapJoy::GetPoints(){
s3eResult res=TapjoyGetTapPoints((TapjoyGetTapPointsCallbackFn)&TapJoy::GetTapPointsCB, NULL);
return GetTapPointsCB(NULL,NULL);
}
int32 TapJoy::GetTapPointsCB(TapjoyGetTapPointsResult* result, void* userData)
{
int tapPoints = result->m_PointTotal;

sprintf("Points", "`x666666Tap Points: %d", tapPoints);

s3eDebugTracePrintf("GetTapPointsCB called with amount: %d", tapPoints);
cout<<tapPoints<<endl;

return tapPoints;
}

The problem in this code is how do I get TapjoyGetTapPointsResult* result?

1

There are 1 best solutions below

0
On BEST ANSWER

So finally I got this one right. TapjoyGetTapPointsResult* result is the struct which is sent by the Tapjoy once the request is finished and calls the callback function. So the TapPoints I can get using

result->m_PointTotal;

Leaving the question and answer, so that it can help other users in future.