async partial void BtnConvert_TouchUpInside(UIButton sender) { appLinkingComponent.LongLink = appLinkingComponent.BuildLongLink().ToString(); Task <AGCShortAppLinking> task = appLinkingComponent.BuildShortLinkAsync(); AGCShortAppLinking result = await task; if (task.IsCompleted && result != null) { Console.WriteLine("Converted Result: " + task.Result.Url.ToString()); var alert = UIAlertController.Create("Long Link Converted", "SHORT LINK: " + task.Result.Url.ToString() + " ", UIAlertControllerStyle.Alert); var defaultAction = UIAlertAction.Create("OK", UIAlertActionStyle.Default, null); alert.AddAction(defaultAction); PresentViewController(alert, true, null); } }
public async void CreateShortAppLink() { //Build a short link Task <AGCShortAppLinking> shortLinkTask = appLinkingComponent.BuildShortLinkAsync(); AGCShortAppLinking result = await shortLinkTask; if (shortLinkTask.IsCompleted && result != null) { NSUrl shortLink = result.Url; textShortLink.Text = shortLink.AbsoluteString; Console.WriteLine("The ShortLink is: " + shortLink.AbsoluteString); } }
public async Task GetAppLink() { string longUrl = appLinkingComponent.BuildLongLink().ToString(); AGCShortAppLinking shortUrl = null; try { shortUrl = await appLinkingComponent.BuildShortLinkAsync(); } catch (Exception ex) { Console.WriteLine(ex); } string result = $"LONG LINK: {longUrl} \nSHORT LINK:{shortUrl?.Url} \nTEST LINK:{shortUrl?.TestUrl}"; Console.WriteLine(result); txtAppLink.Text = result; }