未在Mac上接收自定义记录区的CloudKit推送通知 [英] Not receiving CloudKit push notifications for Custom Record Zone on the Mac

查看:199
本文介绍了未在Mac上接收自定义记录区的CloudKit推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了自定义区域订阅,以从我的自定义记录区域接收(静默)推送通知。一切在我的iOS设备上正常工作,但我不能在我的Mac上接收通知。

I've setup a custom zone subscription to receive (silent) push notifications from my custom record zone. Everything works fine on my iOS devices but I'm not able to receive the notifications on my Mac.

要注册通知,我注册的通知类型 applicationDidFinishLaunching

To register the notifications I'm registering the notification type in applicationDidFinishLaunching:

[[NSApplication sharedApplication] registerForRemoteNotificationTypes:NSRemoteNotificationTypeNone];

(尝试其他类型的结果相同)

(Tried the other types with the same result)

application:didRegisterForRemoteNotificationsWithDeviceToken:

一个有效的令牌。一切似乎很好,但是当自定义区域注册更改,我没有收到通知和

is then called with a valid token. Everything seems fine but when the custom zone registers changes, I receive no notification and

application:didReceiveRemoteNotification:

未调用。我还尝试将警报正文设置为一个空字符串,如下所示:

is not called. I've also tried to set the alert body to an empty string like this:

CKNotificationInfo *info = [[CKNotificationInfo alloc] init];
info.alertBody = @"";
info.shouldSendContentAvailable = YES;

但它没有工作。当我设置一个字符串作为警报主体(并注册适当的通知类型)我也得到一个通知,该主体在右上角,但应用程序:didReceiveRemoteNotification:不被调用。

but it didn't work either. When I set a string as the alert body (and register the appropriate notification type) I also get a notification with that body in the top right corner but application:didReceiveRemoteNotification: is not called.

希望你能帮助我。谢谢!

Hope you can help me. Thanks!

推荐答案

我认为它是macOS Sierra固定的。现在为我工作。

I think it's fixed with macOS Sierra. Working for me now.

编辑:
哦哇:只是注意到我(!)提出这个问题1,5年前。 :)

Oh wow: just noticed that I (!) asked this question 1,5y ago. :)

这篇关于未在Mac上接收自定义记录区的CloudKit推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