Android library for phone number verification feature in your app. Automatically copies verification code from SMS right into the app. Made by Stfalcon

Overview

SmsVerifyCatcher

codebeat badge

alt tag

A library for implementing interception of SMS with a verification code using a few lines of code.

Who we are

Need iOS and Android apps, MVP development or prototyping? Contact us via [email protected]. We develop software since 2009, and we're known experts in this field. Check out our portfolio and see more libraries from stfalcon-studio.

Download

  1. Add jitpack to the root build.gradle file of your project at the end of repositories.
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
  1. Add the dependency
dependencies {
  ...
  implementation 'com.github.stfalcon-studio:SmsVerifyCatcher:[last_version]'
}  

Usage

Add permissions to AndroidManifest.xml:

  <uses-permission android:name="android.permission.RECEIVE_SMS" />
  <uses-permission android:name="android.permission.READ_SMS" />

Init SmsVerifyCatcher in method like onCreate activity:

    smsVerifyCatcher = new SmsVerifyCatcher(this, new OnSmsCatchListener<String>() {
        @Override
        public void onSmsCatch(String message) {
            String code = parseCode(message);//Parse verification code
            etCode.setText(code);//set code in edit text
            //then you can send verification code to server
        }
    });

Override activity lifecicle methods:

    @Override
    protected void onStart() {
        super.onStart();
        smsVerifyCatcher.onStart();
    }

    @Override
    protected void onStop() {
        super.onStop();
        smsVerifyCatcher.onStop();
    }

    /**
     * need for Android 6 real time permissions
     */
    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        smsVerifyCatcher.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

You can set phone number filter:

    smsVerifyCatcher.setPhoneNumberFilter("777");

or set message filter via regexp:

   smsVerifyCatcher.setFilter("<regexp>");

That's all! Take a look at the sample project for more information

License

