还有另一种在iOS中启动Messages应用程序的方法吗? (捐款) [英] Is there another way of launching the Messages app in iOS? (for donations)

查看:166
本文介绍了还有另一种在iOS中启动Messages应用程序的方法吗? (捐款)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试提交一个制作慈善短信捐款的iOS应用。我们过去做过很多这样的事情没有问题;但Apple不再愿意接受我们的做法并拒绝了我们的应用程序。

We're trying to submit an iOS app that makes charitable SMS donations. We've done a number of these in the past without issue; but Apple is no longer willing to accept our approach and have rejected our app.

他们声称该应用程序不符合指南第21.2点的要求。这是:

Their claim is that the app doesn't comply with point 21.2 of the guidelines. Which is:


21.2 捐款集合必须通过Safari网站或短信

21.2 The collection of donations must be done via a web site in Safari or an SMS

过去,在当前的应用程序中,我们使用 MFMessageComposeViewController 用于构建SMS消息的 MessageUI 框架。我们用这个是因为;作为对短代码的捐赠,我们需要能够在消息中写一个关键字。

In the past, and in this current app, we are using MFMessageComposeViewController in the MessageUI framework to build the SMS message. We use this because; being a donation to a shortcode we need to be able to write a keyword in the message.

在解决方案中心进行一些来回(和拒绝争议)我能从Apple获得的关于我们应该做的最多的事情是:

After a bit of back-and-forth in the Resolution Center (and a Rejection Dispute) the most I can get out of Apple about what we're supposed to do is:


从应用程序内发送短信可能不符合App Store指南。

Sending SMS messages from within the app may not be in compliance with the App Store guidelines.


SMS链接应启动消息以进行捐赠。

The SMS link should launch Messages to make the donation.

我们可以使用短信: 网址方案为特定号码启动消息应用,但该方法不允许我们添加所需的关键字。

We can use the sms: URL scheme to launch the Messages app for a certain number, but that method doesn't allow us to add our required keyword.

所以问题是:有没有人知道推出消息应用程序的另一种方式?

So the question is: Does anyone know of another way of launching the Messages app?

我们的后备选项是放弃自己建立一条短信,并发出警告,告诉用户 Text YYYY to ZZZZ 这是一个相当糟糕的用户体验。

Our fallback option is to give up building an SMS message ourselves and have an alert that tells the user "Text YYYY to ZZZZ" which is a pretty poor user experience.

更新(2013年3月5日):

我们再次重新提交应用程序我们仅提供警报的后备选项...出于同样的原因再次遭到拒绝。我们再次与Apple竞争。

We resubmitted the app again with our alert-only fallback option ... it was rejected again for the same reasons. We are, again, contesting it with Apple.

更新(2013年3月6日):

向Apple发出严厉的消息后,解释了显而易见的......该应用程序已通过提交。

After a stern message to Apple explaining the obvious... the app has passed submission.

我写的:


我们不同意。该应用程序不包括在应用程序内收集慈善捐款的能力。它只会告知用户他们如何捐赠。

We have to disagree. The app does not include the ability to collect charitable donations within the app. It only informs the user on how they can donate.

所以;如果你有同样的问题,我建议你先试着抱怨你的应用程序。

So; if you have the same problem I suggest trying to complain first before going about 'fixing' your app.

推荐答案

是和否。

基本级别:否。我查看了文档,而您(相当令人沮丧)无法为您的邮件设置正文从外部调用消息应用程序时。

On a basic level: NO. I have had a look through the docs and you (rather frustratingly) cannot set a body for your message when calling the Messages app externally.

您只能:


  1. 打开消息应用程序

  1. Open the messages app

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]];


  • 输入一个号码给

  • Input a number to message to

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:+1234567890"]];
    







  • 更复杂:是。以下是使用正文发送短信的方法和代码。它提供的视图与作为ModalView的消息应用程序完全相同。供参考你可以在这里阅读文档


    More Complex: YES. Here is the method and code to send an SMS with body. It presents a view exactly like the messages app as a ModalView. And for reference you can read the docs here.


    1. 导入 MessageUI 项目框架

    将这些添加到视图的.h,发送消息的操作是打开的(在我的例子中是一个带有单个按钮的简单视图)。

    Add these to the .h of the view that the action to send a message is on (in my case a simple view with a single button).

    #import <MessageUI/MessageUI.h>
    #import <MessageUI/MFMessageComposeViewController.h>
    


  • 发送邮件的重要代码应类似于:

  • The important code to send the message should be similar to:

    -(IBAction)sendSMS:(id)sender {
    
        if([MFMessageComposeViewController canSendText]) {
            MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
            controller.body = @"Hello";
            controller.recipients = [NSArray arrayWithObjects:@"+1234567890", nil];
            controller.messageComposeDelegate = self;
            [self presentViewController:controller animated:YES completion:nil];
        }
    }
    







  • 上面的代码不会发送文本或取消视图,因为我们还没有实现 messageComposeViewController:didFinishWithResult:方法 - 文档为此可以阅读此处。这将如下所示:


    The above code will not send texts or cancel the view as we have not implemented the messageComposeViewController:didFinishWithResult: method - the docs for this can be read here. This will look like the following:

    - (void)messageComposeViewController:(MFMessageComposeViewController *)controller 
                     didFinishWithResult:(MessageComposeResult)result {
        switch(result) {
            case MessageComposeResultCancelled:
                // user canceled sms
                [self dismissViewControllerAnimated:YES completion:nil];
                break;
            case MessageComposeResultSent:
                // user sent sms
                //perhaps put an alert here and dismiss the view on one of the alerts buttons
                break;
            case MessageComposeResultFailed:
                // sms send failed
                //perhaps put an alert here and dismiss the view when the alert is canceled
                break;
            default:
                break;
        }
    }
    

    在每种情况下,您都可以提出警报,解雇视图(如案例1)或您的应用所需的任何内容。

    In each case you can you can present alerts, dismiss the view (as in case 1), or anything your app requires.

    我确信第二种方法应该获得批准,否则Apple应将其从文档中删除。但关键是 canSendText if语句。如果没有实现(或 didFinishWithResult 的案例切换),Apple肯定会拒绝该应用程序。

    I am sure this second method should be approved or Apple should remove it from their documentation. The key thing though is the canSendText if statement. If this (or the case switch for didFinishWithResult) is not implemented Apple will certainly reject the app.

    这篇关于还有另一种在iOS中启动Messages应用程序的方法吗? (捐款)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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