Search Unity

update notification

Discussion in 'Scripting' started by topofsteel, Oct 22, 2014.

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I currently code an expiration date into my projects while i'm sending them out for review to prevent unfinished/out dated projects from existing. Is there a way to implement an "Updated version available" notification. Is there a service/asset anyone has used that they can recommend? Thanks.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I just throw up a text file on my server with the version string in it, and then fetch on startup like so:

    Code (CSharp):
    1.         WWW www = new WWW("http://highfrontier.com/version.txt");
    2.         yield return www;
    3.         Debug.Log("Version.txt contains: " + www.text);
    4.         CheckVersion(www.text);
    5.  
    That is inside IEnumerator Startup(). Then the CheckVersion method compares the text found to a version constant baked into the app, and if it's newer, squawks at the user.

    Simple, but effective I think.
     
  3. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Very nice, Ill try that out first thing. Seems like i could also disable a model for non payment. Thank you!