2

enter image description hereI'm just making a quick test on this plugin. I've created an empty apache cordova app, made the setup on firebase and installed the following plugin: https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin

The build is successful but the app crashes on start.

Logcat:

Process: com.commerce.miroir.mobile.companion, PID: 14220 java.lang.RuntimeException: Unable to get provider com.salesforce.marketingcloud.cordova.MCInitProvider: java.lang.IllegalStateException: Missing required properties: notificationCustomizationOptions

Any ideas of what's missing?

Using 9.0.0 ([email protected]) Requirements check results for android: Java JDK: installed 1.8.0 Android SDK: installed true Android target: installed android-28,android-27,android-26,android-25,android-24,android-23,android-22,android-21 Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-4.6\bin\gradle

My config.xml file looks like image below:

1 Answer 1

4

Make sure you're providing all necessary configuration values as specified in the documentation https://github.com/salesforce-marketingcloud/MC-Cordova-Plugin/blob/master/README.md#installation. Specifically, this error is due to notification_small_icon not being present in your config.xml

5
  • I have that line in the config.xml file but i've not any icon on `res` folder. Is that the issue? Commented Apr 16, 2019 at 13:39
  • I've already managed to run this plugin without crashing my app. Problem was notification icon missing. However i now obtain a different error: Default FirebaseApp is not initialized in this process com.commerce.miroir.mobile.companion. Make sure to call FirebaseApp.initializeApp(Context) first. What I'm missing now? Commented Apr 16, 2019 at 15:22
  • Make sure you're following all of the instructions from the link in my answer.
    – Seth
    Commented Apr 16, 2019 at 22:58
  • Hi Seth, I've followed the installation steps on the guide. However i had to include two extra steps to make this work: SENDER_ID had to be included in config.xml otherwise the app fails. I had also to include the icon set on platforms\android\app\src\main\res as per your comments. Thank you. I think that the installation guide could be more clear in relation with these additional steps. I was able to make the plugin work now, but I'm obtaining the error above everytime i test on Firebase CM console by just sending an test notification. Is this expected? Commented Apr 17, 2019 at 8:03
  • Complete error log is: Unable to retrieve sender id. Push messages will not work for Marketing Cloud. java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.commerce.miroir.mobile.companion. Make sure to call FirebaseApp.initializeApp(Context) first. at com.google.firebase.FirebaseApp.getInstance(SourceFile:218) at com.salesforce.marketingcloud.cordova.MCSdkConfig.parseConfig(MCSdkConfig.java:115) at com.salesforce.marketingcloud.cordova.MCSdkConfig.prepareConfigBuilder(MCSdkConfig.java:60) ... Commented Apr 18, 2019 at 11:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .