'Callback on successful login for sso on chromeCustom tab
I am using CCT for sso Login.now once the login is successful, the cct is not coming back to app.
Suppose the success url contains "com.example.success://hello/success" m adding data as
<activity
android:name=".ExampleActivity"
android:exported="true">
<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="hello/success"
android:scheme="com.example.success"/>
</intent-filter>
</activity>
From ExampleActivity i am launching CCT
val customTabsIntent = CustomTabsIntent.Builder() .addDefaultShareMenuItem() .setShowTitle(true)
.build()
CustomTabsHelper.addKeepAliveExtra(this, customTabsIntent.intent)
CustomTabActivityHelper.openCustomTab(
this, customTabsIntent, Uri.parse(authorizationUrl)
) { activity, uri ->
val intent = Intent(Intent.ACTION_VIEW, uri)
activity.startActivity(intent)
}
Solution 1:[1]
You are confusing of declare attribute for deeplink. Read this for more information https://developer.android.com/training/app-links/deep-linking#adding-filters
<data
android:host="hello"
android:pathPrefix="/success"
android:scheme="com.example.success"/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Loc Le Xuan |