timmypowergamer
timmypowergamer

Reputation: 41

Old version of Unity WebPlayer binary gets loaded from cache, using Facebook Unity integration

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.

Upvotes: 4

Views: 757

Answers (2)

Marat Zahidylin
Marat Zahidylin

Reputation: 21

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

Upvotes: 2

chaosmaker
chaosmaker

Reputation: 191

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.

Upvotes: 2

Related Questions