微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 openid / AppAuth-Android 的重定向 URI 中的多实例

如何解决使用 openid / AppAuth-Android 的重定向 URI 中的多实例

当我使用这个库时: https://github.com/openid/AppAuth-Android

在尝试使用深层链接和打开应用程序时遇到问题。在这种情况下,我的应用程序有一个具有相同名称和包名称的多实例。我只想举一个例子。 (当我触摸其中一个实例时会发生重定向,但触摸另一个实例时什么也没有发生)

一切正常,只有我有这个问题。 我也看到了这些问题:

https://github.com/openid/AppAuth-Android/issues/329

https://github.com/openid/AppAuth-Android/issues/481

https://github.com/openid/AppAuth-Android/issues/491

这是我在清单中的代码

<activity
            android:name=".util.deeplink.appAuth.RedirectUriReceiverActivity"
            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="test"
                    android:host="ops" />
            </intent-filter>
        </activity>

解决方法

我们找到了解决方案。我们只需要添加

<activity android:name="net.openid.appauth.RedirectUriReceiverActivity"
            tools:node="replace"/>

除了我们的自定义类:

<activity
            android:name=".util.deeplink.appAuth.RedirectUriReceiverActivity"
            android:windowSoftInputMode="stateAlwaysHidden">

进入清单文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。