I am trying to understand how to open other apps from within a Kotlin Multiplatform app. I am creating a contacts app for iOS and Android and I want to make a button which lets the user call a contact in a 3rd party app (e.g. WhatsApp, Google Meet etc.).
An example interaction:
- In my app, the user navigates to the contact they want to call.
- User presses the ‘Video call’ button.
- My app opens the Google Meet app and creates a new video call.
I was able to implement this sort of functionality in Android/Java using Android intents:
Intent viewContact = new Intent(Intent.ACTION_VIEW);
viewContact.setClassName("com.google.android.apps.tachyon",
"com.google.android.apps.tachyon.ContactsVideoActionActivity");
viewContact.setData(Uri.parse("content://com.android.contacts/data/2173"));
This intent opens the Google Meet app and starts a video call with the contact ID:2173.
My questions are:
- Is there a way to open external apps in common code?
- Is there a multiplatform equivalent of Android intents?
- On the other hand, if I have to create separate implementations for Android and iOS, how do I open an external iOS app?
Many thanks!