Android filter for http scheme

I created an Android app that requires OAuth. Everything worked fine, using a special callback that intercepts Android. It seems that Yahoo has changed goals, and now the user scheme is not accepted by Yahoo.

Now I am considering possible alternative approaches. My first attempt was to use a regular http scheme and change the intent filter to catch the new URL. In my AndroidManifest.xml, I have the following:

<intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:host="www.test.com" android:scheme="http"></data> </intent-filter> 

Where www.test.com will be replaced by the domain that I have. It seems:

  • This filter is triggered when I click the link on the page.
  • It does not start when redirecting Yahoo, the browser opens a website at www.test.com
  • It does not start when you enter the domain name directly in the browser.

So can someone help me with

  • When exactly will this intent filter be launched?
  • Any filter changes or intent permissions that will extend the filter to apply to the redirect?
  • Any other approaches I could use?

Thank you for your help.

+4
source share
1 answer

What about an alternative solution, by hosting a script on your site www.test.com that fetches oauth parameters and redirects your schema to your callback?

For example, oauth.php (pardon my PHP ...)

 <? header('Location:myschema://mythost?oauth_verifier='.urlencode( $_GET['oauth_verifier']). '&oauth_token='.urlencode($_GET['oauth_token'])); die(); ?> 

I have been successfully using it for Google OAuth, which has the same restriction on the callback URL.

+3
source

All Articles