2025-04-22 StoreKit.framework 管理操作方式

image.png

添加系统 Framework(比如 StoreKit)的方式
打开你的 .xcodeproj 或 .xcworkspace

选中你的 Target

点击上方的 "Build Phases"

找到并展开:"Link Binary With Libraries"

点下方的 "+" 按钮

搜索 StoreKit.framework,然后添加它

添加成功后,Xcode 会自动将它写入你的 project.pbxproj 文件,表现为你看到的这段:


771D92762AF494500046B522 /* StoreKit.framework in Frameworks */ = {
 isa = PBXBuildFile;
 fileRef = 771D92752AF494500046B522 /* StoreKit.framework */;
};

使用 StoreKit 场景1:

#import <StoreKit/StoreKit.h>
 

使用 StoreKit 场景2:

请求 App Store 评分弹窗(无需上报)

import StoreKit
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
    SKStoreReviewController.requestReview(in: scene)
}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容