title: Why cloudkit notification doesnt arrive when app is installed from testflight while it works when compiled from xcode?
body: <p>CloudKit notifications doesnt arrive on production (AppStore, TestFlight), but works in development mode (installed from Xcode).</p>
  
  <p>Why?</p>
  
  <p>This is how I register for remote notifications:</p>
  
  <pre><code>    let center = UNUserNotificationCenter.current()
  
      center.delegate = self
      center.requestAuthorization(options: [.alert, .badge, .sound]) { authorised, error in
  
          DispatchQueue.main.sync {
              application.registerForRemoteNotifications()
          }
      }
  </code></pre>
  
  <p>and this is how I save subscriptions:</p>
  
  <pre><code>func subscribeForChanges() {
  
      let options: CKQuerySubscriptionOptions = [.firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion]
  
      let serviceSubscription = CKQuerySubscription(recordType: "Service", predicate: NSPredicate(value: true), options: options)
      let goalSubscription = CKQuerySubscription(recordType: "Goal", predicate: NSPredicate(value: true), options: options)
      let territorySubscription = CKQuerySubscription(recordType: "Territory", predicate: NSPredicate(value: true), options: options)
      let addressSubscription = CKQuerySubscription(recordType: "Address", predicate: NSPredicate(value: true), options: options)
      let noteSubscription = CKQuerySubscription(recordType: "Note", predicate: NSPredicate(value: true), options: options)
      let daySubscription = CKQuerySubscription(recordType: "Day", predicate: NSPredicate(value: true), options: options)
      let shareSubscription = CKQuerySubscription(recordType: "cloudkit.share", predicate: NSPredicate(value: true), options: options)
  
      let notificationInfo = CKNotificationInfo()
      notificationInfo.shouldBadge = false
      notificationInfo.shouldSendContentAvailable = true
  
      serviceSubscription.notificationInfo = notificationInfo
      goalSubscription.notificationInfo = notificationInfo
      territorySubscription.notificationInfo = notificationInfo
      addressSubscription.notificationInfo = notificationInfo
      noteSubscription.notificationInfo = notificationInfo
      daySubscription.notificationInfo = notificationInfo
      shareSubscription.notificationInfo = notificationInfo
  
      let privateSubscriptionsOperation = CKModifySubscriptionsOperation(subscriptionsToSave: [serviceSubscription, goalSubscription, territorySubscription, addressSubscription, noteSubscription, daySubscription, shareSubscription], subscriptionIDsToDelete: nil)
      privateSubscriptionsOperation.database = CloudAssistant.shared.privateDatabase
  
      let notificationInfoDatabaseSubscription = CKNotificationInfo()
      notificationInfoDatabaseSubscription.shouldSendContentAvailable = true
  
      let subscription = CKDatabaseSubscription(subscriptionID: "pl.blue-world.fieldservice.sharedDatabase")
      subscription.notificationInfo = notificationInfoDatabaseSubscription
      let sharedSubscriptionsOperation = CKModifySubscriptionsOperation(subscriptionsToSave: [subscription], subscriptionIDsToDelete: nil)
      sharedSubscriptionsOperation.database = CloudAssistant.shared.sharedDatabase
  
      let queue = OperationQueue()
      queue.maxConcurrentOperationCount = 1
      queue.addOperation(privateSubscriptionsOperation)
      queue.addOperation(sharedSubscriptionsOperation)
      privateDatabase.save(CKRecordZone(zoneName: "fieldservice")) { _, _ in }
  }
  </code></pre>