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

406 Views Asked by At

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

0

There are 0 best solutions below