【问题标题】:Xamarin Auth's KeyStore storing is not working as expected on Android. (iOS works fine)Xamarin Auth 的 KeyStore 存储在 Android 上无法按预期工作。 (iOS 工作正常)
【发布时间】:2016-07-13 20:23:58
【问题描述】:

我正在使用 Xamarin.forms 制作应用程序。

我想将 UUID 存储在从服务器生成的手机中。 即使卸载了应用程序,也不能删除它。 这在 iOS 上很常见。 (保存在钥匙串中)

所以,我添加了 Xamarin.Auth 并编写了这样的代码。 https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/general/store-credentials/

它在 iOS 上运行良好。卸载应用后会保存值。

但在 Android 上。卸载应用程序后它就消失了! 这是什么鬼?

我看到了这个链接。 Android: Save file permanently (even after clear data / uninstall)

是 Xamarin.Android 的 bug 还是正常行为?

谢谢。

【问题讨论】:

    标签: xamarin xamarin.android xamarin.forms


    【解决方案1】:

    正如该帖子中所指出的,在Android 中,没有在卸载应用程序后保存内容的本机方法。当应用程序被删除时,其中的所有数据都应该被删除。

    在未经用户同意的情况下这样做也是一个坏主意。

    无论如何,您可以尝试在用户 SD 卡中保存一些数据,但如果用户没有 SD,您就完成了。也许有一些 hack,或者使用 root 可以保存在内部存储中,但我不建议这样做。

    【讨论】:

    • 再次感谢@jzeferino。好的。我将不得不获取设备的一些 id 而不是从服务器生成的 uuid。
    • 嗨,@jzeferino 如果你不介意,你能看看我的新问题吗?我真的很努力,但结果并不好。 stackoverflow.com/questions/38963497/…
    猜你喜欢
    • 1970-01-01
    • 2019-01-10
    • 1970-01-01
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 2021-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多