diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h --- a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.h @@ -27,5 +27,15 @@ void setOnOpenCallback(std::function callback); void setOnCloseCallback(std::function callback); void assignSetReadyStateCallback(std::function callback); + + std::string sessionSignature(std::string deviceID); + std::string newSession( + std::string deviceID, + std::string publicKey, + std::string signature, + std::string notifyToken, + tunnelbroker::NewSessionRequest_DeviceTypes deviceType, + std::string deviceAppVersion, + std::string deviceOS); }; } // namespace comm diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp --- a/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/NetworkModule.cpp @@ -83,4 +83,32 @@ this->networkClient->assignSetReadyStateCallback(callback); } +std::string NetworkModule::sessionSignature(std::string deviceID) { + if (!this->networkClient) { + return std::string{}; + } + return this->networkClient->sessionSignature(deviceID); +} + +std::string NetworkModule::newSession( + std::string deviceID, + std::string publicKey, + std::string signature, + std::string notifyToken, + tunnelbroker::NewSessionRequest_DeviceTypes deviceType, + std::string deviceAppVersion, + std::string deviceOS) { + if (!this->networkClient) { + return std::string{}; + } + return this->networkClient->newSession( + deviceID, + publicKey, + signature, + notifyToken, + deviceType, + deviceAppVersion, + deviceOS); +} + } // namespace comm