public void OnSuccess(Java.Lang.Object result) { if (appLink != null) { appLink.PropertyChanged += (sender, e) => { if (e.PropertyName == AppLinkEntry.IsLinkActiveProperty.PropertyName) { if (appLink.IsLinkActive) { FirebaseUserActions.GetInstance(Context).Start(indexAction); } else { FirebaseUserActions.GetInstance(Context).End(indexAction); } } }; } }
void IndexItemAsync(IAppLinkEntry appLink) { //IndexingAction indexAction = BuildIndexAction(appLink); var url = global::Android.Net.Uri.Parse(appLink.AppLinkUri.AbsoluteUri).ToString(); IIndexable indexable = GetIndexable(appLink, url); IndexingAction indexAction = GetAction(appLink, url); /* If you’re logging an action on an item that has already been added to the index, * you don’t have to add the following update line. See * https://firebase.google.com/docs/app-indexing/android/personal-content#update-the-index for * adding content to the index */ FirebaseAppIndex.GetInstance(Context).Update(indexable); GMSTask gmsTask = FirebaseUserActions.GetInstance(Context) .Start(indexAction) .AddOnSuccessListener(Context.GetActivity(), new AndroidActionSuccessListener(appLink as AppLinkEntry, indexAction)) .AddOnFailureListener(Context.GetActivity(), new AndroidActionFailureListener(appLink as AppLinkEntry, indexAction)); }