Skip to content

Handle External Links

Kristiyan Petrov edited this page Apr 26, 2022 · 16 revisions

After on_call_incoming hook has been registered on your backend it is possible to parse the received payload and obtain http urls that can be used typically to send an incoming call email notification to your users.

These urls can be used at anytime to connect to an existing call or re-create it.

Preconditions

  • Add the following code in the AndroidManifest.xml under the activity that you want to be able to handle the link. You will be able to get the link from the intent during onCreate or newIntent of the activity. See our demo_app example or refer to android official guide for a more details on how to listen and handle an external link.
 <intent-filter android:autoVerify="true" tools:targetApi="m">
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />

          	    <data
                    android:host="*.bandyer.com"
                    android:pathPattern="/..*/rest-call-handler/..*"
                    android:scheme="https" />
                <data
                    android:host="*.bandyer.com"
                    android:pathPattern="/..*/direct-rest-call-handler/..*"
                    android:scheme="https" />
</intent-filter>
  • To handle the url the BandyerSDKClient must be initialized and running!
  • Be sure also to call it only when the callModule of the BandyerSDKClient is ready.

Handle link

Once you have the preconditions you may connect the BandyerSDK and then start the activity with the Bandyer Intent.

Session session = new Session(
	"userId",
	accessTokenProvider,
	sessionObserver);

BandyerSDK.getInstance().connect(
	session,
	errorReason -> Log.e(TAG, "Unable to connect BandyerSDK with error: " + errorReason)
);

Intent intent = new BandyerIntent.Builder()
               		.startFromJoinCallUrl(this, joinUrl)
                    .build();

startActivity(intent);

Configuration

SimpleCallConfiguration Most common type of configuration for call. Follow the link for more details.

SimpleChatConfiguration Most common type of configuration for chat. Follow the link for more details.

Customize Configuration Customize the configuration at your desire. Follow the link for more details.

Clone this wiki locally