-1

I'm trying to implement google app indexing into my apps. It works perfectly with almost all my sections but it fails with a section of my app which name is: Sección con acentos áéó

I add this into my html web for testing the deep linking:

<a href="android-app://com.example.launcher/http/section/Sección con acentos áéó">Sección con acentos áéó</a>

When I press the link on the html, my app is being successfully opened but the intent filter is not being called correctly because I can't receive the data body with "Sección con acentos áéó"

I tryed using a URL Encoded link with Secci%C3%B3n%20con%20acentos%20%C3%A1%C3%A9%C3%B3 but same problem

Google App Indexing deep linking has limitations with special characters?

NullPointerException
  • 36,107
  • 79
  • 222
  • 382

1 Answers1

2

Google App Indexing deep linking has limitations with special characters?

No, it doesn't have any limitation with special characters.

I tried with both your URL and also with the URL generated by the official Test Your App Indexing Implementation page:

android-app://com.example.launcher/http/section/Sección con acentos áéó
android-app://com.example.launcher/http/section/Secci%C3%B3n%20con%20acentos%20%C3%A1%C3%A9%C3%B3
intent://section/Secci%C3%B3n con acentos %C3%A1%C3%A9%C3%B3#Intent;scheme=http;package=com.example.launcher;end

Every URL successfully opens the app and the data contained in the intent is:

http://section/Secci%C3%B3n%20con%20acentos%20%C3%A1%C3%A9%C3%B3  

Once received the intent you need to use URLDecoder.decode to decode the URL:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Intent intent = getIntent();
    if (intent != null) {
        Uri data = intent.getData();
        if (data != null) {
            String uri = data.toString();
            Log.d(TAG, "URI: " + uri);

            String decodedUri = null;

            try {
                decodedUri = URLDecoder.decode(uri, "UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }

            Log.d(TAG, "DECODED URI: " + decodedUri);
        }
    }
}

This is the obtained result:

com.example.launcher D/MainActivity: URI: http://section/Secci%C3%B3n%20con%20acentos%20%C3%A1%C3%A9%C3%B3
com.example.launcher D/MainActivity: DECODED URI: http://section/Sección con acentos áéó
Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94
  • hey the link "http://example.com/abc#/catalog/" is not working in deep linking because it has "#" in it. If i remove the #, it works. Any solution? Pls help. – iMDroid Dec 01 '17 at 05:03