I am build a demo with third party login, I meet a problem about "UIApplication.OpenURLOptionsKey.sourceApplication", I can not find the key string in Xamarin.iOS. Can any one help me?
in swift:

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let urlKey: String = options[UIApplication.OpenURLOptionsKey.sourceApplication] as! String
if urlKey == "com.tencent.mqq" {
return TencentOAuth.handleOpen(url)
}
return application(app, open: url, options: options)
}
And in C#:

```C#
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
var urlKey = options[UIApplication.LaunchOptionsUrlKey]?.ToString();
if (urlKey == "com.tencent.mqq")
{
return TencentOAuth.HandleOpenURL(url);
}
return base.OpenUrl(app, url, options);
}
```
Hi Carl,
Thank you for your feedback!
It is likely that UIKit.UIApplicationOpenUrlOptions is the API you are looking for.
For more information about dictionary wrappers, check out: https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/binding/binding-types-reference#strongly-typed-dictionaries
Hi Carl,
Thank you for your feedback!
It is likely that
UIKit.UIApplicationOpenUrlOptionsis the API you are looking for.> For more information about dictionary wrappers, check out: https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/binding/binding-types-reference#strongly-typed-dictionaries
@whitneyschmidt Hello, thanks for your reply, do you mean this class:(I tried, but it didn't work,
But I think I need a static const string here.)
Maybe this class(below) should be used here, but I don't know why it is internal.
Do you know what should I do?
Try creating a new instance with:
public UIApplicationOpenUrlOptions (NSDictionary dictionary)
and then poking 锘匡豢SourceApplication
I thought we exposed those keys as well, but apparently aren't. I'm looking into that.
Hello 馃憢
Yeah as @chamons said you want to do this
public override bool OpenUrl (UIApplication app, NSUrl url, NSDictionary options)
{
var openOptions = new UIApplicationOpenUrlOptions (options);
if (openOptions?.SourceApplication == "blah")
// handle scenario
return base.OpenUrl(app, url, options);
}
Hope this helps.
@chamons @dalexsoto Thank you very much! It works well now!
Most helpful comment
Hello 馃憢
Yeah as @chamons said you want to do this
Hope this helps.