20

So far I was unable to make subscriptions to work. (receive a push notification on my device, subscriptions appears to be created successfully)

I have been playing with [CloudKitAtlas][1]. I did what it's told on the readme for that proyect:

Requirements

Build

  • iOS 8.0 SDK and Xcode 6
  • Enable the CloudKit entitlement in iCloud (from Capabilities)
  • Change your container name to provision a container in your developer account

I'm able to launch the app, it registers successfully for remote notifications:

2014-06-09 11:15:17.712 CloudKitAtlas[841:220562] Registered for Push notifications with token:

I'm also able to create records, query them and subscribe:

2014-06-09 11:15:21.966 CloudKitAtlas[841:220934] Subscribed to Item

And if I go to the dashboard I see several subscriptions created. But then when I create a new record nothing happens, the callback:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)info

Is never executed (Note: I'm running the app on a iPhone 5S, not on the simulator)

I'm using a debug signature with explicit bundle id (no wildcard) and for this app id I also created the corresponding push notifications certificates although I just downloaded them as I have nothing to do with those files.

  1. Am I forgetting to do something?
  2. Am I not testing it properly?
  3. Does anyone manage to get remote notifications on his device triggered by a subscription?

Update 15 / 06 / 14 Apparently it's a bug on apple side, let's wait a couple of weeks. https://developer.apple.com/library/content/samplecode/CloudAtlas/Introduction/Intro.html#//apple_ref/doc/uid/TP40014599


Update 18 / 05 / 15

In case anyone is wondering this bug was resolved by Apple long time ago and now it works like a charm, although you need to make some considerations:

  1. Make sure the saveSubscription:completionHandler: method executes without errors
  2. If you use [application registerForRemoteNotifications]; You will ONLY get notifications with the app on foreground, it might look like is pointless but it is very useful as this kind of push notifications are "silent" and you don't require user permission to use them
  3. If you want to get old fashion push notifications with the pop up asking for permission and an alert that appears outside of the app and everything you need to use something like:
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:
                                        UIUserNotificationTypeBadge |
                                        UIUserNotificationTypeSound |
                                        UIUserNotificationTypeAlert
                                                                         categories:nil];
    

    [application registerUserNotificationSettings:settings];

That's all

5
  • I've also had the same issue. I assume maybe it's just a sandbox environment issue? That or we need to configure push too for subscription pushes to function...? Jun 13, 2014 at 20:15
  • 2
    Push notifications works on sandbox mode so It should work here too. I have the feeling that I'm forgetting to setup something :(
    – dev_jac
    Jun 15, 2014 at 4:48
  • Does it work on the new beta 2 ?
    – foOg
    Jun 18, 2014 at 13:23
  • 1
    I tried this morning and nothing :| I need to try with a fresh new app and a fresh new container, maybe that matters too. Also no mention about this issue on the changelog for beta 2
    – dev_jac
    Jun 19, 2014 at 13:53
  • How to set up a minimal subscription in CloudKit: stackoverflow.com/questions/24905390/…
    – János
    Oct 20, 2014 at 14:17

1 Answer 1

-1

registerForRemoteNotificationTypes:types NS_DEPRECATED_IOS(3_0, 8_0, "Please use registerForRemoteNotifications and registerUserNotificationSettings: instead");

// Returns the enabled types, also taking into account any systemwide settings; doesn't relate to connectivity.

enabledRemoteNotificationTypes NS_DEPRECATED_IOS(3_0, 8_0, "Please use -[UIApplication isRegisteredForRemoteNotifications], or -[UIApplication currentUserNotificationSettings] to retrieve user-enabled remote notification and user notification settings");

That from iOS8 it becomes deprecated is not cause, probably will be?

1
  • I'm using "registerForRemoteNotifications" and I check with "isRegisteredForRemoteNotifications" and it is registered, besides I'm using Apple's example of CloudKit. I really think it is a bug on their side.
    – dev_jac
    Jun 26, 2014 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.