question

Andy Metcalfe avatar image
Andy Metcalfe asked

PlayFab API call when suspending on Xbox

Hi,

In our Unity project, I am trying to make a PlayFab API call in order to save player's progress data to the cloud when our game suspends. To do this, I subscribe to the UnityEngine.GameCore.GameCorePLM.OnSuspendingEvent event and, in the handler for that, I make the PlayFab API call to save the data.

Once we get a response from the API, or if we go beyond 500ms (hopefully keeping us well within the 1000ms time limit for suspension) we call UnityEngine.GameCore.GameCorePLM.AmReadyToSuspendNow in order to continue with the suspension.

From logs and breakpoints I can see that the PlayFAB SDK gets to the point where it calls yield return www.SendWebRequest(); (we are using the "Unity Web Request" Request Type, which I believe is the recommended type). However we never get further than this. I have verified in Fiddler that the API call is never made.

As we never get a response, our 500ms time limit is always hitting and we are never saving the players progress data.

The PlayFab code relies on coroutines which is attracting some suspicion from me.

What is the correct way to make a PlayFab API call when suspending?

GDK Version GDK October 2022: Version 10.0.22621.1852

Thanks,

Andy

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

·
Rick Chen avatar image
Rick Chen answered

Due to NDA policy, Xbox related questions shouldn't be discussed in the public forum. Please follow the instructions on Paid Technical Support - PlayFab | Microsoft Docs to contact us.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]