question

fiveampsoftware avatar image
fiveampsoftware asked

Confirmation that PlayFab Push for Android is Asynchronous?

Hello,

We've been testing the latest Android Push plugin in our Beta channel (Google Play) and have noticed a few users have been seeing a hang when launching the game. We have a couple of reports that look like this (ANR), the crash reporter highlights the suspicious calls seen here: http://imgur.com/a/VAOil

"UnityMain" prio=5 tid=10 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 obj=0x41cb0e48 self=0x5137c6a8
  | sysTid=9158 nice=0 sched=0/0 cgrp=apps handle=1362608624
  | state=S schedstat=( 0 0 0 ) utm=970 stm=159 core=1
  at java.lang.Object.wait (Native Method)
- waiting on <0x42153ac0> (a android.os.ConditionVariable)
  at java.lang.Object.wait (Object.java:401)
  at android.os.ConditionVariable.block (ConditionVariable.java:128)
  at com.playfab.unityplugin.GCM.PlayFabGoogleCloudMessaging.getToken (PlayFabGoogleCloudMessaging.java:33)
  at com.unity3d.player.UnityPlayer.nativeRender (Native Method)
  at com.unity3d.

Does the push notification plugin make calls asynchronously? I wanted to confirm before investigating further.

Thanks,

Kevin

Push Notificationsandroid
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
marcowilliamspf avatar image
marcowilliamspf answered

It is not an async call at the java level. That is interesting that calling to getToken() is blocking the main thread in Unity because it is a static void. It calls that code in Java and does not have a return value. We use UnityPlayer.UnitySendMessage to return the result. This should never block the main thread.

My guess is yes, you are having an error getting your token ( needs to be looked at further ), but you probably have something else that is actually blocking your main thread.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.