Fit Bit Login, using Chrome Custom Tabs, no call back in my Application

对着背影说爱祢 提交于 2019-12-11 16:15:20

问题


I am trying to integrate FIT BIT login in my android application .

but i am not getting any call back in my application when the login is successful

I am using this reference fit bit link

As in the document we cannot use web view so i used Chrome Custom Tabs .

this is my redirect URL = "http://52.9.44.227:3000/feed"

which is returned from the url

this is my manifest for getting call back

  <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

            <data
                android:host="52.9.44.227:3000"
                android:pathPrefix="/feed"
                android:scheme="http" />

        </intent-filter>

    </activity>

This is my java code to launch the web URL by fit bit.

 void launchTab(final Context context, final Uri uri){
    final CustomTabsServiceConnection connection = new CustomTabsServiceConnection() {
        @Override
        public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient client) {
            final CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
            final CustomTabsIntent intent = builder.build();
            client.warmup(0L); // This prevents backgrounding after redirection
            intent.launchUrl(context, uri);
        }
        @Override
        public void onServiceDisconnected(ComponentName name) {

        }
    };
    CustomTabsClient.bindCustomTabsService(context, "com.android.chrome", connection);
}

this is the URL is trying hit for fit bit login

fit bit login link

来源:https://stackoverflow.com/questions/52629467/fit-bit-login-using-chrome-custom-tabs-no-call-back-in-my-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!