public void CreateLongAppLink() { //Build a long link NSUrl longLink = appLinkingComponent.BuildLongLink(); textLongLink.Text = longLink.AbsoluteString; }
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 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; }