4

We are in the process of switching our game from our own canvas page, to using the Unity integration on Facebook. However, during our development tests we have occasionally run into a problem where the webplayer binary gets loaded from the browser cache, even though a newer version was uploaded to the server.

Manually clearing the browser cache solves the problem, but that's not exactly a solution we want to present to our users all the time. Previously, when we embedded the unity object ourselves, we also passed in a ?version flag with the url, which would keep it up to date, but we can't exactly do that anymore with integration turned on, unless we manually update the binary location link in our app settings every time we do a build (Kind of a pain in the butt, since the rest of our build process is automated)

Is there any way around this? Thanks.

2 Answers2

2

We have exactly same problem and I can say only solution is to change the binary file name everytime you made a build but only for your production environment. Here is our solution:

  • We have development (sandbox mode)and production environment and one app for each one.

  • For development, we ran everything locally, we have buildpipeline that builds and copies the binary file to appropriate place with the same name always like MyGame.unity3d, and we have set our browsers not to cache anything, that solves the problem for testing.

  • For production, our buildpipeline constructs the binary name with: YourGameNameMainVersion.SubVersion.TimeStamp like: MyGame0.3.1006-1004.unity3d and this one is manually set from facebook's app settings page in every build. But this is not a big problem as you won't want to make a new build more than once/twice a day for production.

chaosmaker
  • 191
  • 1
  • 11
  • 1
    We've found that all that needs to be done is to add "?version=xxxx" (where xxxx is our latest revision number) to the end of the unity binary URL we supply Facebook. We don't actually rename the binary at all. This "seems" to be enough to get the browser to know it's a new file and to not load it from cache. Like you, we have to manually update it every time, but like you said, you generally aren't doing production builds too often, so it's not the end of the world. – timmypowergamer Jun 12 '14 at 19:52
2

We've found that all that needs to be done is to add "?version=xxxx"

This works, and perfectly fine. I do now, is only change version (?version=1.52) in main link:

<a href="http://cometoplaynow.com/Labyrinth3D/Labyrinth3D.html?version=1.52">

Have advantages using it:

  1. Changing only 1 number - link is still the same (if people open game from your site)

  2. Savings will stay as it was (if you change .unity3d you will lost PlayerPrefs).

  • The problem with this method as I experienced it, is that it will never cache. It will always get the full .unity3d binary from the web. Am I wrong ? – Eyal.K Aug 02 '15 at 18:21