title: How to make remote notifications work with CloudKit Subscriptions?
body: <p>So far I was unable to make subscriptions to work. (receive a push notification on my device, subscriptions appears to be created successfully)</p>
  
  <p>I have been playing with [CloudKitAtlas][1]. I did what it's told on the readme for that proyect:</p>
  
  <blockquote>
    <h2>Requirements</h2>
    
    <h3>Build</h3>
    
    <ul>
    <li>iOS 8.0 SDK and Xcode 6</li>
    <li>Enable the CloudKit entitlement in iCloud (from Capabilities)</li>
    <li>Change your container name to provision a container in your developer account</li>
    </ul>
  </blockquote>
  
  <p>I'm able to launch the app, it registers successfully for remote notifications:</p>
  
  <blockquote>
    <p>2014-06-09 11:15:17.712 CloudKitAtlas[841:220562] Registered for Push
    notifications with token: </p>
  </blockquote>
  
  <p>I'm also able to create records, query them and subscribe:</p>
  
  <blockquote>
    <p>2014-06-09 11:15:21.966 CloudKitAtlas[841:220934] Subscribed to Item</p>
  </blockquote>
  
  <p>And if I go to the dashboard I see several subscriptions created.
  But then when I create a new record nothing happens, the callback:</p>
  
  <pre><code>- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)info
  </code></pre>
  
  <p>Is never executed (<strong>Note</strong>: I'm running the app on a iPhone 5S, not on the simulator)</p>
  
  <p>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.</p>
  
  <ol>
  <li>Am I forgetting to do something?</li>
  <li>Am I not testing it properly?</li>
  <li>Does anyone manage to get remote notifications on his device triggered by a subscription?</li>
  </ol>
  
  <hr>
  
  <p>Update 15 / 06 / 14
  Apparently it's a bug on apple side, let's wait a couple of weeks.
  <a href="https://developer.apple.com/library/content/samplecode/CloudAtlas/Introduction/Intro.html#//apple_ref/doc/uid/TP40014599" rel="nofollow noreferrer">https://developer.apple.com/library/content/samplecode/CloudAtlas/Introduction/Intro.html#//apple_ref/doc/uid/TP40014599</a></p>
  
  <hr>
  
  <p><strong>Update 18 / 05 / 15</strong></p>
  
  <p>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:</p>
  
  <ol>
  <li>Make sure the <em>saveSubscription:completionHandler:</em> method executes without errors</li>
  <li>If you use <em>[application registerForRemoteNotifications];</em> You will <strong>ONLY</strong> 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</li>
  <li>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:
  
  <blockquote>
  <pre><code>UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:
                                      UIUserNotificationTypeBadge |
                                      UIUserNotificationTypeSound |
                                      UIUserNotificationTypeAlert
                                                                       categories:nil];
  </code></pre>
    
    <p>[application registerUserNotificationSettings:settings];</p>
  </blockquote></li>
  </ol>
  
  <p>That's all</p>