41
Views
4
Comments
Solved
[Cloud Messaging Plugin (Firebase)] Firebase Cloud Messaging Plugin Extensibility Configuration for 3 Environment
cloud-messaging-plugin-firebase
Mobile icon
Forge component by Hector Gordin
Application Type
Mobile
Service Studio Version
11.54.22 (Build 62709)
Platform Version
11.19.0 (Build 38072)

Hi im using Cloud Messaging Plugin version 3.0.0 under development version

I have an issue when implementing the new version of the plugin, if i use only 1 file plist and 1 file json its working fine. But if i add more resources like this picture

And then i add the resource to the extensibility configurations using this json

{

  “resources": {

    "android": {

      "AndroidResource": [

        {

          "src": "www/google-services-dev.json",

          "target": "app/google-services-dev.json"

        },

        {

          "src": "www/google-services-uat.json",

          "target": "app/google-services-uat.json"

        }

      ]

    },

    "ios": {

      "IosResource": [

        {

          "src": "www/GoogleService-Info-dev.plist",

          "target": "GoogleService-Info-dev.plist"

        },

        {

          "src": "www/GoogleService-Info-uat.plist",

          "target": "GoogleService-Info-uat.plist"

        }

      ]

    }

  }

}


But its dont work. If i use only one plist and json file for dev environment it is working well, but when i add multiple file for other environment im getting error when generating the application.

I have a application that need to deploy in this week, please help ASAP.

Thank you.

Solution

Hi @Yongky Saputra ,


I had the same problem, here is the solution.


1. Add your resources to the module.

2. Go to the extensibility configurations in Lifetime. -> In Lifetime select your application and you will see these options and click on Settings.

And fill the extensibility configurations (example for QA environment).


3. After these configurations you will generate your app.


I hope this helps.


Regards,

Diana


Thank you diana

i have try it and its work.

Hi @Yongky Saputra, you need to configure the extensibility configurations in Lifetime for each individual environment. Only in lifetime you can set different configs for each environment. Just look for your application there, then go to it's settings, and at the bottom there should be the option to use the default config(from the module), or custom, which will open a text box. You can swap the environments at the top of the screen.


 So for Dev it should be something like this: 


{

  “resources": {

    "android": {

      "AndroidResource": [

        {

          "src": "www/google-services-dev.json",

          "target": "app/google-services-dev.json"

        }

      ]

    },

    "ios": {

      "IosResource": [

        {

          "src": "www/GoogleService-Info-dev.plist",

          "target": "GoogleService-Info-dev.plist"

        }

      ]

    }

  }

}


Best regards

Hi @Yongky Saputra ,

This can be solved by deploying to a target directory the files for each environment. From here, in for example in your apk it will appear the different folders (different target directories).

You will also need to create a Cordova hook for the plugin with the type "before_plugin_install" where you are going to copy your resource to desired target. You will select the directory you want  and copy to the desired place only the files for that specific environment.

This way you can use multiple google services files within your module.

Cheers,
Paulo Solipa



Solution

Hi @Yongky Saputra ,


I had the same problem, here is the solution.


1. Add your resources to the module.

2. Go to the extensibility configurations in Lifetime. -> In Lifetime select your application and you will see these options and click on Settings.

And fill the extensibility configurations (example for QA environment).


3. After these configurations you will generate your app.


I hope this helps.


Regards,

Diana


Thank you diana

i have try it and its work.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.