基于Android SMS的用户验证通用流

发布于 2025-01-24 06:08:19 字数 189 浏览 2 评论 0原文

我有一些使用Android SMS ReTriever API的Android应用程序来执行基于SMS的用户验证。我想知道是否有一种一致的方法可以通过SMS对用户进行身份验证,而不是使用我创建的每个应用程序实现它。我正在考虑创建一个身份验证应用程序,并将每个应用程序都可以调用的所有实现或某种巧妙的方法来巩固入门SMS验证流。实现这一目标的一些好实践/建议是什么。

I have a few different Android apps which use Android SMS Retriever API, to perform SMS-based user verification. I am wondering if there is a consistent way to authenticate user via SMS and not implement it with every app I am creating. I was thinking about creating an authentication app and move all the implementation there which each of the apps can call or some clever way to consolidate the onboarding SMS verification flow. What are some good practices/recommendations to achieve this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生一梦 2025-01-31 06:08:19

我认为您想将SMS功能放在Android库中,并在所有应用中重复使用该库。

AS android文档状态

一个Android库在结构上与Android App模块相同。
它可以包括构建应用所需的一切,包括来源
代码,资源文件和Android清单。但是,而不是
编译成在设备上运行的APK,一个Android库
将其编译成Android存档(AAR)文件,您可以用作
Android应用模块的依赖性。

因此,诀窍是创建一个新模块逻辑和UI您需要重复使用,然后将其添加为其他应用程序的依赖关系。

I think you want to put the SMS functionality in an Android Library and reuse that library in all your apps.

As Android Documentation states:

An Android library is structurally the same as an Android app module.
It can include everything needed to build an app, including source
code, resource files, and an Android manifest. However, instead of
compiling into an APK that runs on a device, an Android library
compiles into an Android Archive (AAR) file that you can use as a
dependency for an Android app module.

So, the trick is to create a New Module that includes the business logic and the UI you need to reuse and then, you add it as dependency to the other apps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文