- Home /
Webplayer Freeze / Crash After Facebook Interaction
I'm having an issue that occurs in our game AFTER interacting with Facebook. ie. check messages, check notifications, try to do a Facebook purchase, etc.
I am using the Facebook SDK for Unity integration. When the user makes an interaction with one of these items, a Facebook callback OnHideUnity will be called. I notice that I need to reset the resolution size of the screen otherwise it will come back as 1 by 1.
public void OnHideUnity(bool isGameShown)
{
if (!isGameShown)
{
Time.timeScale = 0;
m_previousWidth = Screen.width;
m_previousHeight = Screen.height;
}
else
{
Screen.SetResolution(m_previousWidth, m_previousHeight, false);
Time.timeScale = 1;
}
}
I also notice that my game does NOT render, as if paused, and while Facebook has the main focus, the memory being used in the browser tab increases continuously each second. I notice other Facebook Unity games also lose some memory while Facebook interactions are occuring.
After calling any of CancelInvoke(), Application.LoadLevelAsync, or Application.LoadLevelAdditiveAsync will cause the game to freeze and then the Unity Plugin to crash.
Am I not handling this callback correctly?
I have also noticed that the Webplayers resolution size would change, and upon coming back to focus from Facebooks OnHideUnity(true), I have to manually call Screen.SetResolution, Do others have this issue?
Is there any insight that can be provided into my issue?
Your answer
Follow this Question
Related Questions
Facebook Interaction LoadLevelAsync Progress Freezes 0 Answers
White screen freeze and crash on Android 0 Answers
Unity Crash Problem 3 Answers
MonoDevelop from Unity 3.5 keeps freezing 2 Answers
iOS game freezes on startup 0 Answers