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.Instance.Update(indexable); GMSTask gmsTask = FirebaseUserActions.Instance .Start(indexAction) .AddOnSuccessListener(Context.GetActivity(), new AndroidActionSuccessListener(appLink as AppLinkEntry, indexAction)) .AddOnFailureListener(Context.GetActivity(), new AndroidActionFailureListener(appLink as AppLinkEntry, indexAction)); }
public AndroidActionFailureListener(AppLinkEntry appLink, IndexingAction indexAction) { this.appLink = appLink; this.indexAction = indexAction; }