createUser issue in cocos2d-x

0 votes

Hello, I try to test createUser with the latest cocos2d-x api (1.7.1). But compiler gives an error as:

"Reference to non-static member function must be called".

What is the mistake? Thanks.

My header:

class HelloWorld : public cocos2d::Layer, public App42CallBack

{

public:

    void testUserService();

 

    // a selector callback

    void onUserRequestCompleted(void *response);

};

#endif // __HELLOWORLD_SCENE_H__

 

My Implementation:

 

void HelloWorld::testUserService()

{

    std::string userName = "Enter_your_user_name";

    std::string password = "Password";

    std::string emailId = "Email_Id";

 

    App42API::Initialize(APP_Key, SECRET_Key);

    UserService *userService = App42API::BuildUserService();

    

    userService->CreateUser(userName, password, emailId, app42CallBack(HelloWorld::onUserRequestCompleted));

}

 

void HelloWorld::onUserRequestCompleted(void *response)

{

    App42UserResponse *userResponse = (App42UserResponse*)response;

. . .

}

closed with the note: I found an example at: https://github.com/RajeevRShephertz/App42Cocos2dXSampple/tree/master/Tests
asked Oct 26, 2014 in App42 Cloud API-BaaS by ttasdelen (16 points)
closed Oct 30, 2014 by ttasdelen

1 Answer

0 votes

Hello,

Could you please share in which Platform and OS version you are working on? It will help us to provide better support for you. Also, please have a look at this link, it has the sample project from which you can take reference. 

Thanks,

Himanshu Sharma

answered Oct 27, 2014 by hs00105 (2,005 points)
I'm developing with cocos2d-x.3.2 for both iOS and Android. The link you gave is not working for the newest version of the app42 api. I guess callback mechanism have been changed. I cannot apply callback in the createUser method.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...