Tag: apple push notifications

检测是否应用:didReceiveRemoteNotification:fetchCompletionHandler:通过点击Notification Center中的通知来调用

application: didReceiveRemoteNotification: fetchCompletionHandler: 不同于 application: didReceiveRemoteNotification: 怎么样? 从文档: 与application:didReceiveRemoteNotification:方法不同,该方法仅在应用程序运行时调用,系统将调用此方法,而不pipe应用程序的状态如何。 如果您的应用程序被暂停或未运行,则在调用该方法之前,系统会唤醒或启动您的应用程序并将其置于后台运行状态。 如果用户从系统显示的警报中打开您的应用程序,则系统会再次调用此方法,以便您知道用户select了哪个通知。 我的努力是:我想知道用户是否通过点击通知中心的系统显示警报或者唤醒设备的静默推送通知来调用方法。 目前,据我所知,没有明显的区分办法。 – (BOOL)application: didFinishLaunchingWithOptions: 跟踪上述方法中的launchOptions不是一个解决scheme,因为只有当应用程序被挂起/不在后台运行时才被调用。 如果它在后台运行,它不会被调用。

摩卡全球泄漏错误

我试图unit testing苹果推送通知库时,我有一个全球性的泄漏错误,试图打开一个APN连接。 那是我的configuration错误还是node-apn或mocha中的错误? 我不知道我明白了checkGlobals在做什么…它只是检查是否有全局variables被设置? 0) Feed "before all" hook: Error: global leak detected: hasCert at Runner.checkGlobals (/usr/lib/node_modules/mocha/lib/runner.js:96:21) at Runner.<anonymous> (/usr/lib/node_modules/mocha/lib/runner.js:41:44) at Runner.emit (events.js:64:17) at /usr/lib/node_modules/mocha/lib/runner.js:159:12 at Hook.run (/usr/lib/node_modules/mocha/lib/runnable.js:114:5) at next (/usr/lib/node_modules/mocha/lib/runner.js:157:10) at Array.<anonymous> (/usr/lib/node_modules/mocha/lib/runner.js:165:5) at EventEmitter._tickCallback (node.js:126:26)

我应该使用哪个Apple推送通知服务Java库?

我需要使用苹果推送通知服务(APNS)将推送通知从我的Java服务器发送到iOS设备, 我发现两个库在Java中发送APNS推送通知: Java的APNS javapns 但两者似乎都被放弃了(或者至less它们有错误,最后一个版本是在一年前)。 java-apns有很多叉子 。 活跃开发中有没有更新的这个库的fork? 还有其他更好的select吗?

如何续订推送通知服务证书

对于IOS开发来说,我是个新手,对于证书的了解并不多,除了应用程序需要在苹果商店上发布的部分。 我的公司在苹果商店有几个应用程序,并且我收到一封电子邮件,其中一个应用程序说:“您的Apple推送通知服务证书将在30天内过期”。 现在,我不知道如何更新这个证书。 这是我做的… 我login到了developer.apple.com 去证书,标识符和configuration文件 位于我得到消息的应用程序 而现在,我不知道该怎么做.. 请看下面的截图,看看我结束了.. 从这里开始,我该怎么办? 证书还没有到期,我现在可以续签吗? 或者我应该等待它过期? 如果我现在可以做,我该怎么做? 点击创build证书并创build一个新的? 我该怎么做?

registerForRemoteNotificationTypes:在iOS 8.0及更高版本中不受支持

在iOS 8.x下尝试注册推送通知时: application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound) 我得到以下错误: registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later. 任何想法是什么新的做法呢? 当我在iOS 7.x上运行这个Swift应用程序时,它确实有效。 编辑 在iOS 7.x中,当我包含条件代码时,我得到(SystemVersion conditional或#if __IPHONE_OS_VERSION_MAX_ALLOWED> = 80000) dyld: Symbol not found: _OBJC_CLASS_$_UIUserNotificationSettings

此证书具有无效的发行者Apple推送服务

我已经创build了证书来启用我的应用程序中的推送服务,但是每次尝试在我的钥匙串中添加证书时,添加证书后都会显示以下错误: 这个证书有一个无效的发行者

didReceiveRemoteNotification:fetchCompletionHandler在应用程序处于后台并且未连接到Xcode时不会被调用

我有一个很奇怪的问题,我实现了: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler 无声远程推送通知。 它适用于当应用程序在后台并连接到Xcode。 当我拔下任何iOS设备并运行应用程序,移动到后台并发送远程通知, didReceiveRemoteNotification:fetchCompletionHandler不被调用。 我的代码如下: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { NSInteger pushCode = [userInfo[@"pushCode"] integerValue]; NSLog(@"Silent Push Code Notification: %i", pushCode); NSDictionary *aps = userInfo[@"aps"]; NSString *alertMessage = aps[@"alert"]; if (pushCode == kPushCodeShowText) { UILocalNotification *localNotif = [[UILocalNotification alloc] init]; localNotif.fireDate = [NSDate […]

实施PushKit并testing开发行为

我想在我的应用程序(VoIP应用程序)中实施PushKit服务,但我有以下怀疑:我看到,我只能生成生产VoIP证书,它的工作原理,如果我尝试在开发设备上testingVoIP推送通知服务? 这是我的执行testing: 通过这3行代码,我可以在didUpdatePushCredentialscallback上获取推送令牌,以便将其保存到我的服务器中。 PKPushRegistry *pushRegistry = [[PKPushRegistry alloc] initWithQueue:dispatch_get_main_queue()]; pushRegistry.delegate = self; pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP]; 服务器端我生成一个“正常”有效载荷推送通知只有警报文本,我发送到存储到我的服务器的VoIP令牌。 我使用debugging日志的callback,但他们永远不会被调用! – (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(NSString *)type { NSLog(@"didInvalidatePushTokenForType"); } -(void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type { NSLog(@"didReceiveIncomingPushWithPayload: %@", payload.description); } -(void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type { if([credentials.token length] == 0) { NSLog(@"voip token NULL"); return; } NSLog(@"didUpdatePushCredentials: […]

远程通知iOS 8

如何在iOS 8中获得远程通知的设备令牌? 我在iOS <8的AppDelegate中使用了方法didRegisterForRemoteNotificationsWithDeviceToken ,并返回了设备令牌。 但在iOS 8中,它不。

didRegisterForRemoteNotificationsWithDeviceToken不在ios8中调用,但didRegister …设置是

我跟着这个线程 ,但方法didRegisterForRemoteNotificationsWithDeviceToken仍然没有被调用: 该文件说: 在调用UIApplication对象的registerForRemoteNotifications方法后,应用程序在设备注册成功完成时调用此方法 didRegisterUser似乎很好,但did register notif 。 这是我在AppDelegate中的代码(应用程序版本是8.1): – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //register notif UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil]; [application registerUserNotificationSettings:settings]; return YES; } – (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { //register to receive notifications [application registerForRemoteNotifications]; NSLog(@"didRegisterUser"); } -(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { […]