Not Getting CloudKit Push Notifications Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!AppDelegate Never Gets Its didReceiveRemoteNotification Called For CKQuerySubscriptionNot receiving Push Notifications from CloudKit SubscriptionsAre public database subscription notifications received by all users with the same subscription?CloudKit push notifications on record update stopped workingCloudKit Push Notifications didReceiveRemoteNotification never calledSubscription type from development environment in Cloudkit not removed properlyCloudKit: delete CKSubscription is not workingObjective C- Push Notifications not working with CloudkitCloudKit iOS 9.0 didReceiveRemoteNotification not called after iOS 9.3 releasedCloudkit is not sending push notificationsCloudKit Not Sending Update Notifications

What is the meaning of the simile “quick as silk”?

Is there such thing as an Availability Group failover trigger?

Is it fair for a professor to grade us on the possession of past papers?

Can an alien society believe that their star system is the universe?

What is homebrew?

また usage in a dictionary

2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?

Why didn't Eitri join the fight?

Using et al. for a last / senior author rather than for a first author

What's the meaning of "fortified infraction restraint"?

Can you use the Shield Master feat to shove someone before you make an attack by using a Readied action?

How do I find out the mythology and history of my Fortress?

Is grep documentation wrong?

What does this Jacques Hadamard quote mean?

Find the length x such that the two distances in the triangle are the same

What causes the direction of lightning flashes?

How to answer "Have you ever been terminated?"

Generate an RGB colour grid

Can a party unilaterally change candidates in preparation for a General election?

Most bit efficient text communication method?

Significance of Cersei's obsession with elephants?

Crossing US/Canada Border for less than 24 hours



Not Getting CloudKit Push Notifications



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!AppDelegate Never Gets Its didReceiveRemoteNotification Called For CKQuerySubscriptionNot receiving Push Notifications from CloudKit SubscriptionsAre public database subscription notifications received by all users with the same subscription?CloudKit push notifications on record update stopped workingCloudKit Push Notifications didReceiveRemoteNotification never calledSubscription type from development environment in Cloudkit not removed properlyCloudKit: delete CKSubscription is not workingObjective C- Push Notifications not working with CloudkitCloudKit iOS 9.0 didReceiveRemoteNotification not called after iOS 9.3 releasedCloudkit is not sending push notificationsCloudKit Not Sending Update Notifications



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I had push notifications from CloudKit working and I'm afraid I've done something to break them. If anyone can see something I don't, please help.



When the app launches, I call setupSubscriptions(), which has this code:



let predicate = NSPredicate(value: true)
let subscriptionID = "public-new-changes-deleted"
let subscription = CKQuerySubscription(recordType: recordType, predicate: predicate, subscriptionID: subscriptionID, options: [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion])
let notificationInfo = CKSubscription.NotificationInfo()
notificationInfo.shouldSendContentAvailable = true
subscription.notificationInfo = notificationInfo

publicDB.save(subscription) { subscription, error in
if error != nil
print("subscription was set up")



The setup message does fire. I've also tried making the notificationInfo CKQuerySubscription.NotificationInfo, but there's no discernible difference whether it's that or CKSubscription.



In my app delegate:



application.registerForRemoteNotifications()



I do get a message from application(_ application:, didRegisterForRemoteNotificationsWithDeviceToken:) that the application has registered for notifications.



Then I have:



func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) 
print("application did receive remote notification")



Next I got to my CloudKit Dashboard and create, modify, or delete a record but nothing happens. I'd expect a message from didReceiveRemoteNotification. but nothing. This was working earlier but I can't think of what I changed to break it.



I can create records there and query for them in the app, so I'm sure it's able to see them, but I can't get a push when they're altered.



Other stuff:



In my target's Capabilities tab:



  • Background Fetch and Remote Notifications are both checked under Background Modes.

  • iCloud is on and it's using the correct container -- I can do fetches just fine from CloudKit using the same recordType and publicDB CKDatabase object.

  • Push Notifications are turned on and my entitlements file has a flag for "APS Environment" with a value of development.

On my Apple Developer account page, under the App ID, iCloud and Push Notifications both have green lights for both "Development" and "Distribution."



I can see in the CloudKit dashboard that the subscription types are created once the app's been run.



I'm testing on a device, not in the simulator.



I've tried:



  • Changing whether I create the subscription before or after I register for notifications.

  • Adding a message body, alert sound, and shouldBadge, and requesting notifications using UNUserNotificationCenter, and making the App Delegate a UNUserNotificationCenterDelegate. I get the prompt when I first run the app but the notifications don't arrive.

  • Splitting the subscriptions up into one for .firesOnRecordCreation and one for update and delete.

  • Adding the subscriptions using a CKModifySubscriptionsOperation instead of the database's save method.

Please let me know if you have any ideas. Thank you.










