1

My xamarin.forms app is meant to join a Zoom meeting on a mobile device using Launcher.OpenAsync() with a uri scheme of the form "zoomus://zoom.us/join?confno=1234567890&pwd=123456".

This works fine on Android, but on iOS it doesn't seem to do anything at all. I call Launcher.CanOpenAsync() beforehand, and that returns true, so the uri should be OK. The Zoom app is already installed. In info.plist I have added zoomus (and zoom) to LSApplicationQueriesSchemes.

My code looks like this:

private void RunZoomAsync()
{
    Task zoomTask = Task.Run(async () =>
    {
        if (await Launcher.CanOpenAsync(selectedMedia.Uri))
        {
            Message = "Launching Zoom";
            await Launcher.OpenAsync(selectedMedia.Uri).ConfigureAwait(false);
        }
        else
        {
            Message = "Zoom not found. You must install Zoom from your App Store";
        }
    });
}

I see the message on the screen, so I know it's getting to the right bit of code.

I tried sending the same link to the iPhone in an email and that does nothing either. (I tried that on the Android phone, and the email app wouldn’t even display the link as a hyperlink). Is there some setting on the iPhone, or in my app, to allow deep linking?

As you may have guessed, I am not normally an iPhone user. I’m using an old iPhone 6 for testing, running iOS 12.4.8.

I have sought help from the Zoom developer forum, who suggested that when using url schemes in iOS, there is an AppDelegate function that needs to be overridden:

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool

I'm guessing the above is not C#, and that the Essentials Launcher class deals with whatever is required in iOS.

Am I missing something, or is this a bug? Any help gratefully appreciated.

derloopkat
  • 6,232
  • 16
  • 38
  • 45
Jennie
  • 11
  • 3
  • 1
    In iOS 9 and greater, Apple enforces what schemes an application can query for. To specify which schemes you would like to use, you must specify `LSApplicationQueriesSchemes` in your `Info.plist` file. Check https://learn.microsoft.com/en-us/xamarin/essentials/launcher?tabs=ios#additional-platform-setup – Lucas Zhang Aug 26 '20 at 12:14
  • @LucasZhang-MSFT Thanks, I have already done this, see above. I read that "If the destination application on this device has never been opened by OpenAsync from your application before, iOS will prompt the user once to allow your app to open it". Could this mean that it's the prompt that is failing? – Jennie Aug 26 '20 at 13:06
  • Here is a similar issue https://stackoverflow.com/questions/63594273/xamarin-forms-how-to-open-an-app-from-the-another-app/63596151#63596151 which maybe can help you .\ – Lucas Zhang Aug 26 '20 at 13:10
  • Thanks again @LucasZhang-MSFT, I think I have done everything suggested in that link. – Jennie Aug 26 '20 at 13:34
  • Are you sure that you can open those links regularly on the device? Like if you receive them to the email? – Ivan Ičin Aug 26 '20 at 13:44
  • Thanks @IvanIčin, as I said in my post, I did try sending the link by email, with the same result (it did nothing). Which makes me think I may have to configure something on the iPhone? – Jennie Aug 26 '20 at 13:59

2 Answers2

0

I tried sending the same link to the iPhone in an email and that does nothing either. (I tried that on the Android phone, and the email app wouldn’t even display the link as a hyperlink). Is there some setting on the iPhone, or in my app, to allow deep linking?

This needs to work if you have installed the app and if you are using the proper protocol and if your hardware and operating system is working properly. Your problem is not caused by your code (well unless you are using the wrong protocol), so this is the answer for this site as it doesn't deal with non-coding problems.

Why your Zoom app is not working as expected - you should start with the Zoom customer support as they are in the best position to give you the answer if it exists, but it is extremely likely that your device is faulty in some way.

Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57
  • Thanks, this is useful. I had already approached Zoom, but I just wanted to check that my Xamarin code was correct. I will go back to the Zoom people. – Jennie Aug 26 '20 at 15:19
0

My problem was that I wasn't running the Launcher in the main thread, so (I assume) the Zoom app didn't have access to the screen. So I just changed:

Task zoomTask = Task.Run(async () =>

to:

MainThread.BeginInvokeOnMainThread(async () =>

and it's now working!

Dharman
  • 30,962
  • 25
  • 85
  • 135
Jennie
  • 11
  • 3