New API allows apps to send text messages without user interaction
Critical Messaging API requires user's permission though
New API provides a way for app to send SMS to specified phone numbers. This might be useful to provide check-in functionality in areas where cellular connectivity doesn’t allow internet access.
Important considerations:
App needs
com.apple.developer.messages.critical-messaging
entitlementApp must declare
NSCriticalMessagingUsageDescription
key
in app’sInfo.plist
App must request authorization for each phone number using through
requestAuthorization(for:)
send(_:to:)
method only works if the app is backgrounded, if it’s called from foreground the framework returns aMSCriticalMessagingError.notSupported
errorThe system may impose a rate limit on frequency of messages sent
Apple Developer: Sending SMS messages from an app
Reference: