OneSignal / OneSignal-Cordova-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Other
251 stars 199 forks source link

[Bug]: Crash if number is sent as value to addAlias #1016

Open fmp777 opened 3 months ago

fmp777 commented 3 months ago

What happened?

Crashes on IOS (not sure about Android) when a number is sent instead of a string in the value of addAlias. Typecasting values to string before sending to OneSignal sdk resolves the crash.

image

Steps to reproduce?

1. Install the plugin (latest)
2. during app init, call `OneSignal.User.addAlias('myalias', 123);`
3. observe IOS crash

What did you expect to happen?

I expect onesignal plugin to typecast values to string (especially if is integer). If some other non-stringable value, throw error instead of executing a crash.

OneSignal Cordova SDK version

5.2.3 & 5.2.4

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct