Search Unity

How to open an market Intent

Discussion in 'Android' started by leonardoaraujo, Oct 15, 2010.

  1. leonardoaraujo

    leonardoaraujo

    Joined:
    Jun 3, 2010
    Posts:
    87
    Hi guys I'm working on a free version of my game and, it should have some buy now button where it opens the android market ... In java I do something like this....

    Code (csharp):
    1.  
    2. private void openActionView(String url){
    3.         Intent updateIntent = null;
    4.         updateIntent = new Intent(Intent.ACTION_VIEW,
    5.                 Uri.parse(url));
    6.         startActivity(updateIntent);
    7.     }
    8. .......
    9. openActionView("market://search?q=pname:com.nerdgroup.WarControlPro");                                                                                 
    10.  
    11.  

    But in unity3d android, I can do something like this??
    Application.OpenURL ("market://search?q=pname:com.nerdgroup.WarControlPro");
     
  2. leonardoaraujo

    leonardoaraujo

    Joined:
    Jun 3, 2010
    Posts:
    87
    Guys I've tested the Application.OpenURL ("market://search?q=pname:com.nerdgroup.WarControlPro"); and it worked on my cellphone!!!!
    I can actually use this to open the android market?
     
  3. Tomo-Games

    Tomo-Games

    Joined:
    Sep 20, 2010
    Posts:
    223
    Wow that seems interesting! I haven't gotten that far yet with Android Pro. Thanks for the tip. Does this mean you publish two apps. One named Lite and the other as is which is linked in Lite version?
     
  4. Dan Fury

    Dan Fury

    Joined:
    Jul 18, 2010
    Posts:
    158
    What you are actually doing is searching the market, I have these links under all reviewed games, they open the market app and start a search for you.
     
  5. leonardoaraujo

    leonardoaraujo

    Joined:
    Jun 3, 2010
    Posts:
    87
    Yes tomoprime this way you can improve a lot the sell performance
     
  6. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    903
    I've been avoiding a Lite version on Android because players on the Android Market seem to really embrace the fact that they always have 24 hours to refund an app if they don't like it. Therefore, "try before you buy" is already built-in without any extra work on the developer's part. But that said, it would be interesting to hear how this goes for you and whether or not it seems to help!
     
  7. Dan Fury

    Dan Fury

    Joined:
    Jul 18, 2010
    Posts:
    158
    A lite version is important, if you update your game often or have any big new features post release, since you can only try an app once on the market. Also your game doesn't get displayed on a lot of android devices, because they don't see paid apps in the market yet (be it copy protection or because their country isn't supported). A lite version helps raising awareness.
     
  8. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    903
    Those are good points, Dan. Maybe I will give it a try and see what comes of it.
     
  9. xpecttrum

    xpecttrum

    Joined:
    Mar 10, 2014
    Posts:
    5
    Hi guys, I am trying to use Application.openURL in unity for an Android game, it works fine on the PC, but when I build and run on the device, device get stuck.

    I don't know why --- the market starts to open, but then searches forever and get stuck.

    I am pointing directly to the app, not a search.

    Application.openURL("market://details?id=com.pradolabs.animalpuzzle");


    What I am doing wrong? please help, this should be easy and it is making me suffer for hour
     
  10. Jennifer1

    Jennifer1

    Joined:
    May 20, 2014
    Posts:
    6
    I am using this script in unity 4.6 and its working fine. :)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class openurl : MonoBehaviour {
    5.     // Update is called once per frame
    6.     void OnClick() {
    7.         Application.OpenURL ("market://details?id=com.Ibnesina.ImpossibleRushGame");
    8.    
    9.     }
    10. }
    11.  
    But its not working in unity4.3, I dont know what is wrong in 4.3? :(
     
    benjamindeveloper likes this.
  11. DeveshPandey

    DeveshPandey

    Joined:
    Sep 30, 2012
    Posts:
    221
  12. squarelover

    squarelover

    Joined:
    Nov 14, 2012
    Posts:
    31
    for a play store it uses same Application.OpenURL with an market prefix
    and for a LaunchApp it uses jar plugin function with (probably) java methods
    getPackageManager
    getLaunchIntent
    startIntent
    notificationlistener registered to scene object callback via UnitySendMessage
    i think the funny thing here is that everything here could be called from c# but wrapper and plugin classes packed into dll and jar (without encryption ofc)