EricLog
Published in

EricLog

Android SMS Verification APIs

SMS 驗證應該是一個在 Android app 頗為常見的需求。一般做法都是先讓用戶填寫電話號碼,然後 app 會把電話號碼交到 backend 再透過 SMS gateway 發送含有驗證碼短訊, 當用戶收到 SMS 後再把內文的驗證碼輸入到 app 中。如果想省卻用戶輪入文字的話有一些 app 會透過 READ_SMS 權限讀取 SMS 內容來抽取驗證碼,但 Google Play 已經 限制非預設短訊 app 不可以有 READ_SMS 權限

SMS Retriever API

如果有留意過一些 app 的驗證 SMS 的話,可以發現到有一些 SMS 內文結尾會加插一些英數字符。

SMS Retriever 短訊例子

--

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eric Li

Eric Li

Hongkonger + Android developer

More from Medium

Kotlin Program Execution Flow

How to build in-app chat using Kotlin — Part 1

How to implement Login/Registration features in Android! Part 1

Android — Get Public IP Address