Tag: 推送通知

如何从亚马逊SNS主题取消订阅iOS设备?

我正在使用Amazon Web Services的Simple Notification Service(SNS)开发iOS应用程序。 此时,应用程序将设备注册到主题,并可以接收发布到主题的推送通知。 可以将设备订阅到许多主题。 现在我试图从特定主题取消订阅设备,但SNSUnsubscribeRequest需要一个SubscriptionARN。 我尝试过使用设备上的EndpointARN,但似乎我必须为EndpointARN和TopicARN的组合使用额外的SubscriptionARN。 我如何得到这个ARN? 在这篇文章中: 你如何获得订阅的阿恩? 他们要求整个用户列表,并将每个EndpointARN与设备的EndpointARN进行比较。 这不能是我想的正确的方式。 订阅主题 // Check if endpoint exist if (endpointARN == nil) { dispatch_async(dispatch_get_main_queue(), ^{ [[self universalAlertsWithTitle:@"endpointARN not found!" andMessage:@"Please create an endpoint for this device before subscribe to topic"] show]; }); return NO; } // Create topic if not exist NSString *topicARN […]

延迟推送通知,并检查用户是否启用它

我开发了一个应用程序,围绕推送通知构build。 仅当用户到达注册过程的某个点时,应用才会请求通知权限。 我已经设法做到以下几点: 该应用程序维护一个NSUserDefaultsvariables,该variables指示是否需要在启动时注册为推送(默认情况下:不) 当注册到达那个点时,我翻转variables并调用-registerForRemoteNotificationTypes:在iOS 7上和-registerUserNotificationSettings:在iOS 8上 这工作正常,除非用户已经启用推送通知,然后在设置中稍后禁用它们。 在这种情况下,我尝试在启动时重新注册Push,它不会调用-application:didRegisterForRemoteNotificationsWithDeviceToken和-application:didFailToRegisterForRemoteNotificationsWithError 。 额外的信息,iOS 8的-isRegisteredForRemoteNotifications也返回YES 。 (我没有testing,但是假设-enabledNotificationTypes适用于iOS 7) 我怎样才能检测到这种情况,并向用户提供一个请求者,要求他在设置中重新启用通知?

iOS推送通知不适用于临时分发与testing飞行

有一个奇怪的问题… 在我的AppDelegate.m中,我有以下几点: -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO]; // Override point for customization after application launch. // Enable test flight reporting; https://testflightapp.com/sdk/doc/0.8.3/ [TestFlight takeOff:@"myTestFlightToken"]; // Let the device know we want to receive push notifications [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; return YES; } -(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { NSString *tokenAsString = […]

iOS 8.1推送通知没有声音

该设备在iOS 8.1上运行 我正在使用xCode 6.1编译应用程序。 这是注册推送的代码 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [application registerForRemoteNotifications]; } else { [application registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; } 它在应用程序向服务器注册时工作正常。 PEM文件也正确完成,因为我可以使用沙箱APN将设备发送到我的设备。 当我从didReceiveRemoteNotification打印我的JSON有效载荷时,我得到这个: { aps = { alert = "Test Push Message"; }; } 问题是,当我收到我的推(即使设备设置为大声),它不会发出声音。 据我所知,如果你没有在JSON载荷中指定声音,它应该播放默认的OS声音。 在我手机上的应用程序通知设置声音默认启用,因为当我注册我指定UIUserNotificationTypeSound 。 任何人遇到这个问题?

推送通知需要很长时间才能到达

我在iOS和Android的Adobe AIR应用程序中推送通知时出现了一个奇怪的问题。 我使用Milkman Games的Easy Push ANE以及One Signal服务。 问题在于通知确实到达,但有时(随机),消息在发送后最多可能需要15分钟才能到达设备。 这对于我的应用程序(出租车预订应用程序)是至关重要的,因为我依靠出租车应用程序和用户应用程序之间的通信的推送通知。 因此,例如,如果用户请求出租车,可能需要长达15分钟的时间才能通知出租车应用程序。 谈到一个信号的支持,并根据他们一切都没问题,如果我看一个信号仪表板,通知几乎是即时交付。 可能是这个延误的原因是什么? 我能做些什么来使事情变得更好? 谢谢。

GCM下游消息JSON格式的iOS

我有一个使用GCM的swift / iOS9应用程序的通知(WIP)。 应用程序授权确定。 证书是可以的。 configuration文件确定。 一切都在苹果的开发者门户开发configuration。 收到通知时调用此函数。 func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { GCMService.sharedInstance().appDidReceiveMessage(userInfo); print(userInfo.debugDescription) } 问题 当服务器发送以下格式时,我只能检测到前面介绍的函数中的通知,并且“有效”,因为我有一个断点来检测它,否则什么都不会发生。 { "registration_ids" : ["regId"], "data" : { "to" : "regId", "notification" : { "sound" : "default", "badge" : "2", "title" : "anyTitle", "body" : "anyMessage" } } } 负责web服务的负责人为我做了这个,并且复制了现有的Android(“registration_ids”是否有用?)。 由于行为不是预期的行为,我们从GCM网站上试了一下: {“to”:“regId”,“content_available”:true,“notification”:{“body”:“很棒的比赛!”,“title”:“Portugal vs. Denmark”}} […]

计划通知与Firebase和后台运行

我希望我的Firebase将计划的推送通知发送给我的应用程序的所有用户,并且该应用程序在后台; 运行一些代码并发送一些东西到服务器。 我有点遗憾,因为从Firebase的通知控制台无法这样做。 然后,我对Firebase云消息传递感兴趣,但在文档中说,应该结束与FCM的连接: 当你的应用程序进入后台,从FCM断开连接 – 来源 我能做什么? 我应该看看像Parse这样的服务吗? 任何帮助是极大的赞赏。

iOS8检查remotenotificationtype的权限

我可以检查用户在iOS8之前是否允许通知(警告)权限: UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; if (types & UIRemoteNotificationTypeAlert) { //user granted } 它不是在iOS8上工作,它说: iOS (3.0 and later) Deprecated:Register for user notification settings using the registerUserNotificationSettings: method instead. 控制台说: enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. 那么我如何才能在iOS 8上检查它?

捕捉答案“应用程序想发送推送通知”警报

第一次在你的UIApplication对象上调用registerForRemoteNotificationTypes: , a UIAlertViewpopup“[app]想要发送推送通知”。 有没有什么办法知道什么时候在这个AlertView点击“OK”或“Do not allow”? 当前application:didRegisterForRemoteNotificationsWithDeviceToken:在我的AppDelegate上调用,即使在用户做出决定之前。 我问的原因是因为在第一次启动时,我想推送一个ViewController与Notification选项,但只有当用户表示他们想要接收通知。

从Banner /自定义操作启动应用程序时,不会调用applicationDidBecomeActive

我在尝试实现iOS-8的新交互式通知时遇到了这个奇怪的问题。 在处理本地通知时,一切都按预期工作,但对于APNS来说,事情并不奏效。 详细信息:我得到了自定义推送,因为它应该通过横幅(我只注册到最小的上下文),但是当用户点击代表自定义操作的button时,我的应用程序的代表applicationDidBecomeActive:不被调用; 事实上 – 应用程序卡在非活动模式。 奇怪的是,从Notifications(通知)屏幕启动时,应用程序会进入活动模式(“Today”(当前)的右侧)。 除此之外,在这两种情况下,我的代表: handleActionWithIdentifier:forRemoteNotification:completionHandler: 确实使用正确的标识符进行调用。 任何帮助将非常感激!