我一直在尝试了解如何创建将从AWS SNS设置中接收推送通知的应用程序。iOS - 将AWS SNS端点设置为禁用
我已经创建了应用证书等,从我可以看到的东西应该工作。 我遵循一些教程,并设法让我的iOS应用程序接收从我的开发机器上本地运行的PHP脚本发送到APNS的推送通知。
我似乎缺少的东西是,当我尝试设置我的AWS SNS应用程序向我的开发设备端点发布消息时,它将状态从启用更改为禁用,没有任何推理或错误消息来自AWS控制台。
我的理解是,我使用的设备令牌是正确的,因为PHP脚本的工作原理,我的证书等工作,因为这将意味着PHP脚本将无法正常工作,我必须丢失AWS设置和iOS之间的东西建立。
一些代码:
的iOS设置 - 工作从PHP脚本收到通知
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.EUWest1, credentialsProvider: credentialsProvider)
AWSServiceManager.defaultServiceManager()
.setDefaultServiceConfiguration(defaultServiceConfiguration)
let notTypes:UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
let noteSettings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notTypes, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(noteSettings)
return true
}
func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) {
UIApplication.sharedApplication().registerForRemoteNotifications()
println("hello from user")
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
println("recieve!!")
}
AWS截图
如果任何人能想到的或发现的东西我在这里失踪对我的学习过程非常有帮助!
对此有任何帮助。我已经创建了我的证书,在我的应用程序中更新了凭据,并尽力使我的级别达到最佳状态,但终端又被禁用。请让我知道如何解决这个问题。 – 2016-06-13 07:26:59