Copyright 2017 stfalcon.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Failed to compile in Android Studio 3.0, gradle plugin 3.0.0

    Failed to compile in Android Studio 3.0, gradle plugin 3.0.0

    Hi, it gives an error: startup failed: build file '/Users/eugene.goltsev/code/goTap-Android/app/build.gradle': 98: expecting ''', found '\n' @ line 98, column 57. falcon:smsverifycatcher:0.3.1’

    opened by GoltsevEugene 4
  • Just a query

    Just a query

    Hi, amazing library. Though I just have a question. How do i get only 4/5 digit code from any message irrespective of its content. Also i didn't understood below statement: Pattern p = Pattern.compile("\\b\\d{4}\\b"); Thanks.

    opened by Shrikant-B 2
  • java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

    java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

    Hi, I have a problem with the library, is there any way to handle this exception the first time i run the app.

    When is the first time I run my app after installing it all over again, whenever my code wants to send the permission request to the user, it throws that error, but only the first time i run it; the rest works perfecttly. when i uninstall and reinstall the app, the first time it runs, it throws that error again.

    Could you please help me?

    Thanks in advance.

    opened by Ivan-Mota 2
  • Service Not Register

    Service Not Register

    When a user decline the permission request during start of the application, and when user decline the permission, SmsVerifyCatcher.onStart() is not run as permission is not granted. And in SmsVerifyCatcher onStart(), it is defined that register service when permission granted but omStop() there is no such condition, which is resulting in an exception.

    opened by PratapRaj056 2
  • I am unable to set message code on edit text

    I am unable to set message code on edit text

    I have download project and run this project then i am unable to get callback on

    smsVerifyCatcher = new SmsVerifyCatcher(this, new OnSmsCatchListener() { @Override public void onSmsCatch(String message) { String code =parseCode(message);//Parse verification code etCode.setText(code);//set code in edit text

                Toast.makeText(MainActivity.this,"click",Toast.LENGTH_LONG).show();
                //then you can send verification code to server
            }
        }); please tell where am doing wrong any more thing we have to set?
    
    opened by anilthakur 2
  • Add check for grantResults length

    Add check for grantResults length

    A fix for

    Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
           at com.stfalcon.smsverifycatcher.SmsVerifyCatcher.onRequestPermissionsResult(SourceFile:87)
    

    crash according to Android Docs

    opened by serhuz 1
  • Misconfiguration of AndroidManifest.xml

    Misconfiguration of AndroidManifest.xml

    Hello!

    Could you remove from your AndroidManifest.xml lines inside application tag:

    android:allowBackup="true" android:label="@string/app_name" android:supportsRtl="true"

    These lines are autogenerated by Android Studio, and not required for android modules. Their presence leads to conflicts, when I try to redefine these options in my AndroidManifest.xml. So I need to do some weird workaround.

    Thank you

    opened by blumfontein 1
  • onRequestPermissionsResult deprecated method in 'androidx.fragment.app.Fragment'

    onRequestPermissionsResult deprecated method in 'androidx.fragment.app.Fragment'

    @Override
        public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
            smsVerifyCatcher.onRequestPermissionsResult(requestCode, permissions, grantResults);
        }
    

    How to convert it into registerForActivityResult()???

    opened by vjain8507 0
  • Duplicate method

    Duplicate method

    Duplicate class com.stfalcon.smsverifycatcher.OnSmsCatchListener found in modules jetified-SmsVerifyCatcher-0.3.3-runtime (com.github.stfalcon-studio:SmsVerifyCatcher:0.3.3) and jetified-smsverifycatcher-0.3.2-runtime (com.github.stfalcon:smsverifycatcher:0.3.2)

    opened by aviroop89 0
  • Permission Denied listener Added

    Permission Denied listener Added

    There was no callback or listener present for the case when user denied the requested permission. So, I added a listener named PermissionDeniedListener , and this can be called from the implementing activity, and required message to user can be shown. I have not added any external library for that, and so it is easily integrable. I have also made changes in the sample code so that you can check on your end that it should be included in your repository of this amazing library or not.

    opened by Divya0319 0
  • Received status code 401 from server: Unauthorized

    Received status code 401 from server: Unauthorized

    Hi,

    I am getting below error in my Android Studio with 'smsverifycatcher' library.

    Please tell me what is the issue.
    Android Studio - 3.3

    Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD 'https://jitpack.io/com/github/stfalcon/smsverifycatcher/0.3.2/smsverifycatcher-0.3.2.pom'. Received status code 401 from server: Unauthorized

    opened by testingflexsin 0
Releases(v0.3.3)
Owner
Stfalcon LLC
We are Stfalcon, mobile and web development company.
Stfalcon LLC
A handy phone call manager with phonebook, number blocking and multi-SIM support

Simple Dialer A lightweight app for handling your calls, no matter where are you. Comes with a handy call log for easy call initiation. There is a qui

Simple Mobile Tools 443 Jan 6, 2023
SIMNumberSetter - A small Xposed module to set the SIM card's phone subscriber number

SIM Number Setter SIM Number Setter is a small Xposed module that invokes normal

Kieron Quinn 99 Dec 30, 2022
Library to read incoming SMS in Android for Expo (React Native)

react-native-expo-read-sms Maintainers maniac-tech Active maintainer Installation Install this in your managed Expo project by running this command: $

Abhishek Jain 15 Jan 2, 2023
an android app to send private secret SMS while terrorist Islamic republic of Iran banned internet access in Iran.

Mahsa An android application which is designed to deliver safe and encrypted messages using SMS while Islamic republic of Iran banned Iranian people a

null 3 Sep 22, 2022
Android SMS receiver with firestore and Jetpack compose

Android SMS Receiver Android SMS receiver with firestore and Jetpack compose App

Hakan Meral 2 Sep 14, 2022
Scans all the SMS of an Android device for any known domain that is related with the spyware Predator by Cytrox / Intellexa.

Συχνές ερωτήσεις και απαντήσεις Τι είναι το Predator; Ποιο είναι το ρίσκο μου να έχω δεχθεί επίθεση με το Predator; Πώς δουλεύει η εφαρμογή SMS Predat

Andronikos Koutroumpelis 14 Dec 6, 2022
SMSfirsAJ - Sample of how to intercept a SMS with BroadcastReceiver

SMS Received Sample of how to intercept a SMS with BroadcastReceiver Simples ste

null 0 Jan 7, 2022
⏺ A simple android app to browse your phone call recordings

⏺ Reky A simple android app to browse your phone call recordings [Under Construction] ✅ TODO Support more file name formats ?? Built-with MVVM with Si

theapache64 12 Feb 8, 2022
An Android app to watch anime on your phone without ads.

Anime X Stream An Android app to watch anime on your phone without ads. WARNING: THIS IS A BETA VERSION of application, THEREFORE YOU MAY ENCOUNTER BU

Mukul Banga 2.2k Jan 4, 2023
A lightweight, feature-rich wrapper for the Telegram Bot API, providing a handy Kotlin DSL to quickly build your bot.

Kotlin Telegram Bot Kotlin based wrapper over Telegram API. Current version of the Telegram Api: 6.0 Principles Annotations Magic. The basic interacti

Jey 61 Dec 27, 2022
NamelessnessR is a vpn hub that combines a number of vpn protocols to provide a hub to a single vpn powerful to protect your privacy only.

NamelessnessR Design concept The Design concept is designed using adobe xd basing of different ideas but mainly Anxray, V2rayNG and NamelessnetX with

mxbhaee 2 Jan 13, 2022
NamelessnessR is a vpn hub that combines a number of vpn protocols to provide a hub to a single vpn powerful to protect your privacy only.

namelessnexR Design concept The Design concept is designed using adobe xd basing of different ideas but mainly Anxray, V2rayNG and NamelessnetX with N

mxbhaee 2 Jan 13, 2022
Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone.

####Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone. This application will scan throug

Simon Marquis 251 Jan 6, 2023
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
Feature toggle library for Android

FeatureToggle Feature toggle library for Android. Overview FeatureToggle library allows to configure features of Android application in runtime using

QIWI 15 Jan 8, 2023
A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially made with HUAWEI APIs

HuaweiGlobalNewsApp A news app made using android studio in Java with features like favourite news, Location detector for local news, and especially m

Christian Imanuel Hadiwidjaja 1 Oct 30, 2021
Attendance Management app made in Kotlin for students. Made during ASJ, Google Developer Students Club, AITR Indore

Android-Study-Jams Attendance Management Problem Statement: Based on the observation, there is no available student attendance system in many educatio

null 5 Dec 2, 2022
YourStore app made in Kotlin for Local e-commerce. made during ASJ, Developer Students Club, BIT Mesra

Android-Study-Jams YourStore , Vocal for Local Problem Statement: Over past two years, local businesses have faced lot of troubles due to Covid-19 and

Mayukh Pankaj 4 Apr 24, 2022
An android app will start when boot and exit after 1s. Develop for Redmi K40 to enable DC dimming automatically.

An android app will start when boot and exit after 1s. Develop for Redmi K40 to enable DC dimming automatically.

Ovear 4 May 13, 2022