1

Using Flash Builder/Flex Mobile, is there a way to create a button in an iphone/ipad app that will redirect and open the app store/review section of your application? Just trying to find a way to get users to rate my app.

Thanks!

Dave Bilodeau
  • 249
  • 1
  • 5
  • 13

2 Answers2

2

Assuming you have a URL that you want to open, you can use navigateToURL to do so:

var myURL :String = 'URL to your iOS application';
navigateToURL(new URLRequest(myURL));

Then just trigger that code from the click event of a button.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • Thanks! This would work, however I am getting an error, looks like because the URL includes "&type=" in it. This is the second part of the my question above. You need the proper URL which I have found, see here for answer on that part [link](http://stackoverflow.com/questions/3374050/url-for-sending-a-user-to-the-app-review-page-on-devices-app-store). Any thoughts on how to deal with the error here so I can get up and running? Thanks! – Dave Bilodeau Sep 23 '12 at 18:05
  • @DaveBilodeau I'm sorry; I don't see the part of your question where you mention that using '& in the URL is causing errors. – JeffryHouser Sep 23 '12 at 20:49
1

OK I think I have a full answer now. Thanks to Flextras and some googling.

So to make a button that will redirect to Apple Store review page for your app in Flex Mobile project..

<fx:Script>
    <![CDATA[
        import flash.net.navigateToURL;
        protected function clickHandler(event:MouseEvent):void
        {
            var urlReq:URLRequest = new URLRequest("https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?id=(YOU APP ID GOES HERE)&type=Purple+Software");
            navigateToURL(urlReq, "_self");
        }
    ]]>
</fx:Script>

Then the button..

<s:Button y="720" width="65%" height="70" label="Rate this App"
   click="clickHandler(event)" /> 
Dave Bilodeau
  • 249
  • 1
  • 5
  • 13