Last active
November 30, 2017 16:38
-
-
Save jazzedge/1a276e58aeebfe0677bbb36ba62d3eb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| See:https://www.hackingwithswift.com/read/33/8/delivering-notifications-with-cloudkit-push-messages-ckquerysubscription | |
| let database = CKContainer.default().publicCloudDatabase | |
| database.fetchAllSubscriptions { [unowned self] subscriptions, error in | |
| if error == nil { | |
| if let subscriptions = subscriptions { | |
| for subscription in subscriptions { | |
| database.delete(withSubscriptionID: subscription.subscriptionID) { str, error in | |
| if error != nil { | |
| // do your error handling here! | |
| print(error!.localizedDescription) | |
| } | |
| } | |
| } | |
| // more code to come! | |
| } | |
| } else { | |
| // do your error handling here! | |
| print(error!.localizedDescription) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment