dierre
dierre

Reputation: 7210

Using a Callback Uri in android not working

So, this is my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="info.dierrelabs.h4m"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".H4M"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="h4m-android-app" />
            </intent-filter>
        </activity>

    </application>
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest>

In my activity I declare my URI as:

private static final Uri HT_CALLBACK_URI = Uri.parse("h4m-android-app:///");

But when the website sent the user back I got:

You don't have the permission to open this page h4m-android-app:///?oauth..blablabla

I even tried using h4m-android-app:// instead of h4m-android-app:/// but nothing changes.

Upvotes: 1

Views: 1790

Answers (1)

dierre
dierre

Reputation: 7210

Guys, don't ask me why, but I've solved splitting my activity. Basically I had to create the Main activity which has

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

Then a second activity where you have

<data android:scheme="h4m-android-app" />

You can't bind an android:scheme to where you have MAIN and LAUNCHER

Upvotes: 3

Related Questions