title: iOS DeviceCheck API - GenerateToken gives error Code 0
body: <p>I'm trying to implement the new iOS 11 DeviceCheck API (<a href="https://developer.apple.com/documentation/devicecheck" rel="nofollow noreferrer">https://developer.apple.com/documentation/devicecheck</a>), but token generation always fails. I've tried on simulator and iPhone SE, with wifi and mobile data.  Apple ID in settings is my normal, non-sandbox account.</p>
  
  <p>This is an existing app for an organization - from the docs it sounds like the only configuration requirement is to make sure App ID is set up in the apple developer portal. </p>
  
  <p>Anyone else having this issue?  </p>
  
  <p>The exact error message is:</p>
  
  <blockquote>
    <p>The operation couldn’t be completed. (com.apple.devicecheck.error error 0.)</p>
  </blockquote>
  
  <p>This is the code I'm using, nothing fancy.  </p>
  
  <pre><code>if #available(iOS 11.0, *) {
          let device = DCDevice.current
          if (device.isSupported) {
              device.generateToken(completionHandler: { (data, error) in
                  if let token = data{
                      print("token: \(token)")
                  }else if let error = error{
                      print("error: \(error.localizedDescription)")
                  }
              })
          } else {
              print("devicecheck not supported")
          }
      }
  </code></pre>