Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 140 forks source link

NSNull objectForKeyedSubscript: unrecognized selector sent to instance #362

Open ScabbersONE opened 2 years ago

ScabbersONE commented 2 years ago

This error happens when assigning the PushWooshAppCode value and GoogleProjectCode at the same time

wfhm commented 2 years ago

@ScabbersONE Could you please provide a bit more detail on the issue? How exactly do you specify the app code and the FCM sender ID in your project?

ScabbersONE commented 2 years ago

The error was happening when we removed the version number for pushwoosh on the end of the path to include pushwoosh in our project. We went back to using 8.2.3 and now we have our old issue where we can't generate the APK file "Couldn't install the Cordova plugin pushwoosh-cordova-plugin", but IPA generates fine. We use site properties to set the values for the codes, but the app doesn't crash with the above error now that we switched back to 8.2.3.

wfhm commented 2 years ago

@ScabbersONE Could you please provide a bit more detail on the Android error? When exactly does this issue appear - does it happen when you add the plugin to the project, or does it specifically happen when you try generating an APK? Is it possible to provide the entire error message?

ScabbersONE commented 2 years ago

We have talked with OutSystems support and they helped us to resolve the issue temporarily. They have said that Pushwoosh isn't supporting the use of it and firebase across different environments and that we should contact Pushwoosh to see if they can make Pushwoosh work similar to google-services. We have to create the folder "google-services" for each environment with the contents inside copied from the google-services folder for the respective environment located in our Resources tab.

wfhm commented 2 years ago

@ScabbersONE the "Couldn't install the Cordova plugin pushwoosh-cordova-plugin" error means that something went wrong during the build process, or that there was an issue with one of the hooks. Could you please share your mobile apps log so we could investigate it further?

ScabbersONE commented 2 years ago

OS Support said that it was an issue with the hook. Is there somewhere I can send the log to Pushwoosh more privately. As this is a security risk sending it through a public site.

wfhm commented 2 years ago

@ScabbersONE sure, you can create a support ticket via this form:

https://help.pushwoosh.com/hc/en-us/requests/new

Just mention this issue in your original message so that our support team could forward the request to us.

wfhm commented 2 years ago

@ScabbersONE could you please check that you have your google-services.json file added as per Outsystems integrations docs:

https://success.outsystems.com/Documentation/How-to_Guides/Integrations/How_to_Use_Push_Notifications_with_Pushwoosh

It should look like below:

image10

ScabbersONE commented 2 years ago

I have done this in order to fix the issue. The problem is we have to create it for each environment specifically. We have a dev version of that file and a production version and based off of the environment it needs to change

wfhm commented 2 years ago

@ScabbersONE the plugin itself can't work with multiple google-services files right now. I'm not sure if it can be handled on Outsystems side as well.

Anyway, may I ask you to describe what would be the expected plugin's behavior when you have to switch target environments?

ScabbersONE commented 2 years ago

From OS Support -- What we are looking for from Pushwoosh is to implement a mechanism that would allow us to provide a different google-services file per environment where the application is being generated ( one google-services for Dev, another for QA, Prod, etc.)

The strategy that our supported Firebase plugin uses is to prefix the folder where you add the google-services file with the APP identifier used to generate the app. More information in the documentation below: https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Mobile_Plugins/Firebase_Plugins#Adding_and_using_a_Firebase_plugin [success.outsystems.com]

At compile time, instead of looking for the google-services folder like Pushwoosh does, it looks at a folder called .firebase ( e.g: com.sample.dev.Myapp.firebase). The OutSystems developer can then add multiple files to the resources section of the module that will only be used when it matches the build with the same App Identifier ( the developer selects a different app identifier per environment).

The suggestion would be to Pushwoosh to implement a feature to try to read a file that follows the .pushwoosh schema ( e.g: com.sample.dev.Myapp.pushwoosh) You can find our implementation on the link below: https://github.com/OutSystems/cordova-outsystems-firebase-core/tree/main/hooks [github.com]

wfhm commented 2 years ago

@ScabbersONE thanks for the suggestion, I have added the task to see if it is possible to our backlog. I will update this thread once there is any news.