【问题标题】:iOS Push notifications on iP6siP6s 上的 iOS 推送通知
【发布时间】:2016-07-27 06:08:46
【问题描述】:

应用程序将推送通知推送给 iPhone 4/5 上的用户。但是在 iPhone 6s 上,同一用户不会收到推送通知。 iPhone 6s 确实应用了允许在设备上和通过应用程序进行通知的设置。 关于为什么会发生这种情况的任何想法?

【问题讨论】:

  • 验证您在不同设备中为同一用户使用了正确的推送令牌。
  • 您是否在 APNS 中注册了您的设备

标签: ios iphone push-notification apple-push-notifications iphone-6


【解决方案1】:

你必须检查:-

1- 您在开发和生产中的 PushNotification 认证。

2- 您用于开发和生产的配置文件。

3- 为开发和生产生成 PEM 文件。

4- 向您的服务器发送正确的设备令牌。

5- 在服务器中使用正确的 PEM 文件和正确的设备令牌发送 通知。

6- 检查您的设备设置以允许您的 APP 的 PushNotification。

希望能帮到你。

【讨论】:

    【解决方案2】:

    您的 iPhone 6 可能装有 iOS 8 或更高版本。

    在 didFinishLaunchingWithOptions 您必须注册推送通知,如下所示。

    if #available(iOS 8.0, *)
    {
    
        if application.respondsToSelector("isRegisteredForRemoteNotifications")
        {
    
            let types:UIUserNotificationType = ([.Alert, .Sound, .Badge])
    
            let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil)
    
            application.registerUserNotificationSettings(settings)
            application.registerForRemoteNotifications()
        }
    
    }
    else{
            let types: UIRemoteNotificationType = [.Alert, .Badge, .Sound]
            application.registerForRemoteNotificationTypes(types)
    }
    

    【讨论】:

      猜你喜欢
      • 2013-01-26
      • 2021-07-20
      • 2013-08-06
      • 1970-01-01
      • 1970-01-01
      • 2017-04-19
      • 2011-08-07
      • 1970-01-01
      相关资源
      最近更新 更多