OneSignal-Unity-SDK
OneSignal-Unity-SDK copied to clipboard
OverflowException on Android 4.x & 5.x
When the game receives a notification with an emoji OverflowException
is thrown. The game doesn't crash, but this exception is reported to Unity Performance Reporting service.
OverflowException: Value is greater than Char.MaxValue or less than Char.MinValue
System.Convert.ToChar (Int32 value)
OneSignalPush.MiniJSON.Json+Parser.EatWhitespace ()
OneSignalPush.MiniJSON.Json+Parser.get_NextToken ()
OneSignalPush.MiniJSON.Json+Parser.Parse (System.String jsonString)
OneSignal.onPushNotificationOpened (System.String jsonString)
Affected SDK versions: 2.2.x, 2.3.x including 2.3.3. Android versions: 4.x and 5.x βΒ there are no reports from 6.x or newer.
@amjaliks is this issue occurring with any emoji that you send in a notification? Can you paste which emojis you're using? Also, what notification fields are you setting emojis with?
I'm not sure if this exception is caused by any emoji. But the that causes is π.
@amjaliks It seems like the π emoji isn't causing the issue. I'm not able to reproduce the issue. Could you give us more info on what text you are populating inside your notification?
Trying to open a notification with πΊ in message causes exception on my Nexus 4 with Android 5.1.1. It seems this emoji isn't supported by older Androids as it appears as crossed box.
@amjaliks I'm able to reproduce the unavailable map emoji πΊ on Android 5.0.2, but am not able to see the Unity log entry stating an OverflowException
is occurring upon tapping the notif. Where are you able to see those logs? Are they in logcat?
Yes, these exceptions are logged to logcat. I receive reports in Unity Performance Reporting service too.
Have updated SDK to 2.4.1. This issue is still here.
@amjaliks I have tested this issue and have been unable to reproduce it. Is this issue still occurring for you?
Closing due to inactivity - if this issue is still occurring for you please feel free to respond and I'll be happy to reopen and investigate.
Hi, i can confirm that this issue is happening for us in Unity SDK version 2.7.0. We are using push notification title: :gift: LUXURY CHESTS IN ARENA :gift:
OverflowException: Value was either too large or too small for a character.
System.Convert.ToChar (System.Int32 value) (at <5a4d758c5fd24cfd9ed20c8737538cf6>:0)
OneSignalPush.MiniJSON.Json+Parser.get_PeekChar () (at
@Tvarosh Thanks for reporting. I was able to reproduce the issue with the MiniJSON
library the OneSignal SDK uses with the following code example
var test = Json.Deserialize("{\"test\": \"π LUXURY CHESTS IN ARENA π\"") as Dictionary<string, object>;
any news of this bug? This error also occurs in our app.
OS Version: 5.0 Device: Galaxy Note3 RAM Free: 23.1% Disk Free: 2.3%
#0. Crashed: UnityMain at System.Convert.ToChar(System.Convert) at OneSignalPush.MiniJSON.Json+Parser.EatWhitespace(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.get_NextToken(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.Parse(OneSignalPush.MiniJSON.Json+Parser) at OneSignal.onPushNotificationOpened(OneSignal)
--
Non-fatal Exception: java.lang.Exception: OverflowException : Value is greater than Char.MaxValue or less than Char.MinValue at System.Convert.ToChar(System.Convert) at OneSignalPush.MiniJSON.Json+Parser.EatWhitespace(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.get_NextToken(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.Parse(OneSignalPush.MiniJSON.Json+Parser) at OneSignal.onPushNotificationOpened(OneSignal)
#0. Crashed: UnityMain at System.Convert.ToChar(System.Convert) at OneSignalPush.MiniJSON.Json+Parser.EatWhitespace(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.get_NextToken(OneSignalPush.MiniJSON.Json+Parser) at OneSignalPush.MiniJSON.Json+Parser.Parse(OneSignalPush.MiniJSON.Json+Parser) at OneSignal.onPushNotificationOpened(OneSignal)