public class CommunicationFragment
extends Fragment
Here is an example, you should put similar code to your Activity class.
final String FRAGMENT_TAG = CommunicationFragment.class.getName();
// Specify the settings for component behavior.
CommunicationFragment.settings.startVideoInFullScreen = true;
CommunicationFragment.settings.startVideoWithFrontCamera = true;
// Specify the settings for the service.
CommunicationFragment.service.setAddress("Cloud_server_address");
CommunicationFragment.service.setUserID("Your_user_id");
CommunicationFragment.service.setTenantID("Your_tenant_key");
CommunicationFragment.service.setAuthToken("Your_auth_token");
CommunicationFragment.service.setLanguage("Your_locale");
// Specify optional information about the customer
// "appLocation" context attribute is used to match configured engagement scenario.
CommunicationFragment.contextAttributes.set("appLocation", "Basic Guidance");
CommunicationFragment.contextAttributes.set("fullName", "Macy Williams");
CommunicationFragment.contextAttributes.set("email", "macy.williame@example.com");
CommunicationFragment.contextAttributes.set("phone", "+16505550121");
CommunicationFragment.contextAttributes.set("location", "San Francisco CA, United States");
final FragmentManager manager = getSupportFragmentManager();
CommunicationFragment fragment = (CommunicationFragment) manager.findFragmentByTag(FRAGMENT_TAG);
if (fragment == null) {
fragment = CommunicationFragment.newInstance();
manager.beginTransaction()
.add(R.id.cx_container, fragment, FRAGMENT_TAG)
.commit();
}
Modifier and Type | Field and Description |
---|---|
static ContextAttributes |
contextAttributes
End user context attribute settings.
|
static String |
IS_IN_APP_CALL_RINGING
If it's the in-app call ringing.
|
static int |
PERMISSION_SCREEN_CAPTURE
Screen capture request code.
|
static Service |
service
Service settings.
|
static Settings |
settings
Component UI behavior settings.
|
Constructor and Description |
---|
CommunicationFragment() |
Modifier and Type | Method and Description |
---|---|
static CommunicationFragment |
newInstance()
Create new CommunicationFragment instance.
|
static void |
setClientInfo(ClientInfo clientInfo,
android.content.Context context)
Set client information.
|
static void |
setMeetingURL(String meetingURL)
Set meeting URL for a meeting call.
|
static void |
setNotificationContent(Map notificationData,
android.content.Context context,
Class cls)
Set in-app call content.
|
static void |
setScreenCaptureIntent(android.content.Intent captureIntent)
Set screen capture permission result.
If end user allows the application to capture screen, the application will get screen capture result intent by following Android API. |
public static final int PERMISSION_SCREEN_CAPTURE
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CommunicationFragment.PERMISSION_SCREEN_CAPTURE) {
CommunicationFragment.setScreenCaptureIntent(data);
}
}
public static final String IS_IN_APP_CALL_RINGING
public static Settings settings
public static ContextAttributes contextAttributes
public static Service service
public static void setScreenCaptureIntent(android.content.Intent captureIntent)
android.app.Activity.onActivityResult(int requestCode, int resultCode, Intent data)
The requestCode must equal with CommunicationFragment.PERMISSION_SCREEN_CAPTURE, the widget
will use this code to request application screen capture permission according to configuration.captureIntent
- screen capture permission resultpublic static CommunicationFragment newInstance()
public static void setMeetingURL(String meetingURL)
meetingURL
- the meeting URLpublic static void setNotificationContent(Map notificationData, android.content.Context context, Class cls)
notificationData
- the notification datacontext
- the android application contextcls
- the communication fragment parent activity classpublic static void setClientInfo(ClientInfo clientInfo, android.content.Context context)
clientInfo
- the client informationcontext
- the android application context