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