Tuesday, 12 February 2019

GCM to FCM in iOS

I use FirebaseInstanceID framework to fetch the token.

Current implementation is as below:

InstanceID.instanceID().token(withAuthorizedEntity: <GCM_SENDER_ID>, scope: "GCM", options: nil) { (token, error) in
}

My only requirement is of getting the token from Firebase for authentication purposes only.

The above implementation doesn't require adding GoogleService-Info.plist and any other frameworks.

The problem is, Google has deprecated GCM.

If I change scope from "GCM" to "FCM", it returns me an error 1001. Also If I change withAuthorizedEntity from <GCM_SENDER_ID> to <PROJECT_ID> it give me error 1001.

So, is there any way, using FCM just to fetch the token? As, I don't have any other requirements of sending Push notifications. TIA



from GCM to FCM in iOS

No comments:

Post a Comment