Twitter4j Call back issue - opening callback activity in browser

I integrate twitter in my application using the library twitter4j. I follow this . But I have a problem with the callback. After authorization, this does not actually come into our application, but in fact it opens the callback activity that we specified in the browser. I do not know why this is happening.

I tried to search, but could not find anything like it. So maybe people didn’t notice, or I missed something by integrating it.

Anyway, please help me solve this problem.

+4
source share
2 answers

URL- , , . . . , . android.intent.category.BROWSABLE , .

    private final String CALLBACKURL = "x-oauthflow-twitter://privlyT4JCallback";

    <activity
        android:name=".TwitterLinkGrabberService"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:launchMode="singleInstance" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="privlyT4JCallback"
                android:scheme="x-oauthflow-twitter" />
        </intent-filter>
    </activity>
+1

, call back constant activity.try .

<data android:scheme="login-twitter" android:host="callback1" />

 static final String TWITTER_CALLBACK_URL = "login-twitter://callback1";
0

Source: https://habr.com/ru/post/1543347/


All Articles