-
public interface ScreenSharingRequestAllows to accept or decline screen sharing requests made by an Operator. Example - notifying Visitor about screen sharing request:
To allow Glia SDK to receive activity results add onActivityResult to your current activity:engagement.getScreenSharing().on(ScreenSharing.Events.SCREEN_SHARING_REQUEST, screenSharingRequest -> { runOnUiThread(() -> { Runnable onAccept = () -> { screenSharingRequest.accept(ScreenSharing.Mode.APP_BOUNDED, MainActivity.this, gliaRequestCode, error -> { if (error != null) { // handle error } }); }; Runnable onDecline = screenSharingRequest::decline; showScreenSharingRequest(onAccept, onDecline); }); });{@literal @}Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { engagement.onActivityResult(requestCode, resultCode, data); }
-
-
Method Summary
Modifier and Type Method Description abstract voidaccept(ScreenSharing.Mode mode, Activity activity, int requestCode, Consumer<GliaException> onResult)Accepts screen sharing request. abstract voidaccept(ScreenSharing.Mode mode, Fragment fragment, int requestCode, Consumer<GliaException> onResult)Accepts screen sharing request. abstract voidaccept(ScreenSharing.Mode mode, Fragment fragment, int requestCode, Consumer<GliaException> onResult)Accepts screen sharing request. abstract voiddecline()Decline screen sharing request. -
-
Method Detail
-
accept
abstract void accept(ScreenSharing.Mode mode, Activity activity, int requestCode, Consumer<GliaException> onResult)
Accepts screen sharing request.
When called the Visitor is prompted to give screen sharing permissions.Screen sharing is started immediately after the permissions are given.
This method requires a current Activity and a unique request code that can be used to trigger a screen capture permissionprompt via Activity#startActivityForResult(Intent, int).The request code is unique integer, that it is not used foryour own activity results.
Make sure to call onActivityResult fromthe provided activity'sActivity#onActivityResult(int, int, Intent)to allow Glia SDK to consume screen capture permission prompt result.
Apps targeting Android SDK version Build.VERSION_CODES.Q or later should have foreground service.The service should be registered in Manifest and specify ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION as part of foregroundServiceType
- Parameters:
mode- Screen sharing mode.activity- Current activityrequestCode- Unique request codeonResult- Called with{@code null}on success or with GliaException if the processfails for any reason.
-
accept
abstract void accept(ScreenSharing.Mode mode, Fragment fragment, int requestCode, Consumer<GliaException> onResult)
- Parameters:
mode- Screen sharing mode.fragment- Current fragment.requestCode- Unique request codeonResult- Called with{@code null}on success or with GliaException if the processfails for any reason.
-
accept
abstract void accept(ScreenSharing.Mode mode, Fragment fragment, int requestCode, Consumer<GliaException> onResult)
Accepts screen sharing request.
Similar to accept but accepts androidx.fragment.app.Fragment instance instead of Activity.
- Parameters:
mode- Screen sharing mode.fragment- Current fragment.requestCode- Unique request codeonResult- Called with{@code null}on success or with GliaException if the processfails for any reason.
-
decline
abstract void decline()
Decline screen sharing request.
-
-
-
-