Beispiel #1
0
        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));
        }
Beispiel #2
0
 void RemoveFromIndexItemAsync(string identifier)
 {
     FirebaseAppIndex.GetInstance(Context).Remove(identifier);
 }