CKSubscriptions and production container
<p>Hi I'm trying to create a CKSubscription, I use this code: </p>

<pre><code>func setupCKSubscriptions(){

    if NSUserDefaults.standardUserDefaults().boolForKey("sub") == false{

    let subscription = CKSubscription(recordType: "Quadri", predicate: NSPredicate(value: true), options: .FiresOnRecordCreation)

    let notificationInfo = CKNotificationInfo()
    notificationInfo.alertLocalizationKey = NSLocalizedString("NEW_Q", comment: "")
    notificationInfo.shouldBadge = true

    subscription.notificationInfo = notificationInfo

    CKContainer.defaultContainer().publicCloudDatabase.saveSubscription(subscription) { (subscription, errore) -&gt; Void in

        if errore == nil{

            NSUserDefaults.standardUserDefaults().setBool(true, forKey: "sub")
            NSUserDefaults.standardUserDefaults().synchronize()
            let alert = UIAlertController(title: "Ok", message: "", preferredStyle: .Alert)
            self.presentViewController(alert, animated: true, completion: nil)

        }else{

            print(errore?.localizedDescription)
            let alert = UIAlertController(title: "Errore", message: errore?.localizedDescription, preferredStyle: .Alert)
            self.presentViewController(alert, animated: true, completion: nil)
        }
    }
    }else{

        let alert = UIAlertController(title: "Errore", message: "", preferredStyle: .Alert)
        self.presentViewController(alert, animated: true, completion: nil)
    }
}
</code></pre>

<p>The problem is that this code only works on the simulator, when I run the app on a real device I get this error: </p>

<blockquote>
  <p>attempting to create a subscription in a production container.</p>
</blockquote>

<p>How can I fix this?</p>