- AUTHORIZED_ENTITY - Basically it asks for the google project id. It is numeric, and if you already had GCM integrated in your project before, it would be GCM_SENDER_ID (something like "568520103762"). Check your Google-info.plist to find it.
- SCOPE - kFIRInstanceIDScopeFirebaseMessaging
- OPTIONS - @{@"apns_token": deviceToken} (You will get DeviceToken in didRegisterForRemoteNotifications method)
- HANDLER - Catch token if you have received token or catch the error here. If token comes nil, then wait for token in "tokenRefreshNotification" method, which will be called automatically if the token is nil in [FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]
Example:
if (![[FIRInstanceID instanceID] token]) {
[[FIRInstanceID instanceID] tokenWithAuthorizedEntity:_gcmSenderId scope:kFIRInstanceIDScopeFirebaseMessaging options:_registrationOptions handler:^(NSString * _Nullable token, NSError * _Nullable error) {
// Fetch the token or error
}];
}