简体   繁体   English

Android应用程序内容Firebase索引

[英]android app content firebase indexing

I want to show my app content in Mobile app of Google Search whenever user search in google app.so that my app can shows in list with my app content.. in other words i am looking for enable personal content firebase indexing .. 每当用户在google app中搜索时,我都希望在Google搜索的移动应用中显示我的应用内容,以便我的应用可以与我的应用内容一起显示在列表中。换句话说,我正在寻找启用个人内容火力索引的功能

i went through lot of guides and docs, i am able to do app indexing for web urls.. 我经历了很多指南和文档,我能够为Web网址做应用程序索引。

but i also want to show my app contents in google search I tried to done this by using below code.. 但我也想在Google搜索中显示我的应用程序内容,我试图通过使用以下代码来做到这一点。

i created intent service 我创建了意图服务

public class AppIndexingService extends IntentService {
    DatabaseAccess databaseAccess;


    public AppIndexingService() {
        super("AppIndexingService");

    }

    @Override
    protected void onHandleIntent(Intent intent) {
        databaseAccess = DatabaseAccess.getInstance(getApplicationContext(), getResources().getString(R.string.shamukey));
        databaseAccess.open();
        ArrayList<Indexable> indexableNotes = new ArrayList<>();
ArrayList<RaviMessages>indexableMessagesArrayList=databaseAccess.readArticles("bagale");
        for (RaviMessages recipe :indexableMessagesArrayList ) {

            Indexable noteToIndex = Indexables.noteDigitalDocumentBuilder()
                .setName(recipe.getName())
                .setDescription(recipe.getStatus())
                  .setUrl("android-app://com.itsvibrant.FeelMyLoveMarathi/")
                .put("image","http://www.logospike.com/wp-content/uploads/2015/10/Android_Logo_04.png")
                .build();

                indexableNotes.add(object);
            }


        if (indexableNotes.size() > 0) {
            Indexable[] notesArr = new Indexable[indexableNotes.size()];
            notesArr = indexableNotes.toArray(notesArr);

            // batch insert indexable notes into index
            FirebaseAppIndex.getInstance().update(notesArr);
        }

    }
}

Android manifest file. Android清单文件。

<application
        android:name=".ApplicationContext"
        android:allowBackup="true"
        android:icon="@mipmap/fml_mar"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="android.app.default_searchable"
            android:value="com.itsvibrant.FeelMyLoveMarathi.MainActivity" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />


            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="android-app"
                    android:host="com.itsvibrant.FeelMyLoveMarathi" />
                <data
                    android:host="ravindrabagale.com"
                    android:pathPrefix="/"
                    android:scheme="http" />
                <data
                    android:host="shayari"
                    android:scheme="ravindrabagale" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <service android:name="AppIndexingService"
            android:exported="true"
            android:permission="com.google.android.gms.permission.APPINDEXING">
            <intent-filter>
                <action android:name="com.google.firebase.appindexing.UPDATE_INDEX" />
            </intent-filter>
        </service>


    </application>

But Still i am not able to show my app contents in google search.. what wrong i am doing ?? 但是,我仍然无法在Google搜索中显示我的应用程序内容。 or am forgetting something?? 还是忘记了什么?

Have you added the correct property for your android app & website on https://www.google.com/webmasters/tools ? 您是否已在https://www.google.com/webmasters/tools上为您的android应用和网站添加了正确的属性?

Also, have you verified your website via the Play Store's Developer portal? 另外,您是否通过Play商店的开发者门户网站验证了您的网站? If not, here's a link to those instructions. 如果没有,这是这些说明的链接。 For some reason these steps aren't really spelled out directly in the Firebase examples of App Indexing. 由于某些原因,这些步骤并未在Firebase App Indexing示例中真正地直接阐明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM