title: Firebase: How to translate a device token into a FCM token
body: <p>I am trying to use the Firebase for push notifications. However, I have hit the block, namely I couldn't do that thing in iOS. I attempted two approaches of both </p>
  
  <pre><code>Messaging.messaging().setAPNSToken(deviceToken, type: .prod) and InstanceID.instanceID().setAPNSToken(deviceToken, type: InstanceIDAPNSTokenType.sandbox)
  </code></pre>
  
  <p>In 2nd</p>
  
  <pre><code>application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
  </code></pre>
  
  <p>with <code>Firebase</code> imported.</p>
  
  <p>What should I do?</p>
  
  <p>EDIT:
  This is a supplemental information, the error message is like this.
  <strong>Failed to fetch default token Error Domain=com.firebase.iid Code=1003 "(null)"</strong>
  I googled, but there is no relavant information.</p>