15 Live Experience
Add Live Experience to Your Apps
Live Experience allows you to design secure digital customer engagements and include them in your apps. You can add video, audio, or screen share, as well as screen spotlighting and annotation during video and screen sharing sessions. These features enable communication with your customer service reps, repair techs, or anyone you’d like to have live interactions with.
Prerequisites
Before you configure Live Experience in your environment, ask your Live Experience system administrator for the Live Experience endpoint, client ID, and client secret. The system administrator obtained the client ID and secret when the account was configured.
Configure Live Experience
You must configure Live Experience before you can enable backends to use it.
-
In the Mobile Hub UI, click Settings > Credentials > Live Experience.
-
Provide the Live Experience endpoint, client ID, and client secret that you obtained from your Live Experience system administrator.
Enable a Backend to Use Live Experience
To enable Live Experience for a backend:
-
Go to Development > Backends and open the backend.
-
Click Settings.
-
Switch Live Experience on.
Configure Your App to Connect It to Live Experience
-
After your app authenticates with the backend, set
AMCE_AUTH_TOKEN
andBASE_URL
. -
Use the Live Experience Integration REST API to get an access token for starting a Live Experience session:
Android
// Gets the Live Experience Access Token private void loginLiveExperience() { HttpURLConnection urlConnection = null; try { URL url = new URL("https://pmmobiledemo1-bots4saas.mobile.ocp.oraclecloud.com/mobile/platform/lx/token?client_type=LIVE_EXPERIENCE"); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setDoOutput(true); mobileBackend = MobileManager.getManager().getMobileBackend(mCtx); urlConnection.setRequestProperty ("oracle-mobile-backend-id", mobileBackend.getConfig().getParser().getString("mobileBackendId")); urlConnection.setRequestProperty ("Authorization", mobileBackend.getAuthorization().getAccessToken()); int status = urlConnection.getResponseCode(); InputStream in = new BufferedInputStream(urlConnection.getInputStream()); String response = readStream(in); JSONObject jObj = new JSONObject(response); String access_token = jObj.getString("access_token"); Log.i("Access token: ", access_token); SharedPreferences prefs = getSharedPreferences(Constants.LOG_TAG, Context.MODE_PRIVATE); prefs.edit().putString(getString(R.string.access_token_live_experience), access_token).apply(); // Pass access_token to the authentication method... } catch (Exception jse) { Toast.makeText(LoginActivity.this, "Exception: " + jse.getMessage(), Toast.LENGTH_LONG).show(); jse.printStackTrace(); System.err.println(jse.getMessage()); } finally { if (urlConnection != null) { urlConnection.disconnect(); } } } }
iOS
// Gets the Live Experience Access Token let rqst = NSMutableURLRequest(url: URL(string: BASE_URL + "/mobile/platform/lx/token?client_type=LIVE_EXPERIENCE")!) let session = URLSession.shared rqst.httpMethod = "POST" rqst.addValue("application/json", forHTTPHeaderField: "Accept") _ = session.dataTask(with: rqst as URLRequest, completionHandler: {data, response, error -> Void in guard let data = data, let _ = response, error == nil else { return } do { if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] { let access_token = json["access_token"] as? [[String: Any]] ?? [] print(access_token) // Pass the access_token to the Live Experience authentication method. ... } } catch let error as NSError { print(error) } })
For details about the Live Experience Integration REST API, see REST API Reference for Oracle Mobile Hub - Platform APIs.
-
Use the access token to start Live Experience, as described in Configure the Live Experience Mobile Android Component and Configure the Live Experience Mobile iOS Component.
- Once the app is configured, open it on a device and click the camera icon to launch a Live Experience session.