在我的项目中,我为一些私有库注册了用于身份验证的已实现的 AppAuth。只有项目意图没有被调用此活动,但其他库在我调试问题时在内部被调用。我发现“导航不可达”
不调用这个意图过滤器
<activity
android:name="net.openid.appauth.RedirectUriReceiverActivity"
android:exported="true"
tools:node="replace">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/appAuthRedirectScheme" />
</intent-filter>
</activity>
在库中还有另一个 RedirectUriReceiverActivity 在下面提到的 mainfest 中注册。
这个工作正常。但以上一个不起作用。
调用这个意图过滤器
喜欢
<!-- This is a workaround to avoid a build error when wrapping appauth in a library. Its suggested in this github issue: https://github.com/openid/AppAuth-Android/issues/316 -->
<activity
android:name="net.openid.appauth.RedirectUriReceiverActivity"
android:exported="true"
tools:node="replace" >
<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:scheme="unikey://" />
</intent-filter>
</activity>
只有库重定向正在工作,但应用程序重定向给出了Navigation is unreachable error.
我尝试使用 tools:node="merge" 和 "replace" 但对我不起作用。
com.psi.tempmail:/oauth2redirect/redirect?code=temp_Code&scope=openid%20profile%20offline_access%20user_api.full_access&state=RrOZ4IycIz2kyUa4BN_Syg&session_state=temp_session_state