OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

OverflowException on Android 4.x & 5.x

Open amjaliks opened this issue 7 years ago β€’ 11 comments

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 avatar Jul 15 '17 20:07 amjaliks

@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?

Alamgir avatar Sep 26 '17 23:09 Alamgir

I'm not sure if this exception is caused by any emoji. But the that causes is 🎁.

amjaliks avatar Sep 27 '17 03:09 amjaliks

@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?

Alamgir avatar Sep 27 '17 22:09 Alamgir

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 avatar Oct 01 '17 21:10 amjaliks

@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?

Alamgir avatar Oct 04 '17 00:10 Alamgir

Yes, these exceptions are logged to logcat. I receive reports in Unity Performance Reporting service too.

amjaliks avatar Oct 07 '17 14:10 amjaliks

Have updated SDK to 2.4.1. This issue is still here.

amjaliks avatar Nov 07 '17 19:11 amjaliks

@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.

Nightsd01 avatar Mar 26 '18 19:03 Nightsd01

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 :0) OneSignalPush.MiniJSON.Json+Parser.EatWhitespace () (at :0) OneSignalPush.MiniJSON.Json+Parser.get_NextToken () (at :0) OneSignalPush.MiniJSON.Json+Parser.ParseValue () (at :0) OneSignalPush.MiniJSON.Json+Parser.Parse (System.String jsonString) (at :0) OneSignalPush.MiniJSON.Json.Deserialize (System.String json) (at :0) OneSignal.onPushNotificationOpened (System.String jsonString) (at :0)

Tvarosh avatar Jun 08 '18 12:06 Tvarosh

@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>;

jkasten2 avatar Jun 08 '18 19:06 jkasten2

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)

Russel1 avatar Jan 28 '19 11:01 Russel1