Ejemplo n.º 1
0
        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            var rurl = new Rivets.AppLinkUrl (url.ToString ());

            var id = string.Empty;

            if (rurl.InputQueryParameters.ContainsKey("id"))
                id = rurl.InputQueryParameters ["id"];

            if (rurl.InputUrl.Host.Equals ("products") && !string.IsNullOrEmpty (id)) {
                var c = new ProductViewController (id, rurl.Referrer);
                navController.PushViewController (c, true);
                return true;
            } else {
                navController.PopToRootViewController (true);
                return true;
            }
        }
Ejemplo n.º 2
0
        public MainViewController() : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement("Rivets Sample")
            {
                new Section()
                {
                    new StyledStringElement("Show Product: widget", () => {
                        productViewController = new ProductViewController("widget");
                        NavigationController.PushViewController(productViewController, true);
                    }),
                    new StyledStringElement("App Link to widget", async() => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/SimpleiOSMetaData.html";

                        var result = await Rivets.AppLinks.Navigator.Navigate(url);

                        Console.WriteLine(result);
                    }),

                    new StyledStringElement("App Link to widget with Referer", async() => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/SimpleiOSMetaData.html";

                        var referer = new Rivets.RefererAppLink {
                            TargetUrl = new Uri(url),
                            Url       = new Uri("example://"),
                            AppName   = "Example Store"
                        };

                        var result = await Rivets.AppLinks.Navigator.Navigate(url, referer);

                        Console.WriteLine(result);
                    }),

                    new StyledStringElement("Web Fallback Link", async() => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/WebFallbackMetaData.html";

                        var result = await Rivets.AppLinks.Navigator.Navigate(url);

                        Console.WriteLine(result);
                    })
                },
            };
        }
Ejemplo n.º 3
0
        public MainViewController()
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement ("Rivets Sample") {
                new Section () {
                    new StyledStringElement("Show Product: widget", () => {
                        productViewController = new ProductViewController("widget");
                        NavigationController.PushViewController(productViewController, true);
                    }),
                    new StyledStringElement("App Link to widget", async () => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/SimpleiOSMetaData.html";

                        var result = await Rivets.AppLinks.Navigator.Navigate(url);

                        Console.WriteLine(result);
                    }),

                    new StyledStringElement("App Link to widget with Referer", async () => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/SimpleiOSMetaData.html";

                        var referer = new Rivets.RefererAppLink {
                            TargetUrl = new Uri(url),
                            Url = new Uri("example://"),
                            AppName = "Example Store"
                        };

                        var result = await Rivets.AppLinks.Navigator.Navigate(url, referer);

                        Console.WriteLine(result);
                    }),

                    new StyledStringElement("Web Fallback Link", async () => {
                        var url = "https://rawgit.com/Redth/Rivets/master/Rivets.Tests/Html/WebFallbackMetaData.html";

                        var result = await Rivets.AppLinks.Navigator.Navigate(url);

                        Console.WriteLine(result);
                    })
                },
            };
        }
Ejemplo n.º 4
0
        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
        {
            var rurl = new Rivets.AppLinkUrl(url.ToString());

            var id = string.Empty;

            if (rurl.InputQueryParameters.ContainsKey("id"))
            {
                id = rurl.InputQueryParameters ["id"];
            }

            if (rurl.InputUrl.Host.Equals("products") && !string.IsNullOrEmpty(id))
            {
                var c = new ProductViewController(id, rurl.Referrer);
                navController.PushViewController(c, true);
                return(true);
            }
            else
            {
                navController.PopToRootViewController(true);
                return(true);
            }
        }