Ios 苹果应用程序拒绝,iPad上的通知问题

Ios 苹果应用程序拒绝,iPad上的通知问题,ios,swift,ipad,app-store-connect,uilocalnotification,Ios,Swift,Ipad,App Store Connect,Uilocalnotification,我有一个应用程序,其中用户必须指定他的电话号码,然后应用程序将向他发送应用程序的激活码 我已经将我的版本上传到itunes connect,并在beta测试中发送。以下是苹果关于我的问题的信息: 2.2-出现错误的应用程序将被拒绝 2.2详情 在Wi-Fi和蜂窝网络上运行iOS 8.3的iPad上查看时,我们发现您的应用程序中存在一个或多个漏洞 具体来说,我们仍然无法收到验证码 我认为他们从未在iPad上收到过通知。我已经在模拟器上测试了它,因为我没有实际的设备,它可以工作。我只有一部iPhon

我有一个应用程序,其中用户必须指定他的电话号码,然后应用程序将向他发送应用程序的激活码

我已经将我的版本上传到itunes connect,并在beta测试中发送。以下是苹果关于我的问题的信息:

2.2-出现错误的应用程序将被拒绝

2.2详情

在Wi-Fi和蜂窝网络上运行iOS 8.3的iPad上查看时,我们发现您的应用程序中存在一个或多个漏洞

具体来说,我们仍然无法收到验证码

我认为他们从未在iPad上收到过通知。我已经在模拟器上测试了它,因为我没有实际的设备,它可以工作。我只有一部iPhone6,没有任何问题

下面是我发送本地通知的代码:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // register for sending notifications
    let notificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
    let settings = UIUserNotificationSettings(forTypes: notificationType, categories: nil)
    application.registerUserNotificationSettings(settings)
    return true
}

var localNotification:UILocalNotification = UILocalNotification()
localNotification.alertAction = "Application activation code"
localNotification.alertBody = "Here is your activation code: " + "\(randomSerialNumber)"
localNotification.fireDate = NSDate(timeIntervalSinceNow: 1 )
localNotification.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
有可能解决这个问题吗?或者我应该在真正的iPad设备上启动我的应用程序来澄清这一点

由于我使用以下代码,是否会发生此错误:

// register for sending notifications
let notificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
let settings = UIUserNotificationSettings(forTypes: notificationType, categories: nil)
application.registerUserNotificationSettings(settings)
而不是这个:

// register for sending notifications
if application.respondsToSelector("isRegisteredForRemoteNotifications")
{
    // iOS 8 Notifications
    let notificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
    let settings = UIUserNotificationSettings(forTypes: notificationType, categories: nil)
    application.registerUserNotificationSettings(settings)
} else {
    // iOS < 8 Notifications
    application.registerForRemoteNotificationTypes(.Badge | .Sound | .Alert)
}
//注册以发送通知
if application.respondsToSelector(“isRegisteredForRemoteNotifications”)
{
//iOS 8通知
让notificationType=UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
let settings=ui用户通知设置(forTypes:notificationType,categories:nil)
application.registerUserNotificationSettings(设置)
}否则{
//iOS<8通知
application.RegisterForRemotionTificationTypes(.Badge |.Sound |.Alert)
}

因为我希望我的应用程序同时在IOS 7和IOS 8版本上启动。

验证码是通过短信还是推送通知发送的?这些机制在simulatorNo上不起作用,它只是本地通知中的一个伪代码。我的客户说他现在没有钱支付短信验证费,这就是为什么验证码只是在本地通知中发送的。你把最底层的代码称为哪里?是否等待用户授予通知权限?如果用户选择不允许通知怎么办?当用户指定其电话号码并单击“继续”按钮时,将调用底部代码。应用程序启动后立即请求权限。如果用户未启用通知,则他将无法获得带有激活码的通知。因此,听起来您需要,在从操作系统收到允许通知的确认和/或通知用户在允许设置中的通知之前(假设用户拒绝接收通知),不要启用“继续”按钮