I\'m an iOS developer and i have tried to build a mobile application with automatic activation functionality, i found more than way to read SMS message but only using privat
For Swift 5:
From iOS 12 Apple has given support to read the security code (OTP - One Time Passwords) in text fields.
if #available(iOS 12.0, *) {
otpField.keyboardType = .default
otpField.textContentType = .oneTimeCode
} else {
// Fallback on earlier versions
}
Or you can add this contentType from storyboard like below: