i have an sms verification system. that verification code will be sent to user phone. i want to read it automatically and add it to a text field in Unity. how can i do that?
i have an sms verification system. that verification code will be sent to user phone. i want to read it automatically and add it to a text field in Unity. how can i do that?
You will need to use the Android API BroadcastReceiver and registered with SMS_RECEIVED_ACTION (can be done statically in XML). For Unity you should be able to access those by using a plugin, see https://docs.unity3d.com/Manual/PluginsForAndroid.html.
However, Id note that as a Android user, generally Id not give some random game off the app store the RECEIVE_SMS permission required for that.
Is your purpose to validate the phone number of a user account? You can get the number with TelephonyManager but again it needs a permission (READ_PHONE_STATE).
Both RECEIVE_SMS and READ_PHONE_STATE are considered dangerous permissions and may be denied and even revoked after installation.