Search code examples
iosfirebasegoogle-cloud-functionsfirebase-cloud-messagingfirebase-admin

Equivalent of batchImport for firebase-admin?


I am trying to move from the batchImport REST API (see answer to a previous question) found in the Instance ID endpoints to something similar in firebase-admin.

The original idea was to use a database trigger from Firebase Cloud Functions to convert a newly stored iOS APNs token (from the device) to a FCM registration token.

I think I could use an HTTP request to the same Instance ID API endpoint, but I was wondering if there is an existing admin SDK method that would do just that (convert existing iOS APNs token to FCM registration token).

Note : there's an admin.instanceId documented but it doesn't look relevant to this topic.


Solution

  • It looks like the FCM Admin SDK for Node.js doesn't provide a wrapper for that REST method.

    You may want to file a feature request to get this feature added in the future, but for the moment you'll need to call the REST API directly to import the tokens.