How to get twitter callback after tweet in browser

I have a problem for twitter callback for myapp

when I share imageand textat twitter(Twitter application not installed)the time when it is redirected to the browser for sharing imageor text.

the data exchange is fine, but the problem is that it does not send any callback event to my application and does not close the browser automatically.

 <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:scheme="pdk1234567890" />
                <data
                    android:host="SampleActivity"
                    android:scheme="x-oauthflow-twitter" />
            </intent-filter>

Please, help...

+4
source share
1 answer

. FinestWebView ( , twitter), . . .

 String url = "https://twitter.com/intent/tweet?text=Hello World!";
 new FinestWebView.Builder(activity)
                .toolbarColorRes(R.color.colorPrimary)
                .showIconMenu(false)
                .titleColorRes(R.color.White)
                .backPressToClose(true)
                .iconDefaultColorRes(R.color.White)
                .addWebViewListener(new WebViewListener() {
                    @Override
                    public void onPageFinished(String url) {
                        super.onPageFinished(url);
                        if (url.contains("complete")) { 
                         //TODO On Success Code
                        } else {
                           //TODO On Failure Code
                        }
                    }
                }).show(url);

. URL- "complete", URL-, .

+1

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


All Articles