[Firebase Cloud Message Plugin] When there is an in app update we get Script error for "FirebaseCloudMessagePluginCon

Forge Component
(5)
Published on 2018-08-20 by Experts
5 votes
Published on 2018-08-20 by Experts

When we publish a simple change in the mobile app, we get an upgrade failed error when using this plugin

This is the first error that is logged

Upgrade failed - rolling back to previous application version.
Script error for "FirebaseCloudMessagePluginContext"
http://requirejs.org/docs/errors.html#scripterror

then we get the following error

Script error for "FirebaseCloudMessagePluginContext"
http://requirejs.org/docs/errors.html#scripterror

And an error screen in the app, with a reload button, but that will fail always.

Only hard closing the app and then starting it wil update the app without errors

We call the initpushnotifications in on application ready and in on application resume

and the we have a webblock with the fcmcentraldispather  on the homescreen


Tried everying with initialising at other events on the Oninitialize of the page.

But nothing helps.


We need the in app update to happen without errors.

Can someone please look into this

Thanks in advance

Stefan Besteman





Stefan Besteman wrote:

When we publish a simple change in the mobile app, we get an upgrade failed error when using this plugin

This is the first error that is logged

Upgrade failed - rolling back to previous application version.
Script error for "FirebaseCloudMessagePluginContext"
http://requirejs.org/docs/errors.html#scripterror

then we get the following error

Script error for "FirebaseCloudMessagePluginContext"
http://requirejs.org/docs/errors.html#scripterror

And an error screen in the app, with a reload button, but that will fail always.

Only hard closing the app and then starting it wil update the app without errors

We call the initpushnotifications in on application ready and in on application resume

and the we have a webblock with the fcmcentraldispather  on the homescreen


Tried everying with initialising at other events on the Oninitialize of the page.

But nothing helps.


We need the in app update to happen without errors.

Can someone please look into this

Thanks in advance

Stefan Besteman






Try to regenerate the APK for android or IPA for iOS

I'm facing the same issue. Regenerating the app and redownloading does now work. Any ideas?

Hi all, 

I found the issue. 

It seems like the app update is clashing with the RegisterPlugin script inside the FCMCentralDispatcher. 

A quick fix would be to check if the app is upgrading at the moment, and if it is, don't call the register plugin. My assumption is that upgrades don't happen often it is alright to not handle push notifications at the point of upgrades. Subsequently the FCMCentralDispatcher should work properly. 

Hope someone will come up with a longer term solution!

This always happens in my case any solution? event If I restart the application. 

Hi, 

Try this. Create a layout for the slash page that does not have the FCMCentralDispatcher. 

Stephen Yeo wrote: Hi thanks for the replay. But in this case how should I get notifications inside the app ?

Hi, 

Try this. Create a layout for the slash page that does not have the FCMCentralDispatcher. 



Anahit Pahlevanyan wrote: When I put code of Dispatcher ready function in timer it works fine. Is that good solution? is there another solution other than that ?

Stephen Yeo wrote: Hi thanks for the replay. But in this case how should I get notifications inside the app ?

Hi, 

Try this. Create a layout for the slash page that does not have the FCMCentralDispatcher. 





Hi Anahit,

Yes, i guess that is another way to do it. I don't see an issue as long as you continue to receive the push notifications.