UNPKG

cordova-plugin-otp-retriever

Version:

Cordova plugin for automatic OTP reading using Android SMS User Consent API

54 lines (44 loc) 2.34 kB
<?xml version="1.0" encoding="UTF-8"?> <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-otp-retriever" version="1.0.0"> <name>OTP Reader</name> <description>Cordova plugin for automatic OTP reading using Android SMS User Consent API</description> <license>MIT</license> <keywords>cordova,phonegap,otp,sms,verification,android</keywords> <repo>https://github.com/VedantS20/cordova-plugin-otp-retriever.git</repo> <engines> <engine name="cordova" version=">=7.0.0" /> <engine name="cordova-android" version=">=8.0.0" /> </engines> <!-- JavaScript interface --> <js-module src="www/OTPReader.js" name="OTPReader"> <clobbers target="cordova.plugins.OTPReader" /> </js-module> <!-- Android platform --> <platform name="android"> <config-file target="res/xml/config.xml" parent="/*"> <feature name="OTPReader"> <param name="android-package" value="org.apache.cordova.otpreader.OTPReader" /> </feature> </config-file> <!-- Only READ_PHONE_STATE is needed for getPhoneNumber() function if used --> <!-- SMS User Consent API doesn't require any dangerous permissions --> <!-- No permissions needed for OTP reading functionality --> <!-- getPhoneNumber() function removed to avoid any permission requirements --> <config-file target="AndroidManifest.xml" parent="/manifest/application"> <receiver android:name="org.apache.cordova.otpreader.SMSBroadcastReceiver" android:exported="false"> <intent-filter android:priority="500"> <action android:name="com.google.android.gms.auth.api.phone.SMS_RETRIEVED" /> </intent-filter> </receiver> </config-file> <!-- Source files --> <source-file src="src/android/OTPReader.java" target-dir="src/org/apache/cordova/otpreader" /> <source-file src="src/android/SMSBroadcastReceiver.java" target-dir="src/org/apache/cordova/otpreader" /> <!-- Add Google Play Services dependencies --> <framework src="src/android/build.gradle" custom="true" type="gradleReference" /> </platform> </plugin>