SMS Retriever API ile otomatik SMS doğrulaması
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
SMS Retriever API'si ile kullanıcının doğrulama kodlarını manuel olarak yazmasını gerektirmeden ve ekstra uygulama izni gerektirmeden Android uygulamanızda otomatik olarak SMS tabanlı kullanıcı doğrulaması gerçekleştirebilirsiniz. Uygulamanızda otomatik SMS doğrulamasını uyguladığınızda, doğrulama akışı aşağıdaki gibi görünür:

- Bir kullanıcı, uygulamanızda SMS doğrulamasını başlatıyor. Uygulamanız, kullanıcının hesabını oluşturmak için bu bilgilerin gerekli olmadığı durumlarda telefon numarası sağlamasını isteyebilir veya Şifreler için Smart Lock ipucu seçiciyi kullanabilir.
- Uygulamanız, kullanıcının telefon numarasını doğrulamak için sunucunuza bir istek gönderir.
Kullanıcı veritabanınızda hangi bilgilerin olduğuna bağlı olarak bu istek kullanıcının kimliğini, kullanıcının telefon numarasını veya ikisini birden içerebilir.
- Uygulamanız aynı zamanda sunucunuzdan gelen bir SMS yanıtını dinlemeye başlamak için SMS Retriever API'sini çağırır.
- Sunucunuz, kullanıcıya tekrar gönderilmesini istediğiniz tek seferlik bir kod ve uygulamanızı tanımlayan bir karma değer içeren bir SMS mesajı gönderir.
- Kullanıcının cihazı SMS mesajını aldığında Google Play Hizmetleri, mesajın uygulamanıza yönelik olduğunu belirlemek için uygulama karmasını kullanır ve SMS Retriever API'si aracılığıyla uygulamanızın mesaj metnini kullanıma sunar.
- Uygulamanız mesaj metnindeki tek kullanımlık kodu ayrıştırır ve tekrar sunucunuza gönderir.
- Sunucunuz, uygulamanızdan tek seferlik kodu alır, kodu doğrular ve son olarak kullanıcının, hesabını başarıyla doğruladığını kaydeder.
Uygulamanızda otomatik SMS doğrulamasını kullanmak için Android ve sunucu kılavuzlarına bakın:
Android Kılavuzu
Sunucu Kılavuzu
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-25 UTC."],[[["\u003cp\u003eThe SMS Retriever API enables automatic SMS verification in Android apps, eliminating manual code entry for users.\u003c/p\u003e\n"],["\u003cp\u003eThis API streamlines user verification by having your app listen for an SMS message containing a one-time code, sent by your server after a verification request.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Play services identifies the incoming SMS message as intended for your app using an app hash included in the message, ensuring secure delivery of the verification code.\u003c/p\u003e\n"],["\u003cp\u003eThe SMS Retriever API enhances user experience and security by automating verification without requiring extra app permissions.\u003c/p\u003e\n"]]],[],null,["# Automatic SMS Verification with the SMS Retriever API\n\nWith the SMS Retriever API, you can perform SMS-based user verification in your\nAndroid app automatically, without requiring the user to manually type\nverification codes, and without requiring any extra app permissions. When you\nimplement automatic SMS verification in your app, the verification flow looks\nlike this:\n\n[](/static/identity/sms-retriever/flow-overview.png)\n\n1. A user initiates SMS verification in your app. Your app might prompt the user to provide a phone number or use the [Smart Lock for Passwords hint selector](/identity/smartlock-passwords/android/retrieve-hints) if that information wasn't required to create the user's account.\n2. Your app makes a request to your server to verify the user's phone number. Depending on what information is available in your user database, this request might include the user's ID, the user's phone number, or both.\n3. At the same time, your app calls the SMS Retriever API to begin listening for an SMS response from your server.\n4. Your server sends an SMS message to the user that includes a one-time code to be sent back to your server, and a hash that identifies your app.\n5. When the user's device receives the SMS message, Google Play services uses the app hash to determine that the message is intended for your app, and makes the message text available to your app through the SMS Retriever API.\n6. Your app parses out the one-time code from the message text and sends it back to your server.\n7. Your server receives the one-time code from your app, verifies the code, and finally records that the user has successfully verified their account.\n\nTo implement automatic SMS verification in your app, see the Android and server\nguides:\n\n[Android Guide](/identity/sms-retriever/request)\n[Server Guide](/identity/sms-retriever/verify)"]]