How to programmatically send a text message after

2019-07-23 14:59发布

问题:

I'm writing an app where I need to be able to send texts in the background. I saw this very comprehensive answer to a similar question that explains how to send text messages through an interface with the user and the various limitations of sending messages programmatically, but it didn't really address another possibility: is it possible for the user to grant permission to my app to send messages in the background similar to how the user must grant permission to an app to access the user's photos? For example, upon starting up the app for the first time, a prompt appears asking the user for permission to send text messages. If the user grants permission, then the app can send messages in the background. Is that possible?

回答1:

The answer to this question is that you can't. There are some jailbreak apps that accomplish this but they require just that, a jailbreak (and private APIs). There is no App Store allowed way to do this.