Opening the app store from a game

Discussion in 'Public Game Developers Forum' started by shen, Mar 23, 2010.

  1. I'm trying to improve the code for my "More Games" button

    I am trying to get it to open the app store on the ipod with a search for my name (and thus all my games).

    right now I have code that looks like this:

    NSURL *url = [NSURL URLWithString:mad:"http://itunes.com/apps/shenmansell"];

    [[UIApplication sharedApplication] openURL:url];

    That works, but first it quits the app, then opens safari, then closes safari and opens iTunes, then closes iTunes and opens the app store.

    Is there a way to get the app store to load directly?

    Any help is greatly appreciated
    Shen
     
  2. Flickitty

    Flickitty Well-Known Member

    Oct 14, 2009
    761
    1
    0
    iPhone Dev
    The easiest way to do this without exiting the game would be to use UIWebView, and then point it to a webpage of your own design. This will allow you to update and change the page anytime you like.

    If a person decides to purchase, they can click a link (icon) and the game will exit and take them to the App Store. As far as I know, there isn't a single-click solution for this (allowing the purchase of a different game).

    This essentially runs Safari within your game without exiting the game. Last I heard, UIWebView is still a resource hog (about 9-10 megs), so be careful that you don't run out of memory.
     
  3. Hmar9333

    Hmar9333 Well-Known Member

    Jul 11, 2009
    2,585
    0
    0
    Book Salesperson/Student
    Melbourne, Australia
    I have no idea, but as a consumer I must warn you against that.

    I get really frustrated when an app quits itself because I clicked a link, often accidentally, if I press a more games button, I expect to be taken to a different menu, ala Plants vs. Zombies. At least make a popup window informing users that continuing will exit the app.
     
  4. Carlos

    Carlos Well-Known Member

    Sep 29, 2009
    755
    0
    0
    Software architect, game dev and book author
    xor eax, eax
  5. Flickitty: I'm a little bit worried about pointing to a webpage on my own server, since my game has won the free lottery, and had about 1.2 million downloads over the last week.

    I wouldn't want to "slashdot" my own server.

    Sadly after this happened I figured out that my current "more games" code was only working 10% of the time, and normally just opens users into the app store without actually bringing up any of my games.

    Hmar9333: Thanks for the input.
     
  6. MrBlue

    MrBlue Well-Known Member

    Sep 3, 2008
    320
    1
    0
    iPhone Developer
    use this:

    itms://itunes.com/apps/shenmansell
     
  7. Carlos: I've been looking at the Q+A, and it looks like the listing 2 should be what I need, however I haven't been able to get it to work in my own code.

    The second function just ends up getting null for the request and response,
    and the connectionDidFinishLoading never gets called.

    In my new code I'm currently using a link like at the bottom of http://bjango.com/articles/ituneslinks/ , however it is the one that opens safari and itunes before it opens the app store.
     
  8. MrBlue: that gets rid of safari, but itunes still opens before the app store.

    I've just noticed that that style link - itms://itunes.com/apps/shenmansell has the same problem that my old link had.

    If the user had previously left the app store after doing a search and the main display is an app from that search, then opening the store with the link above will just redisplay the app from the last session, and not show the new search.

    It looks like I may have to serve my own web pages after all, or some variation on that theme :p
     
  9. kohjingyu

    kohjingyu Well-Known Member

    Mar 20, 2009
    1,770
    0
    0
    Student/Developer
    Singapore
  10. This works for linking directly to an app, and it works great for a "Buy now" button that is up selling a lite version.

    It doesn't work with opening a link to all my games though, as the iPhone has some technical bug that stops artist links from working.

     
  11. Hi shen,

    Congrats on the mega feature!

    Since you are looking to take advantage of those 1.2 million people to sell other games, I would simply create a new screen in Interface Builder (or coded directly if you prefer) that shows your app images and descriptions of your apps in it. Make it scroll vertically if you want to feature all your apps. Basically like the App Store app.

    Make a "Buy Now" button for each app that links directly to its iTunes page.

    Take a look at how NimbleBit does it in the More Games page of Scoops (free to download). Their system goes over the network, but for a quick fix, you can do it all hardcoded for now and add a network-enabled version later.

    By the way, how did you manage to get so high? Were you featured somewhere?
     
  12. I was featured on FreeGameOfTheDay, the openfeint one last monday.

    I got around 50 000 downloads the day of the feature, and then more and more the next 2 days.

    I think the fact that the game is a well known + simple one, and not hardcore or complex really helped drive the downloads.

    I've been meaning to write up a post about it, but haven't been able to think up a funny title for the thread yet.
     
  13. Zincous

    Zincous Well-Known Member

    Dec 23, 2008
    4,567
    46
    36
    Sacramento, CA

Share This Page