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.