Search Unity

Need Help: How to link to my app's Google Play listing

Discussion in 'Android' started by kingdutka, Apr 4, 2012.

  1. kingdutka

    kingdutka

    Joined:
    Feb 1, 2011
    Posts:
    129
    Do I just use my app's link or is there a better way to do this? I want people to be able to click a link that takes them to the game on Google Play so they can rate it and add comments. I'd like this to go directly through the Google Play "App" on their phone rather than opening their phone's web browser.


    Also, I noticed that on my game's listing in Google Play, there is no spot to rate the game, but only when using the Google Play "App" my phone. If I go there via my web browser, I can see the spot to rate and add comments:
    Wuzzle Invasion 2M Beta Demo

    :confused:
     
  2. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    As for the first part, you simply send an Intent from Java code.

    Code (csharp):
    1.  
    2. public void openInGooglePlay() {
    3.     Intent googlePlayIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.ArchonGames.Shooter"));
    4.     startActivity(googlePlayIntent);
    5. }
    6.  
    and call it via JNI from Unity.

    The Intent in Android ins like a broadcast. Certain Applications can register them for special Intents, i.e. ACTION_VIEW (which is quite a broad term and can include anything, from a record to a url, movie etc.). Some (like Google play) can also register themselves for "ACTION_VIEW" AND http/https AND for "play.google.com" authority. That's what Google Play/Android Market does. Youtube does the same for "youtube.com" authority (domain). If more than one app is listening to that same Intent, a popup will appear on users device and he can chose which App he would like to use to open this kind of content.

    Alternatively you can use this as uri: market://details?id=com.ArchonGames.Shooter
    However, will only work with Android Market/Google Play.The HTTP Version is better, because if the user has installed your game via some 3rd party store (Amazon, AndroidPit, GetJar or SlideME), the chance are that they don't have Android Market/Google Play installed on their system.

    There is. When you open the link select the "User Reviews" tab and then there is a link next to "User Reveiws" headline, which says "Write a Review >".
     
  3. kingdutka

    kingdutka

    Joined:
    Feb 1, 2011
    Posts:
    129
    Does this apply to JavaScript as well? I am not too familiar with C# yet...
     
  4. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    Did I said C# anywhere? I said it's Java code. NOT C# and NOT JavaScript/UnityScript. You do it in Eclipse. Look at documentation how to setup a Unity3D Project in Eclipse

    Then use JNI calls (also read up in the documentation) to call that method.
     
  5. kingdutka

    kingdutka

    Joined:
    Feb 1, 2011
    Posts:
    129
    Oh, I was just looking at the code and "public void openInGooglePlay" is a classic way of defining a function in C#.... In java you use "function openInGooglePlay"

    I've never used Eclipse and am quite happy with using Unity the way it is... Isn't there an "out of the box" solution?
     
  6. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    JavaScript/UnityScript IS NOT JAVA.
     
  7. Limbic Denis

    Limbic Denis

    Joined:
    Jul 12, 2010
    Posts:
    8
    @Tseng: no need to be that harsh ;)

    Sure there is an out of box solution! MAN IT'S UNTIY IT'S ALL OUT OF BOX

    Just insert this line in your c# code:
    Application.OpenURL("market://details?id=com.FreebordGame.FreebordTheGame");

    Feel free to like my app's facebook page if you like this out of box, easy to do, solution :D
     
  8. kingdutka

    kingdutka

    Joined:
    Feb 1, 2011
    Posts:
    129
    This is exactly what I was looking for however, I figured it out on my own a few weeks ago and simply forgot to post my findings... Thanks tho!! :)
     
  9. kingdutka

    kingdutka

    Joined:
    Feb 1, 2011
    Posts:
    129
    Oh and by the way, I can see the spot for rating and adding comments to my app now... I think it just took some time to kick in... (Like 2-3 days!!)
     
  10. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    Did he say Javascript/UnityScript IS JAVA anywhere?
    He's just merely asking if it's applicable.

    What a jerk.
     
    Last edited: May 30, 2012
  11. Deleted User

    Deleted User

    Guest

    So Im more on the artist side and have NO coding experience. Is this topic something I could do with out a huge amount of knowledge? Is there a step by step somewhere I could see..or someone kind enough to walk me thought it?
    Thanks
     
  12. miksumortti

    miksumortti

    Joined:
    Apr 7, 2012
    Posts:
    204
    The line you quoted is all you need, change the app identifier to your own and you are ready to go.
     
  13. Deleted User

    Deleted User

    Guest

    ..I understand about the identifier but do I just drag that line of code onto my button? I'm using PlayMaker and understand how to wire things together.. sorry... totally new to the scripting part of things. :confused:
     
  14. miksumortti

    miksumortti

    Joined:
    Apr 7, 2012
    Posts:
    204
    You put that in your button script under the 'if button pressed'-statement.
     
  15. JigneshKoradiya

    JigneshKoradiya

    Joined:
    Dec 7, 2014
    Posts:
    5


    this include how to add app on google play console and add inaap product to console
     
    putrabiz likes this.