iOS开发-应用评分引导

导入头文件#import <StoreKit/StoreKit.h>
+ (void)yoStoreReview{ if (@available(iOS 10.3, *)) { if ([SKStoreReviewController respondsToSelector:@selector(requestReview)]){ //防止键盘遮挡 [[UIApplication sharedApplication].keyWindow endEditing:YES]; // iOS10.3+ 直接在App内弹出评分框 // 此方式苹果允许的调用频率为3次/年 [SKStoreReviewController requestReview]; } } else { // <iOS10.3 跳转AppStore的评论页面 NSString *appIDStr = [NSString stringWithFormat:@"%@", [YostarUtilits getUserDefaultsForKey:@"APPLEID"]]; NSString *appStoreReviewStr = [NSString stringWithFormat:@"https://itunes.apple.com/app/id%@?action=write-review", appIDStr]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStoreReviewStr]]; } }

 

posted @ 2023-02-27 16:40  kawerd  阅读(203)  评论(0编辑  收藏  举报