share|improve this question






















  • Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

    – Clifton Labrum
    Mar 9 at 17:26











  • I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

    – davextreme
    Mar 11 at 16:02












  • I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

    – Clifton Labrum
    Mar 11 at 16:10











  • Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

    – davextreme
    Mar 11 at 20:34

















0















I had push notifications from CloudKit working and I'm afraid I've done something to break them. If anyone can see something I don't, please help.



When the app launches, I call setupSubscriptions(), which has this code:



let predicate = NSPredicate(value: true)
let subscriptionID = "public-new-changes-deleted"
let subscription = CKQuerySubscription(recordType: recordType, predicate: predicate, subscriptionID: subscriptionID, options: [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion])
let notificationInfo = CKSubscription.NotificationInfo()
notificationInfo.shouldSendContentAvailable = true
subscription.notificationInfo = notificationInfo

publicDB.save(subscription) { subscription, error in
if error != nil
print("subscription was set up")



The setup message does fire. I've also tried making the notificationInfo CKQuerySubscription.NotificationInfo, but there's no discernible difference whether it's that or CKSubscription.



In my app delegate:



application.registerForRemoteNotifications()



I do get a message from application(_ application:, didRegisterForRemoteNotificationsWithDeviceToken:) that the application has registered for notifications.



Then I have:



func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) 
print("application did receive remote notification")



Next I got to my CloudKit Dashboard and create, modify, or delete a record but nothing happens. I'd expect a message from didReceiveRemoteNotification. but nothing. This was working earlier but I can't think of what I changed to break it.



I can create records there and query for them in the app, so I'm sure it's able to see them, but I can't get a push when they're altered.



Other stuff:



In my target's Capabilities tab:



  • Background Fetch and Remote Notifications are both checked under Background Modes.

  • iCloud is on and it's using the correct container -- I can do fetches just fine from CloudKit using the same recordType and publicDB CKDatabase object.

  • Push Notifications are turned on and my entitlements file has a flag for "APS Environment" with a value of development.

On my Apple Developer account page, under the App ID, iCloud and Push Notifications both have green lights for both "Development" and "Distribution."



I can see in the CloudKit dashboard that the subscription types are created once the app's been run.



I'm testing on a device, not in the simulator.



I've tried:



  • Changing whether I create the subscription before or after I register for notifications.

  • Adding a message body, alert sound, and shouldBadge, and requesting notifications using UNUserNotificationCenter, and making the App Delegate a UNUserNotificationCenterDelegate. I get the prompt when I first run the app but the notifications don't arrive.

  • Splitting the subscriptions up into one for .firesOnRecordCreation and one for update and delete.

  • Adding the subscriptions using a CKModifySubscriptionsOperation instead of the database's save method.

Please let me know if you have any ideas. Thank you.










share|improve this question






















  • Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

    – Clifton Labrum
    Mar 9 at 17:26











  • I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

    – davextreme
    Mar 11 at 16:02












  • I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

    – Clifton Labrum
    Mar 11 at 16:10











  • Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

    – davextreme
    Mar 11 at 20:34













0












0








0








I had push notifications from CloudKit working and I'm afraid I've done something to break them. If anyone can see something I don't, please help.



When the app launches, I call setupSubscriptions(), which has this code:



let predicate = NSPredicate(value: true)
let subscriptionID = "public-new-changes-deleted"
let subscription = CKQuerySubscription(recordType: recordType, predicate: predicate, subscriptionID: subscriptionID, options: [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion])
let notificationInfo = CKSubscription.NotificationInfo()
notificationInfo.shouldSendContentAvailable = true
subscription.notificationInfo = notificationInfo

publicDB.save(subscription) { subscription, error in
if error != nil
print("subscription was set up")



The setup message does fire. I've also tried making the notificationInfo CKQuerySubscription.NotificationInfo, but there's no discernible difference whether it's that or CKSubscription.



In my app delegate:



application.registerForRemoteNotifications()



I do get a message from application(_ application:, didRegisterForRemoteNotificationsWithDeviceToken:) that the application has registered for notifications.



Then I have:



func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) 
print("application did receive remote notification")



Next I got to my CloudKit Dashboard and create, modify, or delete a record but nothing happens. I'd expect a message from didReceiveRemoteNotification. but nothing. This was working earlier but I can't think of what I changed to break it.



I can create records there and query for them in the app, so I'm sure it's able to see them, but I can't get a push when they're altered.



Other stuff:



In my target's Capabilities tab:



  • Background Fetch and Remote Notifications are both checked under Background Modes.

  • iCloud is on and it's using the correct container -- I can do fetches just fine from CloudKit using the same recordType and publicDB CKDatabase object.

  • Push Notifications are turned on and my entitlements file has a flag for "APS Environment" with a value of development.

On my Apple Developer account page, under the App ID, iCloud and Push Notifications both have green lights for both "Development" and "Distribution."



