/** * Called when the server has received the authorization key. */ void MainScreen::messageSent() { connectionEstablished(); // This is the first time the app is launched on Android phone. // Need to send the token. Also, store it to the store. if (isAndroid() && mToken) { storeRegistrationID(mToken); } }
/** * Called when the application is connected to the server. */ void MainScreen::connectionEstablished() { printf("MainScreen::connectionEstablished()"); // Update the UI. mSettingsScreen->connectionEstablished(); if (mToken) { // This is the first time the app is launched on Android phone. // Need to send the token. Also, store it to the store. if (isAndroid()) { storeRegistrationID(mToken); } // Finally send it over TCP to the server. mTCPConnection->sendData(*mToken); } }