Unity iOS opens the AppStore rating page, talking about the Application.openurl () method.

Source: Internet
Author: User

http://fairwoodgame.com/blog/?p=38

Unity iOS opens the AppStore rating page, talking about the Application.openurl () method.

Posted in Unity on August 6, 2013Comments: No Comments

It's too easy. We know that there is a URL scheme in iOS (this I have not delved into, I hope that the great God to help me put a tutorial, thank you ~ other Android also), you can open a URL to enter some of iOS apps. For example, the following link in iOS can be accessed directly into the Love Whipped Egg star page.

Itms-apps://ax.itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?type=purple+software&id= 564457517

(Try it yourself, click in the browser will inexplicably jump to itunes instead of the App Store, do not know why, but the app click is to the App Store.) )

Note that the URL of the protocol Itms-apps, this is the AppStore corresponding URL Scheme.

So it's easy to do a star-rating function in unity, using the Application.openurl (string url) method, where the URL is in the format

"Itms-apps://ax.itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?type=purple+software&id ={Application AppID} "

The code is as follows (so simple also posted ...) )

?
1234567 #if UNITY_IPHONE || UNITY_EDITOR    const string APP_ID = "564457517";    var url = string.Format(        "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id={0}",        APP_ID);    Application.OpenURL(url);#endif

After the call will go into the app Store and wait a long time to load, so slow you know, see the star rating page opens.

As you can see, the Application.openurl () method works just like the [[UIApplication sharedapplication] Openurl:url] method in iOS, which supports URL Scheme perfectly, It's too convenient (it can be done on the unity layer without going to the iOS layer).

For example, to open a search, you also have to click on iOS to have the effect, any browser can.

Weixin://findfriend/search

Of course, you have to pretend.

After I put the URL scheme study thoroughly, perhaps there will be more play, please look forward to!

Unity iOS opens the AppStore rating page, talking about the Application.openurl () method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.