I can see in the CloudKit dashboard that the subscription types are created once the app's been run.



I'm testing on a device, not in the simulator.



I've tried:



  • Changing whether I create the subscription before or after I register for notifications.

  • Adding a message body, alert sound, and shouldBadge, and requesting notifications using UNUserNotificationCenter, and making the App Delegate a UNUserNotificationCenterDelegate. I get the prompt when I first run the app but the notifications don't arrive.

  • Splitting the subscriptions up into one for .firesOnRecordCreation and one for update and delete.

  • Adding the subscriptions using a CKModifySubscriptionsOperation instead of the database's save method.

Please let me know if you have any ideas. Thank you.










share|improve this question














I had push notifications from CloudKit working and I'm afraid I've done something to break them. If anyone can see something I don't, please help.



When the app launches, I call setupSubscriptions(), which has this code:



let predicate = NSPredicate(value: true)
let subscriptionID = "public-new-changes-deleted"
let subscription = CKQuerySubscription(recordType: recordType, predicate: predicate, subscriptionID: subscriptionID, options: [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion])
let notificationInfo = CKSubscription.NotificationInfo()
notificationInfo.shouldSendContentAvailable = true
subscription.notificationInfo = notificationInfo

publicDB.save(subscription) { subscription, error in
if error != nil
print("subscription was set up")



The setup message does fire. I've also tried making the notificationInfo CKQuerySubscription.NotificationInfo, but there's no discernible difference whether it's that or CKSubscription.



In my app delegate:



application.registerForRemoteNotifications()



I do get a message from application(_ application:, didRegisterForRemoteNotificationsWithDeviceToken:) that the application has registered for notifications.



Then I have:



func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) 
print("application did receive remote notification")



Next I got to my CloudKit Dashboard and create, modify, or delete a record but nothing happens. I'd expect a message from didReceiveRemoteNotification. but nothing. This was working earlier but I can't think of what I changed to break it.



I can create records there and query for them in the app, so I'm sure it's able to see them, but I can't get a push when they're altered.



Other stuff:



In my target's Capabilities tab:



  • Background Fetch and Remote Notifications are both checked under Background Modes.

  • iCloud is on and it's using the correct container -- I can do fetches just fine from CloudKit using the same recordType and publicDB CKDatabase object.

  • Push Notifications are turned on and my entitlements file has a flag for "APS Environment" with a value of development.

On my Apple Developer account page, under the App ID, iCloud and Push Notifications both have green lights for both "Development" and "Distribution."



I can see in the CloudKit dashboard that the subscription types are created once the app's been run.



I'm testing on a device, not in the simulator.



I've tried:



  • Changing whether I create the subscription before or after I register for notifications.

  • Adding a message body, alert sound, and shouldBadge, and requesting notifications using UNUserNotificationCenter, and making the App Delegate a UNUserNotificationCenterDelegate. I get the prompt when I first run the app but the notifications don't arrive.

  • Splitting the subscriptions up into one for .firesOnRecordCreation and one for update and delete.

  • Adding the subscriptions using a CKModifySubscriptionsOperation instead of the database's save method.

Please let me know if you have any ideas. Thank you.







ios cloudkit






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 18:49









davextremedavextreme

184112




184112












  • Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

    – Clifton Labrum
    Mar 9 at 17:26











  • I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

    – davextreme
    Mar 11 at 16:02












  • I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

    – Clifton Labrum
    Mar 11 at 16:10











  • Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

    – davextreme
    Mar 11 at 20:34

















  • Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

    – Clifton Labrum
    Mar 9 at 17:26











  • I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

    – davextreme
    Mar 11 at 16:02












  • I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

    – Clifton Labrum
    Mar 11 at 16:10











  • Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

    – davextreme
    Mar 11 at 20:34
















Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

– Clifton Labrum
Mar 9 at 17:26





Is the log in the CloudKit Dashboard showing that the notification is being sent? Have you tried deleting your app and restarting the device?

– Clifton Labrum
Mar 9 at 17:26













I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

– davextreme
Mar 11 at 16:02






I checked the log and do see an entry of type "push" for the Sandbox APNS environment. There's also a log message for the subscription creation and the user matches that of the push.

– davextreme
Mar 11 at 16:02














I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

– Clifton Labrum
Mar 11 at 16:10





I list a few other things you can try in this answer: stackoverflow.com/questions/52179137/…

– Clifton Labrum
Mar 11 at 16:10













Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

– davextreme
Mar 11 at 20:34





Thank you. An update: I loaded the app onto two different iPads without changing any code, and pushes work fine on each. It might be something with the iPhone. I may wipe it and try again, but at least I can move on for the time being even if I don't know why it wasn't working on the phone.

– davextreme
Mar 11 at 20:34












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069279%2fnot-getting-cloudkit-push-notifications%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069279%2fnot-getting-cloudkit-push-notifications%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович