Android – Facebook account suite redirects to my app

I created a Facebook accountkit demo. I'm logging in using email. It sent an email on my Gmail account. I verified the email link, and then I got an "open application" link. I want to redirect my application after clicking this button, but I can't do this. When clicking the "open application" button, It remains on the browser only

The library I'm using is below

compile 'com.facebook.android:account-kit-sdk:4.+'

For reference, please refer to the figure below

[attached figure] [1]: http://i.stack.imgur.com/TE2F5.png

Please tell me how to solve this problem

resolvent:

The open application button has a link that is not valid at this time because your application cannot process it

It looks like this:

ak21************7://authorize/

Copy this link and use it in androidmanifest.xml to define intent filter, so when you click it, your application will start. Like this:

<activity android:name=".ui.activity.DeepLinkActivity" >
    <!-- For Facebook Account Kit -->
    <intent-filter android:label="@string/app_name">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="ak21************7" />
    </intent-filter>
</activity>

Because you started accountkitactivity at login to get results, you need to return to this screen and your registration process will be completed, and your onactivityresult will be called

You can achieve this by defining a blank activity that automatically closes. This is the same as the activity of processing intent filter mentioned above. The activities are as follows:

public class DeepLinkActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        finish();
        return;
    }

}

After adding these, the "open application" button works. It takes me back to the application and my registration process is completed

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>