Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Prasanna · Jan 10, 2015 at 12:50 PM · androidjavascriptandroidpluginnotification

Update Notification

Hi all, i need to give the update notification like clash of clans. They give the notification for game updates like that i want. Any ideas? am using android platform.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by NoseKills · Jan 10, 2015 at 06:31 PM

In Clash of Clans (just like any other "always connected" game) the update notifications are triggered when the client connects to the game server. Then based on whatever rules the developers decide they want, they can have the client app show that notification: if client notices the server version is newer than client version, if the server sends a specific message telling the client to show it...

The client itself can't know of any updates. You need to have a url/server from which you can make the client check the newest version from, and where you can update the required version number when you make a new release.

If you have a URL where you can maintain a text file with the newest version number, you could make your app just download that file and parse the version number from it and then show a notification if needed.

Just remember that you should update the version file only after the new client version is actually available on Google Play. It can take hours after uploading an APK for it to become available.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Prasanna · Jan 12, 2015 at 05:28 AM 0
Share

So, may i add the version update using by my assetbundle?

avatar image NoseKills · Jan 13, 2015 at 04:45 AM 0
Share

If I understand what you mean correctly, yes. If you have a place where you host asset bundles that your app downloads and uses, those bundles could contain for example a text file with the latest compatible version number. If the client knows it's own version number too, it can then compare those two and show the notification when needed.

avatar image Prasanna · Jan 13, 2015 at 05:18 AM 0
Share

Okay, thanks but i don't know how to do this with my asset bundle here is my assetbundle, yes an i have a version number too. Can you please tell me how to do that or do you know any link for learning this, because i tried many link they used some 10 lines code for that, i didn't what it's contained.

 using UnityEngine;
 using System.Collections;
 public class BundleLoad : $$anonymous$$onoBehaviour
 {
     private string progress = " "; 
     private string logtxt;
     private string url = "$$anonymous$$y_Url_Link";
     
     GUIStyle Font_Size;
     
     void Awake()
     {
         Font_Size = new GUIStyle ();
         Font_Size.fontSize = 40;
         Font_Size.normal.textColor = Color.black;
     }
     
     void log( string t )
     {
         
         logtxt += t + "/n";
     }
     void OnGUI()
     {
         Vector3 scale;
         
         float ResolutionX   = 1024;
         float ResolutionY   = 768;
         
         scale.x             = (float)Screen.width/ResolutionX;
         scale.y             = (float)Screen.height/ResolutionY;
         scale.z             = 1;
         
         $$anonymous$$atrix4x4 sv$$anonymous$$at     = GUI.matrix;
         GUI.matrix          = $$anonymous$$atrix4x4.TRS(new Vector3(0,0,0),Quaternion.identity,scale);
         
         GUI.Label (new Rect (560, 684, Screen.width - 5, Screen.height - 5), "Downloading: ", Font_Size);
         GUI.Label (new Rect(795, 684, Screen.width - 5, Screen.height - 5), logtxt + " " + progress, Font_Size);
     }
     
     IEnumerator Start()
     {
         using(WWW www = WWW.LoadFromCacheOrDownload (url, 1))
         { 
             while( !www.isDone )
             {
                 progress = " " + (www.progress * 100.0f).ToString("#") + " %";
                 yield return null;
             }
             yield return www;
             AssetBundle bundle = www.assetBundle;
             bundle.LoadAll();
             Application.LoadLevel("$$anonymous$$ain_$$anonymous$$enu");
         }
     }
 }
avatar image NoseKills · Jan 14, 2015 at 04:35 AM 0
Share

I actually haven't used asset bundles myself, but looking at this example i think you should be able to just have a TextAsset or a GameObject with a "Versioin Script" attached to it in your bundle and load it from there.

  AssetBundleRequest request = bundle.LoadAsync ("versionObject", typeof(GameObject));


You are using

  bundle.LoadAll();

and it returns an Object[]. I don't know how to find the desired object from it but you should be able to do that too.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to put a permanent notification on phone? 0 Answers

Extending the UnityPlayerActivity Java Code fail to build 1 Answer

Having issue with "unable to convert class to dex format" extremely simple JAR in empty project. 0 Answers

Call android code which then calls a method in jar file 1 Answer

unity android crash report problem 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges