ios - How do I add a rate me button to an app that has not been released? -


so launch app app store. issue have rate app please button not know right code insert there.

my fiends tried on app , said no good:

does know how can fix issue?

 let itunesreviewpagelink = "http://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?id=1073785561&pagenumber=0&sortordering=2&type=purple+software&mt=8"          // go directly review page on app store         if let url = nsurl(string: itunesreviewpagelink) {             uiapplication.sharedapplication().openurl(url)         } 

if app not yet released, haven't got app store link. that's impossible.

in order implement functionality when app released, can use following code:

swift 2

let appidstring = "app_id" // app id  let reviewsurlstring = "http://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?pagenumber=0&sortordering=1&type=purple+software&mt=8&id=\(appidstring)" let reviewsurl = nsurl(string: reviewsurlstring)  if reviewsurl != nil && uiapplication.sharedapplication().canopenurl(reviewsurl!) {      uiapplication.sharedapplication().openurl(reviewsurl!) } else {      // handle situation if reviews url cannot opened. } 

swift 3

let appidstring = "app_id" // app id  let reviewsurlstring = "http://itunes.apple.com/webobjects/mzstore.woa/wa/viewcontentsuserreviews?pagenumber=0&sortordering=1&type=purple+software&mt=8&id=\(appidstring)" let reviewsurl = url(string: reviewsurlstring)  if reviewsurl != nil && uiapplication.shared.canopenurl(reviewsurl!) {     uiapplication.shared.openurl(reviewsurl!) } else {      // handle situation if reviews url cannot opened. } 

edit:

this links works in ios 8 , 9 , links directly reviews page of app in app store application. not sure ios 7. ios 7 need use different link.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -