如何在iOS上发送短信而不需要让用户同意? [英] How do I send an SMS on iOS without having to get the user to ok it?

查看:184
本文介绍了如何在iOS上发送短信而不需要让用户同意?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从iOS应用程序向某人发送文本消息(通过本机或通过使用API​​),而无需他们事先与该消息进行交互?

How can I send a text message (natively or through the use of an API) from an iOS application to someone without having them have to interact with the message before hand?

该消息将被预先编写并在屏幕上点击发送.如果用户需要一次也可以,但是我需要一种发送消息的方式,而不必每次都与用户的设备进行交互.

The message would be prewritten and would send on tap of screen. Its ok if the user needs to okay it once, but I need a way to send a message without having to have the user interact with their device each time.

示例: 电话关闭,我摇了摇手机,电话感觉到了摇晃,并通过SMS或MMS向其他用户发送了我在摇"的短信,而无需用户确定发送.这可能吗?我该怎么办?

Example: Phone is off, I shake phone, phone senses shake, sends text messaging saying "I'm shaking" to another user via SMS or MMS without having the user need to OK the sending. Is this possible? How would I do it?

推荐答案

您不能这样做.您需要在 MFMessageComposeViewController 首先弹出,他必须自己发送.

You can't do that. You need to show the user the message in the MFMessageComposeViewController that pops up first, and he has to send it by himself.

之所以设置此限制,是因为否则,许多应用程序可能会向您的联系人等发送大量短信,甚至向短信发送昂贵的短信.

This restriction was made, because otherwise, many apps could spam your contacts etc. with a massive amount of sms or they could even write sms to expensive numbers.

但是,如果您只想向其他用户发送某种通知,则可以使用推送通知.为此,我建议您使用 parse.com 及其免费的推送通知服务.另外,由于推送通知是免费的,因此与SMS相比,您可以节省很多钱.当然,在发送通知之前,您需要做一些准备,但是那样可以.但是也有限制.一个限制是,通知的接收者还必须在接收设备上安装该应用.

But if you want to send just some kind of notification to another user, you could use push notifications. To do that, I would recommend you to use parse.com and their free push notification-service. Also, because Push Notifications are free, in contrast to SMS, you will save a lot of money. Of course you need to make some preparations before you can send notifications, but that way you could do it. But also there are restrictions. One restriction is, that the receiver of the notification also must have the app installed on the receiving device.

所以接收者会收到这样的消息":

So the receiver would receive a "message" like that:

因此,我建议您检查来自Parse的快速入门指南. com for iOS 了解更多信息.该指南非常简单,它一步一步地向您展示了如何激活您的应用程序以进行推送通知.

So I would recommend you to check the QuickStart Guide from Parse.com for iOS for further informations. The Guide is really simple and shows you step by step how to activate your app for Push notifications.

这篇关于如何在iOS上发送短信而不需要让用户同意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