[Pushwoosh Plugin] Unneccesary check / bug in version 4.5.0 when only developing for iOS

Forge Component
Published on 18 May by Pushwoosh
12 votes
Published on 18 May by Pushwoosh

In the Client action InitializePushwoosh, there is a check that ensures that the PushWooshAppCode and FCMSenderId are not empty. I believe this check is to strong and could (in our case, did) lead to an unnecessary error.

When used in an iOS application, only the PushWooshAppCode is used by the plugin (the FCMSenderId is only used on Android). Therefore, if you know for certain that no android version of the app will be created, it makes sense to leave the value empty. However, this would lead to an error ("Invalid PushWooshAppCode or FCMSenderId").

I think the function should be changed so it only gives an error if the FCMSenderId is empty when the plugin is being called on an Android device. (Note: There is actually already a check in the function that checks if the device type is Android an if so, if the FCMSenderId is empty. Just removing the first check would fix the issue).

In the mean time, the issue could be easily mitigated by:

- Changing the PushwooshPlugin. Remove the check on the length of the FCMSenderId in the first If of the InitializePushwoosh component.


- Provide a value for the FCMSenderId. As this variable is not used on iOS, it doesn't matter what value you supply. (Note: If you develop for Android as well, you have already supplied a meaningful value for the FCMSenderId and this error will not pop up anyways)