attach endpoint with userId and user access token

11 views
Skip to first unread message

hasan tir

unread,
Jul 30, 2018, 6:57:53 AM7/30/18
to Kaa project
hello
i am  trying to attach endpoint to user but i do not know  how to get userId and Access token and uses from them in attachUser() function.
i used from trustful verifier
Code I put:

#include <memory>
#include <iostream>
#include <kaa/Kaa.hpp>
#include <kaa/event/registration/IUserAttachCallback.hpp>
 
class SimpleUserAttachCallback : public kaa::IUserAttachCallback {
public: virtual void onAttachSuccess() { std::cout << "Endpoint is attached to a user" << std::endl; } virtual void onAttachFailed(kaa::UserAttachErrorCode errorCode, const std::string& reason) { std::cout << "Failed to attach endpoint to a user: error code " << errorCode << ", reason '" << reason << "'" << std::endl; } }; ... // Create an endpoint instance auto kaaClient = kaa::Kaa::newClient(); // Start an endpoint kaaClient->start(); // Try to attach an endpoint to a user kaaClient->attachUser("userExternalId", "userAccessToken", std::make_shared<SimpleUserAttachCallback>());


please help me
thank you
Reply all
Reply to author
Forward
0 new messages