File tree 2 files changed +15
-1
lines changed
src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/src/main/java/com/immutable/unity
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -87,3 +87,5 @@ src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/**/*.meta
87
87
88
88
# WebView.bundle
89
89
src /Packages /Passport /Runtime /ThirdParty /Gree /Assets /Plugins /WebView.bundle /** /* .meta
90
+
91
+ * .idea
Original file line number Diff line number Diff line change 6
6
import android .net .Uri ;
7
7
import android .os .Build ;
8
8
import android .os .Bundle ;
9
+ import android .os .Handler ;
10
+ import android .os .Looper ;
9
11
10
12
import androidx .annotation .NonNull ;
11
13
import androidx .annotation .Nullable ;
@@ -95,7 +97,17 @@ private void launchCustomTabs() {
95
97
@ Override
96
98
public void onNavigationEvent (int navigationEvent , @ Nullable Bundle extras ) {
97
99
if (navigationEvent == CustomTabsCallback .TAB_HIDDEN && callbackInstance != null ) {
98
- callbackInstance .onCustomTabsDismissed (uri .toString ());
100
+ // Adding some delay before calling onCustomTabsDismissed as sometimes this gets called
101
+ // before the PKCE deeplink is triggered (by 100ms). This means pkceCompletionSource will be
102
+ // set to null before the SDK can use it to notify the consumer of the PKCE result.
103
+ // See PassportImpl.OnLoginPKCEDismissed and PassportImpl.OnDeepLinkActivated
104
+ final Handler handler = new Handler (Looper .getMainLooper ());
105
+ handler .postDelayed (new Runnable () {
106
+ @ Override
107
+ public void run () {
108
+ callbackInstance .onCustomTabsDismissed (uri .toString ());
109
+ }
110
+ }, 1000 );
99
111
}
100
112
}
101
113
});
You can’t perform that action at this time.
0 commit comments