Requesting App Ratings and Reviews Tutorial for iOS

文章推薦指數: 80 %
投票人數:10人

Requesting App Ratings and Reviews Tutorial for iOS · Log in to App Store Connect · Select My Apps · Click on the app in the list App Information, ... Group Group Group Group Group Group Group Group Group Group Shape Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group Group SpringAhead2022Sale!AnnualProSubscriptions50%off Allraywenderlich.comAnnualProSubscriptionsandbooksare50%off—foralimitedtimeonly! Learnmore raywenderlich.com raywenderlich.com Hidecontents RequestingAppRatingsandReviewsTutorialforiOS WhyDoRatingsandReviewsMatter? GettingStarted RequestingAppRatings SKStoreReviewControllerLimitations FindingtheRightTimetoRequestaRating AddingReviewRequestLogicintheSampleApp PuttingItAllTogether ManuallyRequestingaReview AppStoreProductPageURL Inthistutorial,you’regoingtolearnaboutrequestingratingsandreviewsinyouriOSapps.StartingwithiOS10.3,AppleintroducedthenewSKStoreReviewControllerclasstostandardizethisinteraction.Inthistutorial,you’lllearnhowtocorrectlyimplementthisAPI,aswellaslearnsometipsonhowtomaximizeyourchancesofgettinggreatreviewsfromyourhappyusers. WhyDoRatingsandReviewsMatter? WithmorethanamillionappsontheiOSAppStore,thereareliterallyhundredsorthousandsofappsinanygivenappcategory.It’sbecomingmoredifficultforuserstoknowifanappisworthdownloadingandtryingout. Usershavealsobecomeusedtorelyingonratingsandreviewswhenmakingpurchasedecisions,whetherit’sbuyingproductsonAmazon,findingrestaurants,bookinghotelsorwatchingmovies.It’s,therefore,crucialyourpotentialusershaveaccesstoasmuchinformationastheyneedbeforedownloadingyourapp.Highratingsandlotsofreviewsalsoleaveapositiveimpressiononthesepotentialusersandincreasethelikelihoodtheywillinstallyourapp. AnotheraspectinwhichratingsandreviewshelpistoimproveyourrankingontheAppStore.AccordingtoastudydonebyForrester,63%ofappsarediscoveredthroughAppStoresearches.Howdoyougetyourapptorankhigherandstandoutinsuchacrowdedmarketplace?ResearchdonebyAppRadarsuggeststhenumberandaverageofratings,aswellasthenumberofreviews,hasastronginfluenceonhowyourappranksinAppStoresearchresults. Inordertoimproveyourapp’sdiscoverabilityintheAppStore,aswellasincreasethenumberofuserswhoinstallyourapponcetheyreachyourapppage,it’simportantyourapphasasignificantnumberofratingsandreviews. Beforeyougetstarted,youmightstillbewonderingtheimportanceofhavingabuilt-inpromptaskingyouruserstorateyourapp?Inordertoshowyouhoweffectiveitcanbe,let’stakealookatanotherpopularappontheAppStore—Instagram. ImagegeneratedbyAppbot.co Asyoucanseeinthegraphabove,somethinghappenedinAugust2017,butwhatcouldithavebeen?ThisMediumpostfromClémentDelanguepointsoutthatInstagramaddedtheSKStoreReviewControllerintoitsapparoundthistime—justlookattheimpactithad! Nextup,you’llseehowyoucanachievesimilarresultswithyourusersaswell. GettingStarted Inthistutorial,you’lltakeanappthatpresentsasearchablelistofbirdsoundsanduseSKStoreReviewControllertopromptuserstoratetheapp. Togetstarted,clicktheDownloadMaterialsbuttonatthetoporbottomofthistutorial.Inthedownloadedfolder,navigateintotheChirper-StarterfolderandopenChirper.xcodeprojinXcode.Buildandruntheapp,andyou’llseethefollowing: RequestingAppRatings Getstartedbyaddinganewfiletotheproject.Right-clickontheyellowChirperfolderintheprojectnavigatorandselectNewFile….SelectSwiftFilefromthepresentedoptions,clickNextandnameitAppStoreReviewManager.swift. Pastethefollowingintoyournewlycreatedfile: importStoreKit enumAppStoreReviewManager{ staticfuncrequestReviewIfAppropriate(){ } } You’redoingafewimportantthingshere: ImportingtheStoreKitframework.StoreKitallowsyoutodomanythingsrelatedtotheAppleStoressuchasmanagingInAppPurchases,checkingAppleMusiccapabilitiesordisplayingproductrecommendationsinsideyourapp.Inthistutorial,however,you’lluseittotriggerthereviewprompt. CreateanenumcalledAppStoreReviewManager.You’llusethisasanamespacetowrapthestaticfunctionsandpropertieswithin.Enumsareusefulforthisbecauseyoucan’tinitializethemiftheydeclarenocases. Next,youneedtoaskStoreKittorequestareviewfromtheuser.YoucandothisbyusingstaticSKStoreReviewController.requestReview().AddthefollowingtorequestReviewIfAppropriate(): SKStoreReviewController.requestReview() Inordertotestthatitworks,callthismethodwhentheuserplaysasound.OpenBirdSoundTableViewCell.swiftandcallyournewfunctionattheendofstartPlaying(with:): AppStoreReviewManager.requestReviewIfAppropriate() Buildandruntheapp.TapthePlaybuttonononeofthesounds.Youwillseeapromptaskingyoutoratetheapp! Hooray!Withjustthatonelineofcodeyouwereabletorequesttheusertorateyourapp!:] Note:TheSubmitbuttonwillappeargrayedoutsinceyouareindevelopmentmode.ItwillappearenabledforusersusingyourappthroughtheAppStore. SKStoreReviewControllerLimitations AppledoesenforcecertainlimitationsonhowyouusethisAPI: Nomatterhowmanytimesyourequestthereviewprompt,thesystemwillshowthepromptamaximumofthreetimesina365-dayperiod. Callingthemethodisnotaguaranteethatthepromptwilldisplay.Thismeansthatit’snotappropriatetocalltheAPIinresponsetoabuttontaporotheruseraction. Thesystemmustnothaveshownthepromptforaversionoftheappbundlethatmatchesthecurrentbundleversion.Thisensuresthattheuserisnotaskedtoreviewthesameversionofyourappmultipletimes. Note:Thereviewpromptwillbehavedifferentlydependingonthetypeofbuildthatyouarerunning: Development:Showneverytimetheyourequesttheprompt. TestFlight:Promptisnevershown. AppStore:Shownwiththelimitationsdescribedabove. FindingtheRightTimetoRequestaRating ChoosingwhereandwhentodisplaythispromptiscriticaltoyoursuccessusingthisAPI. Themomentthesystemshowstheprompttotheusercanhavegreateffectontheresultwhenrequestingappratings.Forexample,youshouldn’taskforareviewwhiletheuserisinthemiddleofatask.Also,ifyoutrackappcrashes,youshouldmakesuretowaitadayormorebeforerequestingareview. Instead,youshouldmakeabigefforttoaskforratingswhentheuserishappy.Forinstance,aftertheuserhasreturnedtoyourapprepeatedly,completedalevelofyourgameorfinishedavideocall,etc.Whicheverengagementmetricyouchoosetotrackandtriggertheratingprompt,makesurethattheuserhashadachancetoexperiencethefullvaluepropositionofyourapp—thatway,apositivereviewisamorelikelyresult. Note:Afterfollowingtheaboveadvice,youmightwonderwhyyouaretriggeringthepromptwhenplayingarecording.Wouldn’titjustannoytheuserandresultinabadrating?You’reright;itwouldbemuchmoreappropriatetotriggerthepromptattheendofplayback.Tomaketestinginthistutorialsimple,you’llleaveitwhereitisbut,ifyoureallywant,youcouldmovethecalltoBirdSoundTableViewCell.didPlayToEndTime(_:). AddingReviewRequestLogicintheSampleApp Inthesampleapp,you’lluseastrategywhereyouwillaskusersforaratingoncetheyhaveplayedatleastthreerecordings.Thisnumberisdeliberatelylowsothatyoucantesttheconcept.Inareal-worldapp,youwouldwanttokeepthisnumbermuchhigherforasimilaruseraction. OpenAppStoreReviewManager.swiftandreplacerequestReviewIfAppropriate()withthefollowing: //1. staticletminimumReviewWorthyActionCount=3 staticfuncrequestReviewIfAppropriate(){ letdefaults=UserDefaults.standard letbundle=Bundle.main //2. varactionCount=defaults.integer(forKey:.reviewWorthyActionCount) //3. actionCount+=1 //4. defaults.set(actionCount,forKey:.reviewWorthyActionCount) //5. guardactionCount>=minimumReviewWorthyActionCountelse{ return } //6. letbundleVersionKey=kCFBundleVersionKeyasString letcurrentVersion=bundle.object(forInfoDictionaryKey:bundleVersionKey)as?String letlastVersion=defaults.string(forKey:.lastReviewRequestAppVersion) //7. guardlastVersion==nil||lastVersion!=currentVersionelse{ return } //8. SKStoreReviewController.requestReview() //9. defaults.set(0,forKey:.reviewWorthyActionCount) defaults.set(currentVersion,forKey:.lastReviewRequestAppVersion) } Breakingdownthecodeabove: Declareaconstantvaluetospecifythenumberoftimesthatusermustperformareview-worthyaction. ReadthecurrentnumberofactionsthattheuserhasperformedsincethelastrequestedreviewfromtheUserDefaults. Note:ThissampleprojectusesanextensiononUserDefaultstoeliminatetheneedforusing“stringly”typedkeyswhenaccessingvalues.Thisisagoodpracticetofollowinordertoavoidaccidentallymistypingakeyasitcancausehard-to-findbugsinyourapp.YoucanfindthisextensioninUserDefaults+Key.swift. IncrementtheactioncountvaluereadfromUserDefaults. Settheincrementedcountbackintotheuserdefaultsforthenexttimethatyoutriggerthefunction. Checkiftheactioncounthasnowexceededtheminimumthresholdtotriggerareview.Ifithasn’t,thefunctionwillnowreturn. Readthecurrentbundleversionandthelastbundleversionusedduringthelastprompt(ifany). Checkifthisisthefirstrequestforthisversionoftheappbeforecontinuing. AskStoreKittorequestareview. ResettheactioncountandstorethecurrentversioninUserDefaultssothatyoudon’trequestagainonthisversionoftheapp. PuttingItAllTogether Buildandruntheapp.Thistime,ifyouplayasound,itwon’timmediatelyshowthereviewprompt.Playthesoundtwomoretimesand,onlythen,theappwillpresentyouwiththeratingprompt.You’llalsonoticethatthepromptwon’tshowagainnomatterhowmanyrecordingsyouplay. ClickontheChirperprojecticonintheProjectnavigator,thenChirperagainunderthelistofpresentedtargets.UpdatethevalueintheBuildfieldtoupdatethevalueofCFBundleVersioninyourappsInfo.plist. Buildandruntheapp.Again,playmorerecordings.Oncethe.reviewWorthyActionCountvalueexceedsthreeagain,theversioncheckinstep7willsucceedand,becauseyou’vechangedthebundleversion,you’llbepromptedagaintogiveanotherratingforthenewversionofyourapp. ManuallyRequestingaReview Sonowyouknowhowtopromptyouruserstoprovidearatingwhileusingyourapp,you’llmoveontoexploringhowtoletyourusersmanuallyreviewtheappiftheywishtowithouthavingtowaitforAppStoreReviewManagertodecideiftheyshouldornot. AppStoreProductPageURL Firstofall,youneedtoknowtheurlforyourappontheAppStore.Ifyourappisalreadylive,thenthisisprettyeasy;youcansearchforyourappinGoogleandcopytheurl.Alternatively,youcanfinditontheAppStoreandtapthe…buttonontheproductpagetorevealaShareApp…optionthatallowsyoutocopythelinktoyourclipboard. Ifyou’restillbuildingthefirstversionofyourappandhaven’tyetreleaseditontheAppStore,don’tworry;aslongasyouhavealreadysetupyourappusingAppStoreConnect,thenyou’llstillbeabletogetthelinkbeforeyouevensubmityourfinaltoAppStoreReview.Tofindthislink: LogintoAppStoreConnect . SelectMyApps . ClickontheappinthelistAppInformation,whereyouwillthenfindalinktoViewonAppStoreatthebottomofthepage. Note:Ifyouaren’tyetupandrunningwithAppStoreConnect,thencheckoutthisVideoCourseorthisTutorialtoexplaineverythingthatyouneedtoknow. TheURLyouendupobtainingwilllooksomethinglikethis: https://itunes.apple.com/us/app/rwdevcon-conference/id958625272?mt=8 Beforeyoucontinue,you’llcleanuptheURLalittlebitassomecomponentsarenotrequiredandcanchangeovertime.Youcanexcludethecountrycode,appnameandqueryparameterfromtheURLsothattheaboveexamplewouldbecomethefollowing: https://itunes.apple.com/app/id958625272 TheexactURLaboveisalreadyincludedinthesampleproject,inSettingsViewController.swift.IfyouwanttosubstitutetheURLforyourownapp,goaheadandchangetheproductURLconstant,otherwiseleaveitasitisandyou’llbereviewingtheRWDevConapp.Bekind! WritingaReview NowthatyouhaveaproductURLforyourapp,youcanusethistotakeyourusersdirectlytotheWriteaReviewactionintheAppStore.Allyouhavetodoisappendaqueryparameterwiththenameactionandthevaluewrite-reviewtotheproductpageURL;then,openitonaniOSdevicetogodirectlyintotheAppStoreapp. Addthisfunctionalitytothesampleapp! OpenSettingsViewController.swiftandaddthefollowingcodetowriteReview(): //1. varcomponents=URLComponents(url:productURL,resolvingAgainstBaseURL:false) //2. components?.queryItems=[ URLQueryItem(name:"action",value:"write-review") ] //3. guardletwriteReviewURL=components?.urlelse{ return } //4. UIApplication.shared.open(writeReviewURL) ThecodeaboverunswhentheusertapstheWriteaReviewcellintheSettingsscreenofthesampleapp.Goingoverthecode: CreateaninstanceofURLComponentswiththeproductpageURLthatyoufoundearlier.URLComponentsisastructthatassistswithparsingandconstructingURLobjectsinasafemanner.It’softengoodpracticetouseURLComponentsinsteadofjustappendingstringstogether. SetthearrayofqueryitemstocontainasingleitemwiththenameandvaluetomatchtherequirementsthatwilltriggertheAppStoretoopentheprompt. CreateaURLobjectbasedonthecomponentsthatyoumodifiedinthelaststep. AskthesharedUIApplicationinstancetoopenthegivenURL. Note:BecausetheiOSSimulatordoesn’tincludetheAppStoreapp,youwillhavetobuildandrunthesampleprojectonaphysicaldevicetotrythisout.Inordertodothis,you’llneedtoselectaDevelopmentTeamandchangetheBundleIdentifierintheprojectsettings. Buildandruntheappontoyourdevice.TaptheSettingsiconinthenavbarandthenWriteaReview.You’llbetakenfromthesampleappandintotheAppStorewhereyou’llseethefollowingscreen: SharingYourApp Whenusersarereallyenjoyingyourapp,theymightwanttosharethegreatexperiencetheyarehavingwiththeirfriendsandfamily.Becausethereisn’tcurrentlyaneasilydiscoverablewaytosharealinkofyourappdirectly,andyoualreadyhavealinktoyourapp’sproductpage,youmightaswellprovideyouruserswithaconvenientwaytosharethelink.Afterall,themoreusersyouhave,themerrieryouwillbe! You’regoingtouseadedicatedAPIforthiscalledUIActivityViewController.Todoso,openSettingsViewController.swiftandaddthefollowingcodetoshare(): //1. letactivityViewController=UIActivityViewController( activityItems:[productURL], applicationActivities:nil) //2. present(activityViewController,animated:true,completion:nil) UIActivityViewControllerworksbyacceptinganarrayof“activityitems”.Itwillthenpresentasysteminterfacewithoptionstolaunchotherappsinstalledonthedevicethathaveregisteredtheirownsupportforanyoftheprovidedactivityitemtypes. Inthecodeabove,youprovidetheURLobjectthatrepresentstheAppStoreproductpageandthenmodallypresenttheactivityviewcontroller.Anyappsoractionsthatcanaccepttextorlinkswillthenbepresentedtoyousothatyoucansharethelinkhoweveryoulike!YoucanevenAirDropittoanotherdevicetoimmediatelyopentheAppStoreifyou’dlike. Note:IfyouwanttolearnmoreaboutthisAPIyoucancheckoutthefollowingtutorial:UIActivityViewControllerTutorial:SharingData. Buildandrunyourprojectontoeitheraphysicaldeviceorsimulator(thesimulatorwillpresentfeweroptions)andyoushouldseesomethinglikethefollowing: Theseareadditionalwaystoimprovetheratingofyourappandgethappyuserstospreadthewordaboutit! WheretoGoFromHere? YoucandownloadthecompletedversionoftheprojectusingtheDownloadMaterialsbuttonatthetoporbottomofthistutorial. Youhavelearnedallaboutrequestingappratingsandreviewsforyourappandhowtodoitattherighttime.Totakethisevenfurther,addSKStoreReviewControllertoyourappsinthenextupdatethatyourelease.Hopefully,youwillseeanuptickinthenumberofreviewsandratingsandmoretraffictoyourappontheAppStore. Tolearnmoreonthistopic,thesearefewothergoodresources: RequestingAppStoreReviews BestPracticesandWhat’sNewwithIn-AppPurchases RayWenderlichscreencastonSKStoreReviewController AppStore:Ratings,Reviews,andResponses Ihopeyou’veenjoyedthistutorial;ifyouhaveanyquestionsfeelfreetoleavetheminthediscussionbelow!:] How-tos iOS&SwiftTutorials DownloadMaterials raywenderlich.comWeekly Theraywenderlich.comnewsletteristheeasiestwaytostayup-to-dateoneverythingyouneedtoknowasamobiledeveloper. Signupnow Website Getaweeklydigestofourtutorialsandcourses,andreceiveafreein-depthemailcourseasabonus! Reviews Allvideos.Allbooks. Onelowprice. Themobiledevelopmentworldmovesquickly—andyoudon’twanttogetleftbehind.LearniOS,Swift,Android,Kotlin,Dart,Flutterandmorewiththelargestandhighest-qualitycatalogofvideocoursesandbooksontheinternet. Learnmore Morelikethis MarkComplete(AllChapters) ClearProgress(AllChapters) MarkComplete ClearProgress Completed New New FullSpeedIndyDevelopmentwithDruFreeman–PodcastS12E12 MultipleDomains CoreConcepts Apr202022·Article(1min) Weturnthemicrophonestowardsourselvesoverthenexttwoepisodes.ThisepisodeDrutalksabouthisexperiencelaunchinghisownIndyAppandthebusinessaroundit. Apr202022·Article(1min) Completed Weturnthemicrophonestowardsourselvesoverthenexttwoepisodes.ThisepisodeDrutalksabouthisexperiencelaunchinghisownIndyAppandthebusinessaroundit. Apr202022·Article(1min) Completed MarkComplete(AllChapters) ClearProgress(AllChapters) MarkComplete ClearProgress Completed New New CoreImageTutorial:GettingStarted iOS&Swift Graphics&Animation Apr192022·Article(20mins) LearnthebasicsofcoolimagefilteringeffectswithCoreImageandSwift. Apr192022·Article(20mins) Completed LearnthebasicsofcoolimagefilteringeffectswithCoreImageandSwift. Apr192022·Article(20mins) Completed MarkComplete(AllChapters) ClearProgress(AllChapters) MarkComplete ClearProgress Completed New New AdvancedDataBindinginAndroid:LayoutExpressions Android&Kotlin GettingStarted Apr182022·Article(10mins) LearnhowtouselayoutexpressionsfordatabindinginAndroidandmakeyourcodemoreconciseandlesserror-prone. Apr182022·Article(10mins) Completed LearnhowtouselayoutexpressionsfordatabindinginAndroidandmakeyourcodemoreconciseandlesserror-prone. Apr182022·Article(10mins) Completed MarkComplete(AllChapters) ClearProgress(AllChapters) MarkComplete ClearProgress Completed New New SpringAheadSale:ProSubscriptionsandBooks50%Off MultipleDomains Announcements Apr132022·Article(10mins) Grabourbestdealsoftheyear:AnnualProSubscriptionsat50%off—andeverysinglebookonoursitefor50%offtoo.Savebigduringthisyear’sSpringAheadsale! Apr132022·Article(10mins) Completed Grabourbestdealsoftheyear:AnnualProSubscriptionsat50%off—andeverysinglebookonoursitefor50%offtoo.Savebigduringthisyear’sSpringAheadsale! Apr132022·Article(10mins) Completed Contributors SanketFirodiya Sanketisadesignandproduct-focusedengineerwholikestosolverealuserproblemswithsimpleproducts.Heisbasedoutof... Author LiamNichols iOSTechLeadworkingforCookpadInternational. TechEditor MandaFrederick Mandahasbeeninvolvedinpublishingforover12yearsthroughvariouscreative,educational,medicalandtechnicalprintand... Editor AdrianaKutenko GraphicIllustratorwithaBachelor’sDegreeinFineArts.IamaperpetualperfectionseekerwithabigpassionforHistory... Illustrator RichardTurton RichardisaniOSdeveloperforMartianCraft,prolificStackOverflowparticipantandauthorofadevelopmentblog,Command... Fpe RichardCritz Richardhasbeendoingsoftwareprofessionallyforover40years,primarilyoperatingsystemsandnetworkinfrastructurewitha... TeamLead Inthistutorial,you’lllearnaboutrequestingappratingsandreviewsinyouriOSapplicationsusingSKStoreReviewControllerandotheravailableAPIs. Comments ShowComments. Allvideos.Allbooks.Onelowprice. Araywenderlich.comsubscriptionisthebestwaytolearnandmastermobiledevelopment—plansstartatjust$19.99/month! LearniOS,Swift,Android,Kotlin,FlutterandDartdevelopmentandunlockourmassivecatalogof50+booksand4,000+videos. Learnmore



請為這篇文章評分?