Search Unity

Android : Force update apk when new version

Discussion in 'Android' started by Mr-Blue825, Aug 1, 2015.

  1. Mr-Blue825

    Mr-Blue825

    Joined:
    Oct 8, 2012
    Posts:
    30
    Hi,

    I search how to check when the game start if their is a new version on the play store, and display a message (or what you want canvas, toast, ...) if a new version exist to force the player to update the game.

    I found nothing on the forum, asset store and internet.
    Can you help me ?

    Very cordially.
     
  2. 128bit

    128bit

    Joined:
    Oct 8, 2014
    Posts:
    117
    I would just solve it, by hosting the version number on an external server. You just have to update it each time your new update is online.
     
  3. Mr-Blue825

    Mr-Blue825

    Joined:
    Oct 8, 2012
    Posts:
    30
    I already though to this solution, but it is not an automaticaly way.
    I prefere for exemple an plugin who parse play store (but depends on langage of the client, so it is complicated).
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I don't think you have an automatic solution for this.

    Also, as far as I know, you cannot get the current live version from the google play store (there actually may be multiple different APKs at any given moment).

    We have a solution for this using our backend servers - the game client can connect to our servers (but this can probably be just a static file holding the most up to date version), in case the client version is lower than the newest version it can be redirected to download the new version from the store.
     
  5. dm_bond

    dm_bond

    Joined:
    Sep 19, 2011
    Posts:
    62
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  7. setauz

    setauz

    Joined:
    Jan 19, 2017
    Posts:
    8
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Last edited: Dec 9, 2019
  9. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Can you guide me the latest way to force update the game? I want when player open the game it will check new version and show UI with update button to force the player to update the game if it's old version. Press update button will auto direct to the google play store with the selected game. Seems like the the feature now is move to a package called Unity Remote Config.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your first step would be to get the sample code working for Remote Config , have you done this?
     
    optimise likes this.
  11. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Ya. But I cannot understand why ConfigManager.FetchCompleted callback will call two times. First time with default value then following with the actual config from the remote config server. Is that a bug?

    upload_2019-12-23_16-4-29.png
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes
     
    optimise likes this.
  13. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    What is the ETA of getting this bug fix?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you show your FetchCompleted callback? Do you have a similar switch statement, checking the ConfigOrigin?

    Code (CSharp):
    1. case ConfigOrigin.Default:
    2.                 MyDebug("No settings loaded this session; using default values.");
    3.                 break;
    4.             case ConfigOrigin.Cached:
    5.                 MyDebug("No settings loaded this session; using cached values from a previous session.");
    6.                 break;
    7.             case ConfigOrigin.Remote:
    8.                 assignmentId = ConfigManager.appConfig.assignmentID;
    9.                 MyDebug("assignmentId = " + assignmentId.ToString());
    10.                 break;
    11.  
     
  15. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Ya. Anyway I already fix the bug by upgrading the package to latest version.
     
  16. MOHITyqit

    MOHITyqit

    Joined:
    Jul 20, 2018
    Posts:
    5
    Hey please can you share the code i want to do that but don't know how to do it
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would use Package Manager in the Unity Editor to upgrade the Remote Config package
     
  18. ritesh_khokhani

    ritesh_khokhani

    Joined:
    Jun 26, 2013
    Posts:
    47
    BelalGawish likes this.