├── ZWAppStoreDemo
├── zh-Hans.lproj
│ └── LaunchScreen.strings
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── ViewController.m
├── Info.plist
├── Base.lproj
│ └── LaunchScreen.storyboard
├── AppDelegate.m
└── Main.storyboard
├── ZWAppStore
├── Resources
│ └── Asset.xcassets
│ │ ├── Contents.json
│ │ └── version.imageset
│ │ ├── version.png
│ │ ├── version@2x.png
│ │ ├── version@3x.png
│ │ └── Contents.json
├── ZWAppStore.h
├── ZWActionReview
│ ├── ZWRequestReview.h
│ ├── ZWActionReview.h
│ ├── ZWRequestReview.m
│ ├── ZWActionReview.m
│ └── ZWRequestReview.xib
└── ZWCheckVersion
│ ├── ZWUpdateAppView.h
│ ├── ZWAppStoreModel.m
│ ├── ZWCheckVersion.h
│ ├── ZWUpdateAppView.m
│ ├── ZWAppStoreModel.h
│ ├── ZWCheckVersion.m
│ └── ZWUpdateAppView.xib
├── ZWAppStoreDemo.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── ZWAppStore.podspec
├── LICENSE
├── README.md
└── .gitignore
/ZWAppStoreDemo/zh-Hans.lproj/LaunchScreen.strings:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ZWAppStore/Resources/Asset.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ZWAppStore/Resources/Asset.xcassets/version.imageset/version.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangziwu/ZWAppStore/HEAD/ZWAppStore/Resources/Asset.xcassets/version.imageset/version.png
--------------------------------------------------------------------------------
/ZWAppStore/Resources/Asset.xcassets/version.imageset/version@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangziwu/ZWAppStore/HEAD/ZWAppStore/Resources/Asset.xcassets/version.imageset/version@2x.png
--------------------------------------------------------------------------------
/ZWAppStore/Resources/Asset.xcassets/version.imageset/version@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangziwu/ZWAppStore/HEAD/ZWAppStore/Resources/Asset.xcassets/version.imageset/version@3x.png
--------------------------------------------------------------------------------
/ZWAppStoreDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2017/12/28.
6 | // Copyright © 2017年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWAppStore.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWAppStore.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/8.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #ifndef ZWAppStore_h
10 | #define ZWAppStore_h
11 | #import "ZWCheckVersion.h"
12 | #import "ZWActionReview.h"
13 | #endif /* ZWAppStore_h */
14 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWActionReview/ZWRequestReview.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWRequestReview.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/8.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZWRequestReview : UIView
12 | + (instancetype)zw_requestReview:(NSString *)requestUrl;
13 | @end
14 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2017/12/28.
6 | // Copyright © 2017年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWUpdateAppView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWUpdateAppView.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ZWAppStoreModel.h"
11 | @interface ZWUpdateAppView : UIView
12 | /**
13 | * 提示升级视图
14 | */
15 | + (instancetype)zw_updateAppView:(ZWAppStoreModel *)appModel;
16 | @end
17 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2017/12/28.
6 | // Copyright © 2017年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWAppStoreModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZWAppStoreModel.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ZWAppStoreModel.h"
10 |
11 | @implementation ZWAppStoreModel
12 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key{
13 | if ([key isEqualToString:@"description"]) {
14 | self.zw_description = value;
15 | }
16 | }
17 | @end
18 |
--------------------------------------------------------------------------------
/ZWAppStore/Resources/Asset.xcassets/version.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "version.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "version@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "version@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/ZWAppStore.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'ZWAppStore'
3 | s.version = '0.1.0'
4 | s.summary = 'iOS 应用APP检测更新、提醒应用评价、前往App Store给予好评功能封装。请求评论视图出现逻辑:限制每日最多出现次数、限制每次出现概率、限制最大出现次数避免用户反感。'
5 | s.homepage = 'https://github.com/wangziwu/ZWAppStore'
6 | s.license = 'MIT'
7 | s.authors = {'wangziwu' => 'wang_ziwu@126.com'}
8 | s.platform = :ios,'8.0'
9 | s.ios.deployment_target = '8.0'
10 | s.source = {:git => 'https://github.com/wangziwu/ZWAppStore.git',:tag => s.version }
11 | s.requires_arc = true
12 |
13 | s.source_files = 'ZWAppStore/ZWAppStore.h'
14 | s.resources = 'ZWAppStore/Resources/Asset.xcassets'
15 |
16 | s.subspec 'ZWCheckVersion' do |ss|
17 | ss.source_files = 'ZWAppStore/ZWCheckVersion/*.{h,m}'
18 | ss.resources = 'ZWAppStore/ZWCheckVersion/*.xib'
19 | end
20 |
21 | s.subspec 'ZWActionReview' do |ss|
22 | ss.source_files = 'ZWAppStore/ZWActionReview/*.{h,m}'
23 | ss.resources = 'ZWAppStore/ZWActionReview/*.xib'
24 | ss.dependency 'ZWAppStore/ZWCheckVersion'
25 |
26 | end
27 | s.frameworks = 'UIKit'
28 | end
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 wang_ziwu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWCheckVersion.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWCheckVersion.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ZWAppStoreModel.h"
11 | #import "ZWUpdateAppView.h"
12 | typedef void(^BlockAppStoreInfo)(ZWAppStoreModel *appModel);
13 | @interface ZWCheckVersion : NSObject
14 | /**
15 | * 自动检测app版本更新
16 | * 自动读取BundleId去App Store获取信息
17 | * appInfo:根据App Store信息自定义处理更新版本视图。
18 | */
19 | + (void)zw_autoCheckVersion;
20 | + (void)zw_autoCheckVersionHandleView:(BlockAppStoreInfo)appInfo;
21 | /**
22 | * 根据应用itunesId版本更新
23 | * appInfo:根据App Store信息自定义处理更新版本视图。
24 | */
25 | + (void)zw_checkVersionItunesId:(NSString *)itunesId;
26 | + (void)zw_checkVersionItunesId:(NSString *)itunesId handleView:(BlockAppStoreInfo)appInfo;
27 | /**
28 | * 判断是否需要更新
29 | */
30 | + (BOOL)zw_shouldUpdateApp:(ZWAppStoreModel *)model;
31 | /**
32 | * 获取前期应用在App Store的信息详情
33 | * 1、自动读取当前APP的App Store信息
34 | * 2、itunesId:自定义传入APP应用的iTunesId
35 | */
36 | + (void)zw_getNewAppStoreInfo:(BlockAppStoreInfo)appInfo;
37 | + (void)zw_getNewAppStoreInfoItunesId:(NSString *)itunesId appInfo:(BlockAppStoreInfo)appInfo;
38 | @end
39 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWActionReview/ZWActionReview.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWActionReview.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/8.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "ZWRequestReview.h"
12 | @interface ZWActionReview : NSObject
13 | /**
14 | * 请求评论视图
15 | * 视图出现逻辑:限制每日最多出现次数、限制每次出现概率、限制最大出现次数避免用户反感。
16 | */
17 | + (instancetype)instanceReview;
18 | /**
19 | * 请求应用评论弹窗
20 | * 自动根据BundleId请求App sStore获取评论地址
21 | * itunesId: 指定iTunesId弹出应用评论弹框
22 | */
23 | - (void)zw_actionRequestReview;
24 | - (void)zw_actionRequestReview:(NSString *)itunesId;
25 | /**
26 | * 前往当前应用的App Store评论界面
27 | * itunesId: 指定iTunesId前往应用评论界面
28 | */
29 | - (void)zw_skipToAppStoreReview;
30 | - (void)zw_skipToAppStoreReview:(NSString *)itunesId;
31 | /**
32 | * 请求评论视图、每次请求出现的概率(0~1)
33 | * 默认:0.5
34 | * 配置通过配置概率改变打开应用就弹出的几率、避免用户反感。
35 | */
36 | @property (nonatomic, assign) CGFloat probabilityDaliy;
37 | /**
38 | * 请求评论视图、每日最多出现的次数
39 | * 默认:每天最多出现5次
40 | */
41 | @property (nonatomic, assign) NSInteger maxNumDaliy;
42 | /**
43 | * 请求评论视图、一共允许出现的次数
44 | * 默认:一共允许出现最多20次、避免引起用户反感
45 | */
46 | @property (nonatomic, assign) NSInteger maxTotalNum;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2017/12/28.
6 | // Copyright © 2017年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "ZWAppStore.h"
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | NSLog(@"%@", NSHomeDirectory());
21 | }
22 | - (IBAction)actionCheckVersion:(id)sender {
23 | //eg:微信
24 | [ZWCheckVersion zw_checkVersionItunesId:@"414478124"];
25 | // //推荐方法、自动检测当前应用APP
26 | // [ZWCheckVersion zw_autoCheckVersion];
27 | // [ZWCheckVersion zw_autoCheckVersionHandleView:^(ZWAppStoreModel *appModel) {
28 | // //需要更新版本、自定义更新视图
29 | // }];
30 | }
31 | - (IBAction)actionShowReview:(id)sender {
32 | //测试设置概率为1可以百分比出现
33 | [ZWActionReview instanceReview].probabilityDaliy = 1.f;
34 | [[ZWActionReview instanceReview] zw_actionRequestReview:@"414478124"];
35 | //推荐方法、自动检测当前应用APP
36 | // [[ZWActionReview instanceReview] zw_actionRequestReview];
37 | }
38 | - (IBAction)actionSkipWriteReview:(id)sender {
39 | [[ZWActionReview instanceReview] zw_skipToAppStoreReview:@"414478124"];
40 | //推荐方法、自动检测当前应用APP
41 | // [[ZWActionReview instanceReview] zw_skipToAppStoreReview];
42 | }
43 |
44 | - (void)didReceiveMemoryWarning {
45 | [super didReceiveMemoryWarning];
46 | // Dispose of any resources that can be recreated.
47 | }
48 |
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ZWAppStore
2 | [](http://cocoadocs.org/docsets/ZWAppStore)
3 | [](http://cocoadocs.org/docsets/ZWAppStore)
4 | [](http://cocoadocs.org/docsets/ZWAppStore)
5 | 
6 |
7 | ### 简介
8 | iOS 应用APP检测更新、提醒应用评价、前往App Store给予好评功能封装。
9 |
10 | ### 详细介绍参考我的[简书](https://www.jianshu.com/p/6cacfb4d9191)
11 | [iOS版本自动检测更新、应用评论功能封装](https://www.jianshu.com/p/6cacfb4d9191)
12 |
13 | ### 框架整体介绍
14 | * 检测APP应用最新版本、获取应用更新内容、提示用户版本更新。
15 | * 请求评论视图,限制每日最多出现次数、限制每次出现概率、限制最大出现次数避免用户反感。
16 | * 前往App Store评价应用,给以星级评论。
17 | * 系统级APP中应用星级评价。
18 |
19 | ### 效果展示
20 |
21 | 
22 |
23 | ### 框架使用方法
24 | - 直接把ZWAppStore文件夹拖入到您的工程中.
25 |
26 | ```objc
27 | #import "ZWAppStore.h"
28 | ```
29 |
30 | - Cocoapods安装
31 |
32 | ```objc
33 | pod search ZWAppStore
34 | pod 'ZWAppStore', '~> 0.0.5'
35 | ```
36 |
37 | ```objc
38 | #import
39 | ```
40 |
41 | 如果发现pod search ZWAppStore不是最新版本,请执行pod repo update --verbose命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了.
42 |
43 | #####【V0.0.5】版本更新记录
44 |
45 | - 【修改】: 修改版本对比逻辑、适应版本号位数不一致导致检测更新失败问题。
46 |
47 | #####【V0.0.2】版本更新记录
48 |
49 | - 【修改】: 应用检测更新视图图片偏移bug。
50 |
51 | #####【V0.0.1】版本更新记录
52 |
53 | - 【新增】: 封装APP应用与App Store交互相关逻辑。
--------------------------------------------------------------------------------
/ZWAppStoreDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 6.7.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
52 |
53 | fastlane/report.xml
54 | fastlane/Preview.html
55 | fastlane/screenshots
56 | fastlane/test_output
57 |
58 | # Code Injection
59 | #
60 | # After new code Injection tools there's a generated folder /iOSInjectionProject
61 | # https://github.com/johnno1962/injectionforxcode
62 |
63 | iOSInjectionProject/
64 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/ZWAppStoreDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2017/12/28.
6 | // Copyright © 2017年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWActionReview/ZWRequestReview.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZWRequestReview.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/8.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ZWRequestReview.h"
10 | @interface ZWRequestReview ()
11 | @property (nonatomic, copy) NSString *requestUrl;
12 | @end
13 | @implementation ZWRequestReview
14 | - (instancetype)init {
15 | self = [super init];
16 | if (self) {
17 | self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
18 | owner:nil
19 | options:nil] firstObject];
20 | }
21 | return self;
22 | }
23 | /**
24 | * 提示升级视图
25 | */
26 | + (instancetype)zw_requestReview:(NSString *)requestUrl {
27 | ZWRequestReview *view = [[ZWRequestReview alloc] init];
28 | view.frame = [UIScreen mainScreen].bounds;
29 | view.requestUrl =requestUrl;
30 | [[UIApplication sharedApplication].delegate.window addSubview:view];
31 | return view;
32 | }
33 | #pragma mark - config
34 | #pragma mark - lifeCycle
35 | #pragma mark - delegate
36 | #pragma mark - actionFunction
37 | - (IBAction)actionReview:(id)sender {
38 | NSURL *url = [NSURL URLWithString:self.requestUrl];
39 | if (![[UIApplication sharedApplication] canOpenURL:url]) {
40 | return;
41 | }
42 | if (@available(iOS 10.0, *)) {
43 | [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
44 | } else {
45 | // Fallback on earlier versions
46 | [[UIApplication sharedApplication] openURL:url];
47 | }
48 | [self hiddenAnimation];
49 | }
50 | - (IBAction)actionCancle:(id)sender {
51 | [self hiddenAnimation];
52 | }
53 | #pragma mark - function
54 | - (void)hiddenAnimation {
55 | [UIView animateWithDuration:0.5 animations:^{
56 | self.alpha = 0;
57 | } completion:^(BOOL finished) {
58 | [self removeFromSuperview];
59 | }];
60 | }
61 | #pragma mark - layzing
62 | /*
63 | // Only override drawRect: if you perform custom drawing.
64 | // An empty implementation adversely affects performance during animation.
65 | - (void)drawRect:(CGRect)rect {
66 | // Drawing code
67 | }
68 | */
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWUpdateAppView.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZWUpdateAppView.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ZWUpdateAppView.h"
10 |
11 | @interface ZWUpdateAppView ()
12 | @property (weak, nonatomic) IBOutlet UILabel *notesLab;
13 | @property (weak, nonatomic) IBOutlet UIScrollView *mScroll;
14 | @property (nonatomic, strong) ZWAppStoreModel *appModel;
15 | @end
16 | @implementation ZWUpdateAppView
17 | - (instancetype)init {
18 | self = [super init];
19 | if (self) {
20 | self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
21 | owner:nil
22 | options:nil] firstObject];
23 | }
24 | return self;
25 | }
26 | - (void)layoutSubviews {
27 | [super layoutSubviews];
28 | [self contentSizeToFit];
29 | }
30 | #pragma mark - exportAPI
31 |
32 | + (instancetype)zw_updateAppView:(ZWAppStoreModel *)appModel; {
33 | ZWUpdateAppView *view = [[ZWUpdateAppView alloc] init];
34 | view.frame = [UIScreen mainScreen].bounds;
35 | [[UIApplication sharedApplication].delegate.window addSubview:view];
36 | view.appModel = appModel;
37 | return view;
38 | }
39 | #pragma mark - config
40 | #pragma mark - lifeCycle
41 | #pragma mark - delegate
42 | #pragma mark - actionFunction
43 | - (IBAction)actionCancle:(id)sender {
44 | [self hiddenAnimation];
45 | }
46 | - (IBAction)actionUpdate:(id)sender {
47 | NSURL *url = [NSURL URLWithString:self.appModel.trackViewUrl];
48 | if (![[UIApplication sharedApplication] canOpenURL:url]) {
49 | [self hiddenAnimation];
50 | return;
51 | }
52 | if (@available(iOS 10.0, *)) {
53 | [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
54 | } else {
55 | // Fallback on earlier versions
56 | [[UIApplication sharedApplication] openURL:url];
57 | }
58 | [self hiddenAnimation];
59 | }
60 | #pragma mark - function
61 | - (void)hiddenAnimation {
62 | [UIView animateWithDuration:0.5 animations:^{
63 | self.alpha = 0;
64 | } completion:^(BOOL finished) {
65 | [self removeFromSuperview];
66 | }];
67 | }
68 | - (void)contentSizeToFit{
69 | BOOL wasShowingVerticalScrollIndicator = self.mScroll.showsVerticalScrollIndicator;
70 | BOOL wasShowingHorizontalScrollIndicator = self.mScroll.showsHorizontalScrollIndicator;
71 |
72 | self.mScroll.showsVerticalScrollIndicator = NO;
73 | self.mScroll.showsHorizontalScrollIndicator = NO;
74 |
75 | CGRect rect = CGRectZero;
76 | for ( UIView *view in self.mScroll.subviews ) {
77 | rect = CGRectUnion(rect, view.frame);
78 | }
79 | rect.size.height += 10;
80 |
81 | self.mScroll.showsVerticalScrollIndicator = wasShowingVerticalScrollIndicator;
82 | self.mScroll.showsHorizontalScrollIndicator = wasShowingHorizontalScrollIndicator;
83 | self.mScroll.contentSize = rect.size;
84 | }
85 | #pragma mark - layzing
86 | - (void)setAppModel:(ZWAppStoreModel *)appModel {
87 | _appModel = appModel;
88 | self.notesLab.text = appModel.releaseNotes;
89 | [self.notesLab sizeToFit];
90 | [self.mScroll layoutIfNeeded];
91 | }
92 | /*
93 | // Only override drawRect: if you perform custom drawing.
94 | // An empty implementation adversely affects performance during animation.
95 | - (void)drawRect:(CGRect)rect {
96 | // Drawing code
97 | }
98 | */
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWAppStoreModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZWAppStoreModel.h
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZWAppStoreModel : NSObject
12 | /*--------------------------------------常用基本信息----------------------------------------*/
13 | /**
14 | * App iTunes Preview
15 | * 用于跳转去更新
16 | */
17 | @property (nonatomic, copy) NSString *trackViewUrl;
18 | /**
19 | * 当前App Store最新版本
20 | */
21 | @property (nonatomic, copy) NSString *version;
22 | /**
23 | * APP应用在iTunes中唯一ID
24 | */
25 | @property (nonatomic, assign) NSInteger trackId;
26 | /**
27 | * APP应用名称
28 | */
29 | @property (nonatomic, copy) NSString *trackName;
30 | /**
31 | * APP应用bundleId
32 | */
33 | @property (nonatomic, copy) NSString *bundleId;
34 | /**
35 | * 最新版本更新记录
36 | */
37 | @property (nonatomic, copy) NSString *releaseNotes;
38 | /**
39 | * 最新版本更新日期
40 | */
41 | @property (nonatomic, copy) NSString *releaseDate;
42 | /**
43 | * 应用描述
44 | */
45 | @property (nonatomic, copy) NSString *zw_description;
46 | /*--------------------------------------其他信息----------------------------------------*/
47 | /**
48 | * ipad屏幕截屏
49 | */
50 | @property (nonatomic, copy) NSArray *ipadScreenshotUrls;
51 | /**
52 | * appletv屏幕截屏
53 | */
54 | @property (nonatomic, copy) NSArray *appletvScreenshotUrls;
55 | /**
56 | * 512尺寸图
57 | */
58 | @property (nonatomic, copy) NSString *artworkUrl512;
59 | /**
60 | * 100尺寸图
61 | */
62 | @property (nonatomic, copy) NSString *artworkUrl100;
63 | /**
64 | * 60尺寸图
65 | */
66 | @property (nonatomic, copy) NSString *artworkUrl60;
67 | /**
68 | * App开发者(公司)拥有App iTunes Preview
69 | */
70 | @property (nonatomic, copy) NSString *artistViewUrl;
71 | /**
72 | * 应用类别
73 | */
74 | @property (nonatomic, copy) NSString *kind;
75 | /**
76 | * 应用特色
77 | */
78 | @property (nonatomic, copy) NSArray *features;
79 | /**
80 | * 应用支持手机型号
81 | * eg:[@"iPhone8Plus-iPhone8Plus",@"iPhoneX-iPhoneX"];
82 | */
83 | @property (nonatomic, copy) NSArray *supportedDevices;
84 | /**
85 | * iPhone应用截屏
86 | */
87 | @property (nonatomic, copy) NSArray *screenshotUrls;
88 | /**
89 | * advisories
90 | */
91 | @property (nonatomic, copy) NSArray *advisories;
92 | /**
93 | * 是否属于游戏
94 | */
95 | @property (nonatomic, assign) BOOL isGameCenterEnabled;
96 | /**
97 | * averageUserRatingForCurrentVersion
98 | */
99 | @property (nonatomic, copy) NSString *averageUserRatingForCurrentVersion;
100 | /**
101 | * 出版商
102 | */
103 | @property (nonatomic, copy) NSString *trackCensoredName;
104 | /**
105 | * 语言编码支持
106 | * eg:[@"ZH"]
107 | */
108 | @property (nonatomic, copy) NSArray *languageCodesISO2A;
109 | /**
110 | * APP应用大小
111 | */
112 | @property (nonatomic, copy) NSString *fileSizeBytes;
113 | /**
114 | * APP所属公司URL
115 | */
116 | @property (nonatomic, copy) NSString *sellerUrl;
117 | /**
118 | * APP内容限制级别
119 | * eg:"4+"
120 | */
121 | @property (nonatomic, copy) NSString *contentAdvisoryRating;
122 | /**
123 | * userRatingCountForCurrentVersion
124 | */
125 | @property (nonatomic, copy) NSString *userRatingCountForCurrentVersion;
126 | /**
127 | * APP应用限制级别
128 | * eg:"4+"
129 | */
130 | @property (nonatomic, copy) NSString *trackContentRating;
131 | /**
132 | * APP收费类型
133 | * eg:"免费"/"收费"
134 | */
135 | @property (nonatomic, copy) NSString *formattedPrice;
136 | /**
137 | * 开发商英文名称
138 | */
139 | @property (nonatomic, copy) NSString *sellerName;
140 | /**
141 | * APP类型、体裁id
142 | */
143 | @property (nonatomic, copy) NSArray *genreIds;
144 | /**
145 | * 当前版本发布日期
146 | */
147 | @property (nonatomic, copy) NSString *currentVersionReleaseDate;
148 | /**
149 | * 货币类型
150 | * eg:@"CNY":人民币
151 | */
152 | @property (nonatomic, copy) NSString *currency;
153 | /**
154 | * 应用类型英文名
155 | * eg:@"software"
156 | */
157 | @property (nonatomic, copy) NSString *wrapperType;
158 | /**
159 | * 开发商iTunes id
160 | * 每个开发商(开发者账号)拥有一个artistId
161 | * 每个开发商(开发者账号)拥有多个APP应用
162 | * 每个APP应用拥有一个trackId
163 | */
164 | @property (nonatomic, assign) NSInteger artistId;
165 | /**
166 | * 开发商中文名称
167 | */
168 | @property (nonatomic, copy) NSString *artistName;
169 | /**
170 | * APP类型、体裁中文名称数组
171 | */
172 | @property (nonatomic, copy) NSArray *genres;
173 | /**
174 | * APP价格
175 | */
176 | @property (nonatomic, assign) NSInteger price;
177 | /**
178 | * isVppDeviceBasedLicensingEnabled
179 | */
180 | @property (nonatomic, assign) BOOL isVppDeviceBasedLicensingEnabled;
181 | /**
182 | * APP主演的类型、体裁英文名称
183 | */
184 | @property (nonatomic, copy) NSString *primaryGenreName;
185 | /**
186 | * APP最低支持版本
187 | */
188 | @property (nonatomic, copy) NSString *minimumOsVersion;
189 | /**
190 | * APP主演的类型、体裁ID
191 | */
192 | @property (nonatomic, copy) NSString *primaryGenreId;
193 | @end
194 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWActionReview/ZWActionReview.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZWActionReview.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/8.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ZWActionReview.h"
10 | #import "ZWCheckVersion.h"
11 | //区域编码
12 | #define APP_DaliyMaxNum @"ZWActionReview_MaxNumDaliy"
13 | #define APP_TotalNum @"ZWActionReview_TotalNum"
14 | #define APP_WriteReview @"action=write-review"
15 | static id _instances;
16 | @implementation ZWActionReview
17 | + (instancetype)instanceReview {
18 | static dispatch_once_t onceToken;
19 | dispatch_once(&onceToken, ^{
20 | _instances = [[ZWActionReview alloc] init];
21 | });
22 | return _instances;
23 | }
24 | - (instancetype)init {
25 | self = [super init];
26 | if (self) {
27 | self.probabilityDaliy = 0.5f;
28 | self.maxNumDaliy = 5;
29 | self.maxTotalNum = 20;
30 | }
31 | return self;
32 | }
33 | /**
34 | * 请求应用评论弹窗
35 | * 自动根据BundleId请求App Store获取评论地址
36 | */
37 | - (void)zw_actionRequestReview {
38 | if (![self zw_judgeAllowShowReview]) {
39 | return;
40 | }
41 | [ZWCheckVersion zw_getNewAppStoreInfo:^(ZWAppStoreModel *appModel) {
42 | NSString *requestUrl = [NSString stringWithFormat:@"%@&%@",appModel.trackViewUrl,APP_WriteReview];
43 | dispatch_async(dispatch_get_main_queue(), ^{
44 | [ZWRequestReview zw_requestReview:requestUrl];
45 | });
46 | }];
47 | }
48 | /**
49 | * 请求应用评论弹窗
50 | * 自定义iTunesId跳转
51 | */
52 | - (void)zw_actionRequestReview:(NSString *)itunesId {
53 | if (![self zw_judgeAllowShowReview]) {
54 | return;
55 | }
56 | [ZWCheckVersion zw_getNewAppStoreInfoItunesId:itunesId appInfo:^(ZWAppStoreModel *appModel) {
57 | NSString *requestUrl = [NSString stringWithFormat:@"%@&%@",appModel.trackViewUrl,APP_WriteReview];
58 | dispatch_async(dispatch_get_main_queue(), ^{
59 | [ZWRequestReview zw_requestReview:requestUrl];
60 | });
61 | }];
62 | }
63 | /**
64 | * 前往当前应用的App Store评论界面
65 | */
66 | - (void)zw_skipToAppStoreReview {
67 | __weak typeof(self) weakSelf = self;
68 | [ZWCheckVersion zw_getNewAppStoreInfo:^(ZWAppStoreModel *appModel) {
69 | dispatch_async(dispatch_get_main_queue(), ^{
70 | [weakSelf zw_openURL:appModel.trackViewUrl];
71 | });
72 | }];
73 | }
74 | /**
75 | * 前往指定itunesId应用的App Store评论界面
76 | */
77 | - (void)zw_skipToAppStoreReview:(NSString *)itunesId {
78 | __weak typeof(self) weakSelf = self;
79 | [ZWCheckVersion zw_getNewAppStoreInfoItunesId:itunesId appInfo:^(ZWAppStoreModel *appModel) {
80 | dispatch_async(dispatch_get_main_queue(), ^{
81 | [weakSelf zw_openURL:appModel.trackViewUrl];
82 | });
83 | }];
84 | }
85 | - (BOOL)zw_judgeAllowShowReview {
86 | //1、视图出现概率
87 | CGFloat random = arc4random() % 10 / 10.f;
88 | if (random > self.probabilityDaliy) {
89 | return NO;
90 | }
91 | //2、视图出现总数
92 | NSUserDefaults *userDfaults = [NSUserDefaults standardUserDefaults];
93 | NSInteger totalNum = [[userDfaults objectForKey:APP_TotalNum] integerValue];
94 | if (totalNum >= self.maxTotalNum) {
95 | return NO;
96 | }
97 | //3、每日出现最大次数
98 | NSArray *daliyArray = [userDfaults objectForKey:APP_DaliyMaxNum];
99 | NSInteger daliyNum = [[daliyArray lastObject] integerValue];
100 | NSDate *daliyDate = [daliyArray firstObject];
101 | if (!daliyDate) {
102 | daliyDate = [NSDate date];
103 | }
104 | NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
105 | [dateformatter setDateFormat:@"YYYY-MM-dd"];
106 | NSString *udDateStr=[dateformatter stringFromDate:daliyDate];
107 | NSString *currDateStr = [dateformatter stringFromDate:[NSDate date]];
108 |
109 | if (![udDateStr isEqualToString:currDateStr]) {
110 | totalNum++;
111 | NSString *newTotalNum = [NSString stringWithFormat:@"%ld",(long)totalNum];
112 | [userDfaults setObject:@[[NSDate date],@"1"] forKey:APP_DaliyMaxNum];
113 | [userDfaults setObject:newTotalNum forKey:APP_TotalNum];
114 | [userDfaults synchronize];
115 | return YES;
116 | }else if(daliyNum < self.maxNumDaliy){
117 | daliyNum++;
118 | totalNum++;
119 | NSString *newDaliyNum = [NSString stringWithFormat:@"%ld",(long)daliyNum];
120 | NSString *newTotalNum = [NSString stringWithFormat:@"%ld",(long)totalNum];
121 | [userDfaults setObject:@[[NSDate date],newDaliyNum] forKey:APP_DaliyMaxNum];
122 | [userDfaults setObject:newTotalNum forKey:APP_TotalNum];
123 | [userDfaults synchronize];
124 | return YES;
125 | }
126 | return NO;
127 | }
128 | - (void)zw_openURL:(NSString *)appInfoUrl {
129 | NSString *requestUrl = [NSString stringWithFormat:@"%@&%@",appInfoUrl,APP_WriteReview];
130 | NSURL *url = [NSURL URLWithString:requestUrl];
131 | if (![[UIApplication sharedApplication] canOpenURL:url]) {
132 | return;
133 | }
134 | if (@available(iOS 10.0, *)) {
135 | [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
136 | } else {
137 | // Fallback on earlier versions
138 | [[UIApplication sharedApplication] openURL:url];
139 | }
140 | }
141 | @end
142 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
34 |
44 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWCheckVersion.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZWCheckVersion.m
3 | // ZWAppStoreDemo
4 | //
5 | // Created by 王子武 on 2018/1/3.
6 | // Copyright © 2018年 wang_ziwu. All rights reserved.
7 | //
8 |
9 | #import "ZWCheckVersion.h"
10 | #define APP_InfoDict [[NSBundle mainBundle] infoDictionary]
11 | //应用版本
12 | #define APP_Version [APP_InfoDict objectForKey:@"CFBundleShortVersionString"]
13 | //应用BundleId
14 | #define APP_BundleId [APP_InfoDict objectForKey:@"CFBundleIdentifier"]
15 | //区域编码
16 | #define APP_CountryCode [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode]
17 |
18 | #define APPStore_BundleId_URL @"https://itunes.apple.com/lookup?bundleId=%@&country=%@"
19 | #define APPStore_ItunesId_URL @"https://itunes.apple.com/lookup?id=%@&country=%@"
20 |
21 | #define AppStore_ResultCount @"resultCount"
22 | #define AppStore_Results @"results"
23 | @interface ZWCheckVersion ()
24 | @property (nonatomic, strong) ZWAppStoreModel *appModel;
25 | @end
26 | @implementation ZWCheckVersion
27 | /**
28 | * 自动检测app版本更新
29 | * 自动读取BundleId去App Store获取信息
30 | */
31 | + (void)zw_autoCheckVersion {
32 | [self zw_autoCheckVersionHandleView:nil];
33 | }
34 | + (void)zw_autoCheckVersionHandleView:(BlockAppStoreInfo)appInfo {
35 | __weak typeof(self) weakSelf = self;
36 | [self zw_getNewAppStoreInfo:^(ZWAppStoreModel *appModel) {
37 | if ([weakSelf zw_shouldUpdateApp:appModel]) {
38 | dispatch_async(dispatch_get_main_queue(), ^{
39 | if (appInfo){
40 | appInfo(appModel);
41 | }else{
42 | [ZWUpdateAppView zw_updateAppView:appModel];
43 | }
44 | });
45 | }
46 | }];
47 | }
48 | /**
49 | * 根据应用itunesId版本更新
50 | */
51 | + (void)zw_checkVersionItunesId:(NSString *)itunesId {
52 | [self zw_checkVersionItunesId:itunesId handleView:nil];
53 | }
54 | + (void)zw_checkVersionItunesId:(NSString *)itunesId handleView:(BlockAppStoreInfo)appInfo {
55 | __weak typeof(self) weakSelf = self;
56 | [self zw_getNewAppStoreInfoItunesId:itunesId appInfo:^(ZWAppStoreModel *appModel) {
57 | if ([weakSelf zw_shouldUpdateApp:appModel]) {
58 | dispatch_async(dispatch_get_main_queue(), ^{
59 | if (appInfo){
60 | appInfo(appModel);
61 | }else{
62 | [ZWUpdateAppView zw_updateAppView:appModel];
63 | }
64 | });
65 | }
66 | }];
67 | }
68 | /**
69 | * 获取App Store应用信息
70 | */
71 | + (void)zw_getAppInfoByUrl:(NSString *)url appStore:(BlockAppStoreInfo)appInfo {
72 | NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
73 | NSURLSession *urlSession = [NSURLSession sharedSession];
74 | NSURLSessionDataTask *dataTask = [urlSession dataTaskWithRequest:urlRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
75 | if (error) {
76 | NSLog(@"error = %@",error);
77 | return;
78 | }
79 | NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data
80 | options:NSJSONReadingMutableContainers
81 | error:nil];
82 | if ([dict[AppStore_ResultCount] integerValue] == 0) {
83 | NSLog(@"please check you App!");
84 | return;
85 | }
86 | ZWAppStoreModel *model = [[ZWAppStoreModel alloc] init];
87 | NSDictionary *results = [dict[AppStore_Results] firstObject];
88 | [model setValuesForKeysWithDictionary:results];
89 | appInfo(model);
90 | }];
91 | [dataTask resume];
92 | }
93 |
94 | /**
95 | * 获取前期应用在App Store的信息详情
96 | * 1、自动读取当前APP的App Store信息
97 | * 2、itunesId:自定义传入APP应用的iTunesId
98 | */
99 | + (void)zw_getNewAppStoreInfo:(BlockAppStoreInfo)appInfo {
100 | NSString *url = [self zw_autoTransformURLByItunesId:nil];
101 | [self zw_getAppInfoByUrl:url appStore:^(ZWAppStoreModel *appModel) {
102 | appInfo(appModel);
103 | }];
104 | }
105 | + (void)zw_getNewAppStoreInfoItunesId:(NSString *)itunesId appInfo:(BlockAppStoreInfo)appInfo {
106 | NSString *url = [self zw_autoTransformURLByItunesId:itunesId];
107 | [self zw_getAppInfoByUrl:url appStore:^(ZWAppStoreModel *appModel) {
108 | appInfo(appModel);
109 | }];
110 | }
111 | /**
112 | * 自动装换出正确请求App Store的URL
113 | */
114 | + (NSString *)zw_autoTransformURLByItunesId:(NSString *)itunesId {
115 | NSString *urlStr = @"";
116 | if (itunesId) {
117 | urlStr = [NSString stringWithFormat:APPStore_ItunesId_URL,itunesId,APP_CountryCode];
118 | }else {
119 | urlStr = [NSString stringWithFormat:APPStore_BundleId_URL,APP_BundleId,APP_CountryCode];
120 | }
121 | return urlStr;
122 | }
123 | /**
124 | * 判断是否需要更新
125 | */
126 | + (BOOL)zw_shouldUpdateApp:(ZWAppStoreModel *)model {
127 | NSMutableArray *currentVersions = [NSMutableArray array];
128 | NSMutableArray *appStoreVersions = [NSMutableArray array];
129 | [currentVersions addObjectsFromArray:[APP_Version componentsSeparatedByString:@"."]];
130 | [appStoreVersions addObjectsFromArray:[model.version componentsSeparatedByString:@"."]];
131 | NSInteger difference = currentVersions.count - appStoreVersions.count;
132 | if (difference < 0) {
133 | for (NSInteger i = 0; i < labs(difference); i++) {
134 | [currentVersions addObject:@"0"];
135 | }
136 | }else if (difference > 0){
137 | for (NSInteger i = 0; i < labs(difference); i++) {
138 | [appStoreVersions addObject:@"0"];
139 | }
140 | }
141 | for (NSInteger i = 0; i < appStoreVersions.count; i++) {
142 | NSInteger currNum = [currentVersions[i] integerValue];
143 | NSInteger appStoreNum = [appStoreVersions[i] integerValue];
144 | if (appStoreNum > currNum) {
145 | return YES;
146 | }else if (appStoreNum < currNum) {
147 | return NO;
148 | }
149 | }
150 | return NO;
151 | }
152 | @end
153 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWActionReview/ZWRequestReview.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
51 |
60 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/ZWAppStore/ZWCheckVersion/ZWUpdateAppView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
70 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/ZWAppStoreDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8535B78B1FFF1D2900A87520 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8535B78A1FFF1D2900A87520 /* Main.storyboard */; };
11 | 853B6688200358BE00E44CC2 /* ZWCheckVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 853B6681200358BE00E44CC2 /* ZWCheckVersion.m */; };
12 | 853B6689200358BE00E44CC2 /* ZWUpdateAppView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 853B6684200358BE00E44CC2 /* ZWUpdateAppView.xib */; };
13 | 853B668A200358BE00E44CC2 /* ZWAppStoreModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 853B6685200358BE00E44CC2 /* ZWAppStoreModel.m */; };
14 | 853B668B200358BE00E44CC2 /* ZWUpdateAppView.m in Sources */ = {isa = PBXBuildFile; fileRef = 853B6686200358BE00E44CC2 /* ZWUpdateAppView.m */; };
15 | 853B66A02003A92300E44CC2 /* ZWRequestReview.m in Sources */ = {isa = PBXBuildFile; fileRef = 853B669B2003A92300E44CC2 /* ZWRequestReview.m */; };
16 | 853B66A12003A92300E44CC2 /* ZWRequestReview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 853B669C2003A92300E44CC2 /* ZWRequestReview.xib */; };
17 | 853B66A22003A92300E44CC2 /* ZWActionReview.m in Sources */ = {isa = PBXBuildFile; fileRef = 853B669D2003A92300E44CC2 /* ZWActionReview.m */; };
18 | 854F24BA1FF5331B004FC1D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 854F24B91FF5331B004FC1D1 /* AppDelegate.m */; };
19 | 854F24BD1FF5331B004FC1D1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 854F24BC1FF5331B004FC1D1 /* ViewController.m */; };
20 | 854F24C21FF5331B004FC1D1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 854F24C11FF5331B004FC1D1 /* Assets.xcassets */; };
21 | 854F24C51FF5331B004FC1D1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 854F24C31FF5331B004FC1D1 /* LaunchScreen.storyboard */; };
22 | 854F24C81FF5331B004FC1D1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 854F24C71FF5331B004FC1D1 /* main.m */; };
23 | 85D683F92004EF0B00B50931 /* Asset.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85D683F82004EF0B00B50931 /* Asset.xcassets */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXFileReference section */
27 | 8535B78A1FFF1D2900A87520 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; };
28 | 853B667D20030E6D00E44CC2 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; };
29 | 853B667F2003587000E44CC2 /* ZWAppStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZWAppStore.h; sourceTree = ""; };
30 | 853B6681200358BE00E44CC2 /* ZWCheckVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWCheckVersion.m; sourceTree = ""; };
31 | 853B6682200358BE00E44CC2 /* ZWUpdateAppView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWUpdateAppView.h; sourceTree = ""; };
32 | 853B6683200358BE00E44CC2 /* ZWAppStoreModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWAppStoreModel.h; sourceTree = ""; };
33 | 853B6684200358BE00E44CC2 /* ZWUpdateAppView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ZWUpdateAppView.xib; sourceTree = ""; };
34 | 853B6685200358BE00E44CC2 /* ZWAppStoreModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWAppStoreModel.m; sourceTree = ""; };
35 | 853B6686200358BE00E44CC2 /* ZWUpdateAppView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWUpdateAppView.m; sourceTree = ""; };
36 | 853B6687200358BE00E44CC2 /* ZWCheckVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWCheckVersion.h; sourceTree = ""; };
37 | 853B669B2003A92300E44CC2 /* ZWRequestReview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWRequestReview.m; sourceTree = ""; };
38 | 853B669C2003A92300E44CC2 /* ZWRequestReview.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ZWRequestReview.xib; sourceTree = ""; };
39 | 853B669D2003A92300E44CC2 /* ZWActionReview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZWActionReview.m; sourceTree = ""; };
40 | 853B669E2003A92300E44CC2 /* ZWRequestReview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWRequestReview.h; sourceTree = ""; };
41 | 853B669F2003A92300E44CC2 /* ZWActionReview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZWActionReview.h; sourceTree = ""; };
42 | 854F24B51FF5331B004FC1D1 /* ZWAppStoreDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZWAppStoreDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 854F24B81FF5331B004FC1D1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
44 | 854F24B91FF5331B004FC1D1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
45 | 854F24BB1FF5331B004FC1D1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
46 | 854F24BC1FF5331B004FC1D1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
47 | 854F24C11FF5331B004FC1D1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
48 | 854F24C41FF5331B004FC1D1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
49 | 854F24C61FF5331B004FC1D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
50 | 854F24C71FF5331B004FC1D1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
51 | 85D683F82004EF0B00B50931 /* Asset.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Asset.xcassets; sourceTree = ""; };
52 | /* End PBXFileReference section */
53 |
54 | /* Begin PBXFrameworksBuildPhase section */
55 | 854F24B21FF5331B004FC1D1 /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | /* End PBXFrameworksBuildPhase section */
63 |
64 | /* Begin PBXGroup section */
65 | 853B6680200358BE00E44CC2 /* ZWCheckVersion */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 853B6687200358BE00E44CC2 /* ZWCheckVersion.h */,
69 | 853B6681200358BE00E44CC2 /* ZWCheckVersion.m */,
70 | 853B6682200358BE00E44CC2 /* ZWUpdateAppView.h */,
71 | 853B6686200358BE00E44CC2 /* ZWUpdateAppView.m */,
72 | 853B6684200358BE00E44CC2 /* ZWUpdateAppView.xib */,
73 | 853B6683200358BE00E44CC2 /* ZWAppStoreModel.h */,
74 | 853B6685200358BE00E44CC2 /* ZWAppStoreModel.m */,
75 | );
76 | path = ZWCheckVersion;
77 | sourceTree = "";
78 | };
79 | 853B669A2003A92300E44CC2 /* ZWActionReview */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 853B669F2003A92300E44CC2 /* ZWActionReview.h */,
83 | 853B669D2003A92300E44CC2 /* ZWActionReview.m */,
84 | 853B669E2003A92300E44CC2 /* ZWRequestReview.h */,
85 | 853B669B2003A92300E44CC2 /* ZWRequestReview.m */,
86 | 853B669C2003A92300E44CC2 /* ZWRequestReview.xib */,
87 | );
88 | path = ZWActionReview;
89 | sourceTree = "";
90 | };
91 | 854F24AC1FF5331B004FC1D1 = {
92 | isa = PBXGroup;
93 | children = (
94 | 854F24CE1FF53378004FC1D1 /* ZWAppStore */,
95 | 854F24B71FF5331B004FC1D1 /* ZWAppStoreDemo */,
96 | 854F24B61FF5331B004FC1D1 /* Products */,
97 | );
98 | sourceTree = "";
99 | };
100 | 854F24B61FF5331B004FC1D1 /* Products */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 854F24B51FF5331B004FC1D1 /* ZWAppStoreDemo.app */,
104 | );
105 | name = Products;
106 | sourceTree = "";
107 | };
108 | 854F24B71FF5331B004FC1D1 /* ZWAppStoreDemo */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 854F24B81FF5331B004FC1D1 /* AppDelegate.h */,
112 | 854F24B91FF5331B004FC1D1 /* AppDelegate.m */,
113 | 854F24BB1FF5331B004FC1D1 /* ViewController.h */,
114 | 854F24BC1FF5331B004FC1D1 /* ViewController.m */,
115 | 8535B78A1FFF1D2900A87520 /* Main.storyboard */,
116 | 854F24C11FF5331B004FC1D1 /* Assets.xcassets */,
117 | 854F24C31FF5331B004FC1D1 /* LaunchScreen.storyboard */,
118 | 854F24C61FF5331B004FC1D1 /* Info.plist */,
119 | 854F24C71FF5331B004FC1D1 /* main.m */,
120 | );
121 | path = ZWAppStoreDemo;
122 | sourceTree = "";
123 | };
124 | 854F24CE1FF53378004FC1D1 /* ZWAppStore */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 853B667F2003587000E44CC2 /* ZWAppStore.h */,
128 | 853B6680200358BE00E44CC2 /* ZWCheckVersion */,
129 | 853B669A2003A92300E44CC2 /* ZWActionReview */,
130 | 85D683F72004EECD00B50931 /* Resources */,
131 | );
132 | path = ZWAppStore;
133 | sourceTree = "";
134 | };
135 | 85D683F72004EECD00B50931 /* Resources */ = {
136 | isa = PBXGroup;
137 | children = (
138 | 85D683F82004EF0B00B50931 /* Asset.xcassets */,
139 | );
140 | path = Resources;
141 | sourceTree = "";
142 | };
143 | /* End PBXGroup section */
144 |
145 | /* Begin PBXNativeTarget section */
146 | 854F24B41FF5331B004FC1D1 /* ZWAppStoreDemo */ = {
147 | isa = PBXNativeTarget;
148 | buildConfigurationList = 854F24CB1FF5331B004FC1D1 /* Build configuration list for PBXNativeTarget "ZWAppStoreDemo" */;
149 | buildPhases = (
150 | 854F24B11FF5331B004FC1D1 /* Sources */,
151 | 854F24B21FF5331B004FC1D1 /* Frameworks */,
152 | 854F24B31FF5331B004FC1D1 /* Resources */,
153 | );
154 | buildRules = (
155 | );
156 | dependencies = (
157 | );
158 | name = ZWAppStoreDemo;
159 | productName = ZWAppStoreDemo;
160 | productReference = 854F24B51FF5331B004FC1D1 /* ZWAppStoreDemo.app */;
161 | productType = "com.apple.product-type.application";
162 | };
163 | /* End PBXNativeTarget section */
164 |
165 | /* Begin PBXProject section */
166 | 854F24AD1FF5331B004FC1D1 /* Project object */ = {
167 | isa = PBXProject;
168 | attributes = {
169 | LastUpgradeCheck = 0940;
170 | ORGANIZATIONNAME = wang_ziwu;
171 | TargetAttributes = {
172 | 854F24B41FF5331B004FC1D1 = {
173 | CreatedOnToolsVersion = 9.2;
174 | ProvisioningStyle = Automatic;
175 | };
176 | };
177 | };
178 | buildConfigurationList = 854F24B01FF5331B004FC1D1 /* Build configuration list for PBXProject "ZWAppStoreDemo" */;
179 | compatibilityVersion = "Xcode 8.0";
180 | developmentRegion = en;
181 | hasScannedForEncodings = 0;
182 | knownRegions = (
183 | Base,
184 | );
185 | mainGroup = 854F24AC1FF5331B004FC1D1;
186 | productRefGroup = 854F24B61FF5331B004FC1D1 /* Products */;
187 | projectDirPath = "";
188 | projectRoot = "";
189 | targets = (
190 | 854F24B41FF5331B004FC1D1 /* ZWAppStoreDemo */,
191 | );
192 | };
193 | /* End PBXProject section */
194 |
195 | /* Begin PBXResourcesBuildPhase section */
196 | 854F24B31FF5331B004FC1D1 /* Resources */ = {
197 | isa = PBXResourcesBuildPhase;
198 | buildActionMask = 2147483647;
199 | files = (
200 | 85D683F92004EF0B00B50931 /* Asset.xcassets in Resources */,
201 | 853B6689200358BE00E44CC2 /* ZWUpdateAppView.xib in Resources */,
202 | 854F24C51FF5331B004FC1D1 /* LaunchScreen.storyboard in Resources */,
203 | 854F24C21FF5331B004FC1D1 /* Assets.xcassets in Resources */,
204 | 853B66A12003A92300E44CC2 /* ZWRequestReview.xib in Resources */,
205 | 8535B78B1FFF1D2900A87520 /* Main.storyboard in Resources */,
206 | );
207 | runOnlyForDeploymentPostprocessing = 0;
208 | };
209 | /* End PBXResourcesBuildPhase section */
210 |
211 | /* Begin PBXSourcesBuildPhase section */
212 | 854F24B11FF5331B004FC1D1 /* Sources */ = {
213 | isa = PBXSourcesBuildPhase;
214 | buildActionMask = 2147483647;
215 | files = (
216 | 853B6688200358BE00E44CC2 /* ZWCheckVersion.m in Sources */,
217 | 854F24BD1FF5331B004FC1D1 /* ViewController.m in Sources */,
218 | 853B668A200358BE00E44CC2 /* ZWAppStoreModel.m in Sources */,
219 | 854F24C81FF5331B004FC1D1 /* main.m in Sources */,
220 | 853B66A22003A92300E44CC2 /* ZWActionReview.m in Sources */,
221 | 853B668B200358BE00E44CC2 /* ZWUpdateAppView.m in Sources */,
222 | 854F24BA1FF5331B004FC1D1 /* AppDelegate.m in Sources */,
223 | 853B66A02003A92300E44CC2 /* ZWRequestReview.m in Sources */,
224 | );
225 | runOnlyForDeploymentPostprocessing = 0;
226 | };
227 | /* End PBXSourcesBuildPhase section */
228 |
229 | /* Begin PBXVariantGroup section */
230 | 854F24C31FF5331B004FC1D1 /* LaunchScreen.storyboard */ = {
231 | isa = PBXVariantGroup;
232 | children = (
233 | 854F24C41FF5331B004FC1D1 /* Base */,
234 | 853B667D20030E6D00E44CC2 /* zh-Hans */,
235 | );
236 | name = LaunchScreen.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 854F24C91FF5331B004FC1D1 /* Debug */ = {
243 | isa = XCBuildConfiguration;
244 | buildSettings = {
245 | ALWAYS_SEARCH_USER_PATHS = NO;
246 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
247 | CLANG_ANALYZER_NONNULL = YES;
248 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
250 | CLANG_CXX_LIBRARY = "libc++";
251 | CLANG_ENABLE_MODULES = YES;
252 | CLANG_ENABLE_OBJC_ARC = YES;
253 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
254 | CLANG_WARN_BOOL_CONVERSION = YES;
255 | CLANG_WARN_COMMA = YES;
256 | CLANG_WARN_CONSTANT_CONVERSION = YES;
257 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
258 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
259 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
260 | CLANG_WARN_EMPTY_BODY = YES;
261 | CLANG_WARN_ENUM_CONVERSION = YES;
262 | CLANG_WARN_INFINITE_RECURSION = YES;
263 | CLANG_WARN_INT_CONVERSION = YES;
264 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
265 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
266 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
268 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
269 | CLANG_WARN_STRICT_PROTOTYPES = YES;
270 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
271 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
272 | CLANG_WARN_UNREACHABLE_CODE = YES;
273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
274 | CODE_SIGN_IDENTITY = "iPhone Developer";
275 | COPY_PHASE_STRIP = NO;
276 | DEBUG_INFORMATION_FORMAT = dwarf;
277 | ENABLE_STRICT_OBJC_MSGSEND = YES;
278 | ENABLE_TESTABILITY = YES;
279 | GCC_C_LANGUAGE_STANDARD = gnu11;
280 | GCC_DYNAMIC_NO_PIC = NO;
281 | GCC_NO_COMMON_BLOCKS = YES;
282 | GCC_OPTIMIZATION_LEVEL = 0;
283 | GCC_PREPROCESSOR_DEFINITIONS = (
284 | "DEBUG=1",
285 | "$(inherited)",
286 | );
287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
289 | GCC_WARN_UNDECLARED_SELECTOR = YES;
290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
291 | GCC_WARN_UNUSED_FUNCTION = YES;
292 | GCC_WARN_UNUSED_VARIABLE = YES;
293 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
294 | MTL_ENABLE_DEBUG_INFO = YES;
295 | ONLY_ACTIVE_ARCH = YES;
296 | SDKROOT = iphoneos;
297 | };
298 | name = Debug;
299 | };
300 | 854F24CA1FF5331B004FC1D1 /* Release */ = {
301 | isa = XCBuildConfiguration;
302 | buildSettings = {
303 | ALWAYS_SEARCH_USER_PATHS = NO;
304 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
305 | CLANG_ANALYZER_NONNULL = YES;
306 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
308 | CLANG_CXX_LIBRARY = "libc++";
309 | CLANG_ENABLE_MODULES = YES;
310 | CLANG_ENABLE_OBJC_ARC = YES;
311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
312 | CLANG_WARN_BOOL_CONVERSION = YES;
313 | CLANG_WARN_COMMA = YES;
314 | CLANG_WARN_CONSTANT_CONVERSION = YES;
315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
318 | CLANG_WARN_EMPTY_BODY = YES;
319 | CLANG_WARN_ENUM_CONVERSION = YES;
320 | CLANG_WARN_INFINITE_RECURSION = YES;
321 | CLANG_WARN_INT_CONVERSION = YES;
322 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
323 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
324 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
326 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
327 | CLANG_WARN_STRICT_PROTOTYPES = YES;
328 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
329 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
330 | CLANG_WARN_UNREACHABLE_CODE = YES;
331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
332 | CODE_SIGN_IDENTITY = "iPhone Developer";
333 | COPY_PHASE_STRIP = NO;
334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
335 | ENABLE_NS_ASSERTIONS = NO;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | GCC_C_LANGUAGE_STANDARD = gnu11;
338 | GCC_NO_COMMON_BLOCKS = YES;
339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
341 | GCC_WARN_UNDECLARED_SELECTOR = YES;
342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343 | GCC_WARN_UNUSED_FUNCTION = YES;
344 | GCC_WARN_UNUSED_VARIABLE = YES;
345 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
346 | MTL_ENABLE_DEBUG_INFO = NO;
347 | SDKROOT = iphoneos;
348 | VALIDATE_PRODUCT = YES;
349 | };
350 | name = Release;
351 | };
352 | 854F24CC1FF5331B004FC1D1 /* Debug */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356 | CODE_SIGN_STYLE = Automatic;
357 | DEVELOPMENT_TEAM = HW3C56DWFX;
358 | INFOPLIST_FILE = ZWAppStoreDemo/Info.plist;
359 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
361 | PRODUCT_BUNDLE_IDENTIFIER = "wang-ziwu.ZWAppStoreDemo";
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | TARGETED_DEVICE_FAMILY = "1,2";
364 | };
365 | name = Debug;
366 | };
367 | 854F24CD1FF5331B004FC1D1 /* Release */ = {
368 | isa = XCBuildConfiguration;
369 | buildSettings = {
370 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
371 | CODE_SIGN_STYLE = Automatic;
372 | DEVELOPMENT_TEAM = HW3C56DWFX;
373 | INFOPLIST_FILE = ZWAppStoreDemo/Info.plist;
374 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
376 | PRODUCT_BUNDLE_IDENTIFIER = "wang-ziwu.ZWAppStoreDemo";
377 | PRODUCT_NAME = "$(TARGET_NAME)";
378 | TARGETED_DEVICE_FAMILY = "1,2";
379 | };
380 | name = Release;
381 | };
382 | /* End XCBuildConfiguration section */
383 |
384 | /* Begin XCConfigurationList section */
385 | 854F24B01FF5331B004FC1D1 /* Build configuration list for PBXProject "ZWAppStoreDemo" */ = {
386 | isa = XCConfigurationList;
387 | buildConfigurations = (
388 | 854F24C91FF5331B004FC1D1 /* Debug */,
389 | 854F24CA1FF5331B004FC1D1 /* Release */,
390 | );
391 | defaultConfigurationIsVisible = 0;
392 | defaultConfigurationName = Release;
393 | };
394 | 854F24CB1FF5331B004FC1D1 /* Build configuration list for PBXNativeTarget "ZWAppStoreDemo" */ = {
395 | isa = XCConfigurationList;
396 | buildConfigurations = (
397 | 854F24CC1FF5331B004FC1D1 /* Debug */,
398 | 854F24CD1FF5331B004FC1D1 /* Release */,
399 | );
400 | defaultConfigurationIsVisible = 0;
401 | defaultConfigurationName = Release;
402 | };
403 | /* End XCConfigurationList section */
404 | };
405 | rootObject = 854F24AD1FF5331B004FC1D1 /* Project object */;
406 | }
407 |
--------------------------------------------------------------------------------