Saturday, 15 May 2021

Android how is a Chrome intent-based URI opened

From the Chrome docs, I understand apps can be opened with the following URI

intent:  
   HOST/URI-path // Optional host  
   #Intent;  
      package=\[string\];  
      action=\[string\];  
      category=\[string\];  
      component=\[string\];  
      scheme=\[string\];  
   end;

I was wondering if I could open this URI from my app.

Example URI

intent:
    //qr/json/%7B%22u%22%3A%22https%3A%2F%2Fprivacybydesign.foundation%2Fbackend%2Firma%2Fsession%2FvsRjkZF2B2H17sBWmVZe%22%2C%22irmaqr%22%3A%22disclosing%22%7D
    #Intent;
        package=org.irmacard.cardemu;
        scheme=cardemu;
        l.timestamp=1620907855707;
        S.browser_fallback_url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.irmacard.cardemu
    ;end

Since it look like a normal URI I thought I could open it like this:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("%EXAMPLE_URI%"));
startActivity(intent);

That gives me an ActivityNotFoundException. What am I missing?

Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=intent://qr/json/{"u":"https://ift.tt/3eRbWC2} pkg=org.irmacard.cardemu (has extras) }



from Android how is a Chrome intent-based URI opened

No comments:

Post a Comment