示例#1
0
        private void InitAppLink()
        {
            try
            {
                var url = $"https://kronishue.azurewebsites.net/app";

                var entry = new AppLinkEntry
                {
                    Title        = "KronisHue",
                    Description  = "KronisHue",
                    AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                    IsLinkActive = true,
                    Thumbnail    = ImageSource.FromFile("Icon.png")
                };

                entry.KeyValues.Add("contentType", "Session");
                entry.KeyValues.Add("appName", "Kronis Hue");
                entry.KeyValues.Add("companyName", "DataPolarna AB");

                Application.Current.AppLinks.RegisterLink(entry);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
        public static AppLinkEntry CreateAppLink(string title, string description, string id, string iconName = "")
        {
            var url = $"{BaseUrl}{id}";

            var entry = new AppLinkEntry
            {
                Title = title,
                Description = description,
                AppLinkUri = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            switch (Device.RuntimePlatform)
            {
                case Device.iOS:
                    if (!string.IsNullOrEmpty(iconName))
                        entry.Thumbnail = ImageSource.FromFile(iconName);
                    break;
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", "SimpleUITestApp");
            entry.KeyValues.Add("companyName", "Minnick");

            return entry;
        }
示例#3
0
        public static AppLinkEntry GetAppLink(this MiniHack miniHack)
        {
            var url = $"http://{AboutThisApp.AppLinksBaseDomain}/{AboutThisApp.MiniHacksSiteSubdirectory.ToLowerInvariant()}/{miniHack.Id}";

            var entry = new AppLinkEntry
            {
                Title        = miniHack.Name ?? "",
                Description  = miniHack.Description ?? "",
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                if (!string.IsNullOrEmpty(miniHack.BadgeUrl))
                {
                    entry.Thumbnail = ImageSource.FromUri(miniHack.BadgeUri);
                }
                else
                {
                    entry.Thumbnail = ImageSource.FromFile("Icon.png");
                }
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", AboutThisApp.AppName);
            entry.KeyValues.Add("companyName", AboutThisApp.CompanyName);

            return(entry);
        }
示例#4
0
        public static AppLinkEntry GetAppLink(this SpeakerModel speakerModel)
        {
            var url =
                $"http://{AboutThisApp.AppLinksBaseDomain}/{AboutThisApp.SpeakersSiteSubdirectory.ToLowerInvariant()}/{speakerModel.Id}";

            var entry = new AppLinkEntry
            {
                Title        = speakerModel.FullName ?? string.Empty,
                Description  = speakerModel.Biography ?? string.Empty,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                if (!string.IsNullOrEmpty(speakerModel.AvatarUrl))
                {
                    entry.Thumbnail = ImageSource.FromUri(speakerModel.AvatarUri);
                }
                else
                {
                    entry.Thumbnail = ImageSource.FromFile("Icon.png");
                }
            }

            entry.KeyValues.Add("contentType", "Speaker");
            entry.KeyValues.Add("appName", AboutThisApp.AppName);
            entry.KeyValues.Add("companyName", AboutThisApp.CompanyName);

            return(entry);
        }
示例#5
0
        void CreateDeepLinkEntry()
        {
            var url = $"{Helpers.Constants.BaseUrl}/part/{Part.Id}";

            var entry = new AppLinkEntry
            {
                Title        = Part.Name,
                Description  = Part.Manufacturer,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = Xamarin.Forms.ImageSource.FromFile("icon_greentool.png")
            };

            entry.KeyValues.Add("contentType", "Parts");
            entry.KeyValues.Add("appName", "Field Service");
            entry.KeyValues.Add("companyName", "Contoso Maintenance");

            try
            {
                Application.Current.AppLinks.RegisterLink(entry);
            }
            catch (Exception ex)
            {
                // Crashes on Android currents
                // TODO: Fix DeepLink support on Android
            }
        }
示例#6
0
        public void KeyValuesTest()
        {
            var entry = new AppLinkEntry();

            entry.KeyValues.Add("contentType", "GalleryPage");
            entry.KeyValues.Add("companyName", "Xamarin");
            Assert.AreEqual(entry.KeyValues.Count, 2);
        }
示例#7
0
        public void FromUriTest()
        {
            var uri = new Uri("http://foo.com");

            var entry = AppLinkEntry.FromUri(uri);

            Assert.AreEqual(uri, entry.AppLinkUri);
        }
		public void KeyValuesTest()
		{
			var entry = new AppLinkEntry();

			entry.KeyValues.Add("contentType", "GalleryPage");
			entry.KeyValues.Add("companyName", "Xamarin");
			Assert.AreEqual(entry.KeyValues.Count, 2);
		}
		public void ToStringTest()
		{
			var str = "http://foo.com";
			var uri = new Uri(str);

			var entry = new AppLinkEntry { AppLinkUri = uri };

			Assert.AreEqual(uri.ToString(), entry.ToString());
		}
示例#10
0
        public void ToStringTest()
        {
            var str = "http://foo.com";
            var uri = new Uri(str);

            var entry = new AppLinkEntry {
                AppLinkUri = uri
            };

            Assert.AreEqual(uri.ToString(), entry.ToString());
        }
示例#11
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            var url = $"https://barisceviz.com/{Id.ToString()}";

            var entry = new AppLinkEntry
            {
                Title        = "Test Xamarin",
                Description  = "Deep linking test",
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
            };

            Application.Current.AppLinks.RegisterLink(entry);
        }
示例#12
0
        AppLinkEntry GetAppLink(TodoItem item)
        {
            var pageType = GetType().ToString();
            var pageLink = new AppLinkEntry
            {
                Title        = item.Name,
                Description  = item.Notes,
                AppLinkUri   = new Uri(string.Format("http://{0}/{1}?id={2}", App.AppName.ToLower(), pageType, WebUtility.UrlEncode(item.ID)), UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromFile("monkey.png")
            };

            pageLink.KeyValues.Add("contentType", "TodoItemPage");
            pageLink.KeyValues.Add("appName", App.AppName);
            pageLink.KeyValues.Add("companyName", "Xamarin");

            return(pageLink);
        }
示例#13
0
        AppLinkEntry MakeAppLink(string title, string description, int id)
        {
            var pageType = GetType().ToString();
            var pageLink = new AppLinkEntry
            {
                Title        = title,
                Description  = description,
                AppLinkUri   = new Uri(string.Format("http://{0}/{1}?id={2}", App.AppName, pageType, id), UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromFile("Xamagon.png")
            };

            pageLink.KeyValues.Add("contentType", "ContentPage");
            pageLink.KeyValues.Add("appName", App.AppName);
            pageLink.KeyValues.Add("companyName", "Xamarin");

            return(pageLink);
        }
示例#14
0
        protected override void OnAppearing()
        {
            var url = $"http://pustera.com";

            var entry = new AppLinkEntry
            {
                Title        = "Pustera",
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            entry.KeyValues.Add("appName", "Pustera");
            entry.KeyValues.Add("companyName", "Pustera");

            //Application.Current.AppLinks.RegisterLink(entry);

            base.OnAppearing();
        }
示例#15
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            // See details at: https://developer.xamarin.com/guides/xamarin-forms/platform-features/deep-linking/
            _appLink = new AppLinkEntry
            {
                // It's not really clear why this must be a URI. At least on iOS it is just used as a unique identifier
                // and the URI is turned into a string again. Maybe for Android?
                AppLinkUri  = new Uri(string.Format(App.AppLinkUri, Title).Replace(" ", "_")),
                Thumbnail   = ImageSource.FromFile("Xamagon.png"),
                Description = string.Format($"This is item {Title}"),
                Title       = string.Format($"Item {Title}"),
                // Mark this as the current activity. This will for instance allow handoff operations on iOS.
                IsLinkActive = true
            };

            Application.Current.AppLinks.RegisterLink(_appLink);
        }
        private void RegisterAppLink(bool active)
        {
            var entry = new AppLinkEntry
            {
                Title        = Session.Title,
                StyleId      = Session.Id,
                AppLinkUri   = new Uri($"{App.AppLinkBaseUri}/sessions/sessiondetail?sessionId={Uri.EscapeDataString(Session.Id)}", UriKind.RelativeOrAbsolute),
                Description  = Session.IsServiceSession ? "Service session" : Session.Description,
                IsLinkActive = active
            };

            // These are parameters that are shown in the search (especially the AppName)
            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("companyName", "VSLive");
            entry.KeyValues.Add("appName", "ConferenceApp");

            Application.Current.AppLinks.RegisterLink(entry);
        }
示例#17
0
        AppLinkEntry GetAppLink(TodoItem item)
        {
            var pageType = GetType().ToString();
            var pageLink = new AppLinkEntry
            {
                Title        = item.Name,
                Description  = item.Notes,
                AppLinkUri   = new Uri($"http://{App.AppName}/{pageType}?id={item.ID}", UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromFile("monkey.png")
            };

            pageLink.KeyValues.Add("contentType", "TodoItemPage");
            pageLink.KeyValues.Add("appName", App.AppName);
            pageLink.KeyValues.Add("companyName", "Xamarin");

            return(pageLink);
        }
        private void ChatActivityTab_OnAppearing(object sender, EventArgs e)
        {
            var url = $"https://demo.wowonder.com/foxx3000";

            var entry = new AppLinkEntry
            {
                Title        = "foxx3000",
                Description  = "Wowonder next genaration to the last earth",
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromFile("Icon.png")
            };

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", "Alidoughouz");
            entry.KeyValues.Add("companyName", "Xamarin");
            Application.Current.AppLinks.RegisterLink(entry);
        }
示例#19
0
        public static AppLinkEntry CreateAppLink(string title, string description, string id, string iconName = "")
        {
            var url = $"{BaseUrl}{id}";

            var entry = new AppLinkEntry
            {
                Title        = title,
                Description  = description,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.RuntimePlatform is Device.iOS && !string.IsNullOrEmpty(iconName))
            {
                entry.Thumbnail = ImageSource.FromFile(iconName);
            }

            return(entry);
        }
示例#20
0
		AppLinkEntry GetEntry ()
		{
			if (string.IsNullOrEmpty (Title))
				Title = "App Link Page Gallery";
	
			var type = GetType ().ToString ();
			var entry = new AppLinkEntry {
				Title = Title,
				Description =$"This is the page {Title} \nof Xamarin Forms Gallery",
				AppLinkUri = new Uri ($"http://{App.AppName}/gallery/{type}", UriKind.RelativeOrAbsolute),
				IsLinkActive = true,
				Thumbnail = ImageSource.FromFile ("seth.png")
			};

			entry.KeyValues.Add ("contentType", "GalleryPage");
			entry.KeyValues.Add ("appName",  App.AppName);
			entry.KeyValues.Add ("companyName", "Xamarin");

			return entry;
		}
示例#21
0
        AppLinkEntry _appLink; // App Linking
        protected override void OnAppearing()
        {
            base.OnAppearing();
            MessagingCenter.Send <object>(this, "Portrait"); // enforce portrait mode

            // App Linking
            Uri appLinkUri = new Uri(string.Format(App.AppLinkUri, Title).Replace(" ", "_"));

            _appLink = new AppLinkEntry
            {
                AppLinkUri   = appLinkUri,
                Description  = string.Format($"This App visualizes {Title}"),
                Title        = string.Format($"WertheApp {Title}"),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromResource("WertheApp.png")
            };
            //TODO:Appindexing bug android
            if (Device.RuntimePlatform == Device.iOS)
            {
                Xamarin.Forms.Application.Current.AppLinks.RegisterLink(_appLink);
            }
        }
示例#22
0
        AppLinkEntry GetEntry()
        {
            if (string.IsNullOrEmpty(Title))
            {
                Title = "App Link Page Gallery";
            }

            var type  = GetType().ToString();
            var entry = new AppLinkEntry {
                Title        = Title,
                Description  = $"This is the page {Title} \nof Xamarin Forms Gallery",
                AppLinkUri   = new Uri($"http://{App.AppName}/gallery/{type}", UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = ImageSource.FromFile("seth.png")
            };

            entry.KeyValues.Add("contentType", "GalleryPage");
            entry.KeyValues.Add("appName", App.AppName);
            entry.KeyValues.Add("companyName", "Xamarin");

            return(entry);
        }
示例#23
0
        public static AppLinkEntry GetAppLink(this Session session)
        {
            var url = $"http://{AboutThisApp.AppLinksBaseDomain}/{AboutThisApp.SessionsSiteSubdirectory.ToLowerInvariant()}/{session.Id}";

            var entry = new AppLinkEntry
            {
                Title        = session.Title ?? "",
                Description  = session.Abstract ?? "",
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile("Icon.png");
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", AboutThisApp.AppName);
            entry.KeyValues.Add("companyName", AboutThisApp.CompanyName);

            return(entry);
        }
示例#24
0
        public static AppLinkEntry GetAppLink(this Session session)
        {
            var url = $"https://devopenspace.de/#workshops";

            var entry = new AppLinkEntry
            {
                Title        = session.Title,
                Description  = session.Abstract,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile("Icon.png");
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", "Dev Open Space");
            entry.KeyValues.Add("companyName", "devopenspace");

            return(entry);
        }
        public static AppLinkEntry CreateAppLink(string title, string description, string id, string iconName = "")
        {
            var url = $"{BaseUrl}{id}";

            var entry = new AppLinkEntry
            {
                Title        = title,
                Description  = description,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (iconName != "" && Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile(iconName);
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", "SimpleUITestApp");
            entry.KeyValues.Add("companyName", "Minnick");

            return(entry);
        }
        public static AppLinkEntry GetAppLink(ServiceCentre centre)
        {
            var url = $"http://exrin.net/servicecentre/{centre.Id.ToString()}";

            var entry = new AppLinkEntry
            {
                Title        = "Service Centre",
                Description  = centre.Name,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile("logo.png");
            }

            entry.KeyValues.Add("contentType", "Service");
            entry.KeyValues.Add("appName", "Tesla");
            entry.KeyValues.Add("companyName", "Tesla");

            return(entry);
        }
示例#27
0
        public static AppLinkEntry GetAppLink(this Session session)
        {
            var url = $"http://evolve.xamarin.com/session/{session.Id.ToString()}";

            var entry = new AppLinkEntry
            {
                Title        = session.Title,
                Description  = session.Abstract,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile("Icon.png");
            }

            entry.KeyValues.Add("contentType", "Session");
            entry.KeyValues.Add("appName", "Evolve16");
            entry.KeyValues.Add("companyName", "Xamarin");

            return(entry);
        }
示例#28
0
        AppLinkEntry GetEntry()
        {
            if (string.IsNullOrEmpty(Title))
            {
                Title = "ApplinkEntry Thumbnail required after upgrading to 3.5/3.6";
            }

            var type  = GetType().ToString();
            var entry = new AppLinkEntry
            {
                Title        = Title,
                Description  = $"ApplinkEntry Thumbnail required after upgrading to 3.5/3.6",
                AppLinkUri   = new Uri($"http://blah/gallery/{type}", UriKind.RelativeOrAbsolute),
                IsLinkActive = true,
                Thumbnail    = null
            };

            entry.KeyValues.Add("contentType", "GalleryPage");
            entry.KeyValues.Add("appName", "blah");
            entry.KeyValues.Add("companyName", "Xamarin");

            return(entry);
        }
示例#29
0
        public static AppLinkEntry GetAppLink(this LockerMember locker)
        {
            var url = $"http://evolve.xamarin.com/locker/{locker.Id.ToString()}";

            var entry = new AppLinkEntry
            {
                Title        = locker.DisplayName,
                Description  = locker.MemberName,
                AppLinkUri   = new Uri(url, UriKind.RelativeOrAbsolute),
                IsLinkActive = true
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                entry.Thumbnail = ImageSource.FromFile("Icon.png");
            }

            entry.KeyValues.Add("contentType", "Locker");
            entry.KeyValues.Add("appName", "Evolve16");
            entry.KeyValues.Add("companyName", "Xamarin");

            return(entry);
        }
示例#30
0
 public AndroidActionFailureListener(AppLinkEntry appLink, IndexingAction indexAction)
 {
     this.appLink     = appLink;
     this.indexAction = indexAction;
 }