firebasecordovagoogle-cloud-functionsfirebase-dynamic-links

Is there any way of using Cordova Plugins in Firebase Cloud Functions?


I want to create firebase dynamic-link when a document gets created in my database and update the same document with field shareable_link : created_dynamic_link.

How can I use Cordova Plugin Cordova plugin for Firebase Dynamic Links inside Firebase Function onCreate() event which gets triggered whenever new document is created in my database and I update the document available in snapshot of onCreate() event with dynamic-link created by mentioned Cordova plugin?

I don't know if I can include Cordova plugins right away in Firebase functions.

Also, are there any other alternatives?

PS : I thought to including cordova plugins since I am building an android app using Ionic-framework with cordova plugins.

EDIT : onCreate() is a Firebase Cloud Function event https://firebase.google.com/docs/functions/database-events


Solution

  • Yes, it's possible to use Cordova with Firebase. Regarding the Cordova plugin for Firebase Dynamic Links, I believe you are mentioning the plugin on Github here. This plugin seems to be developed only for iOS and Android, so, in case you are developing for these environments, you should be good to go, using the variables on your onCreate() method. In case you are not, I believe you will need to adapt the code to your needs.

    However, it's not possible to to integrate Cordova plugin to Cloud Functions.

    Besides that, I found these two below articles with tutorials and information on using Firebase with Cordova - they are messaging apps, but I believe you should be able to get further information on the way you can integrate and use both together.

    Let me know if the information helped you!