I make my app for goods ads. I put all products to Firebase.
But there is a problem to create goods search. I have not other server than firebase. But queries in firebase for android are too elementary,
and my idea was to use Firebase Indexing for Google Search-Bot. My idea is to search all goods via google search like this:
But I also do not have a web-site.
I tried this URL_BASE = "http://recipe-app.com/recipe/", from the google example.
I added this to my code for indexing:
//THIS IS NOT MY WEB-SITE, BECAUSE I HAVE NOT IT....
public static final String URL_BASE = "http://recipe-app.com/recipe/";
private void indexNote() {
// Note note = mRecipe.getNote();
Indexable noteToIndex = Indexables.noteDigitalDocumentBuilder()
.setName(titleEditText.getText().toString())
.setText("Added new product")
.setUrl(URL_BASE + "/product")
.build();
Task<Void> task = FirebaseAppIndex.getInstance().update(noteToIndex);
task.addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(getActivity(), "", Toast.LENGTH_SHORT).show();
Log.d(MY_TAG, "App Indexing API: Successfully added note to index");
}
});
task.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.e(MY_TAG, "App Indexing API: Failed to add note to index. " + exception
.getMessage());
}
});
}
Added this to gradle:
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
And this to manifest:
<intent-filter android:label="@string/app_name" android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://recipe-app.com/recipe" -->
<data android:scheme="http"
android:host="recipe-app.com"
android:pathPrefix="/recipe" />
</intent-filter>
But it does not work. I am trying to search product name via google search, and I don't get the link to my app as a result. What am I doing wrong? Could anyone help, please.