首页 > 解决方案 > OpenUrl返回false并且在xamarin ios中超过5次后不起作用

问题描述

这是我打开另一个应用程序的代码:

string SchemeName = "ITSapp://";
                string param = "AuGeoStart:id="+System.Guid.NewGuid().ToString()+"Image=" + imgString + "&Latitude=" + currentLat + "&Longitude=" +  currentLong +
                    "&TargetLlatitude=" + targetLat+ "&TargetLongitude=" + targetLong +"&Angle=" + angle+"&Distance=" +distance+ "AuGeoEnd";

                string finalReqURL = SchemeName + param;
           

                NSString urlstring = new NSString(finalReqURL);

                NSUrl request = new NSUrl(urlstring);

                    bool isCanOpened = UIApplication.SharedApplication.CanOpenUrl(request);
                    if (isCanOpened)
                    {
                        //bool isOpened = UIApplication.SharedApplication.OpenUrl(request);
                        bool isOpened =Task.FromResult(UIApplication.SharedApplication.OpenUrl(request)).Result;
                    }

这是我的 info.plist 文件

在此处输入图像描述

5 次后此代码不起作用,打开 url 返回 false,CanOpenUrl 返回 false

标签: iosxamarinopenurl

解决方案


推荐阅读