在 xcode 上关闭应用内购买

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38552706/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:04:20  来源:igfitidea点击:

Turn off in-app purchases on xcode

iosiphonexcode

提问by dyatesupnorth

I'm trying to test my app on an iPad / iPhone.

我正在尝试在 iPad / iPhone 上测试我的应用程序。

I've not registered for the developer program yet. I do have an appleId, was waiting until the app was more or less ready before I enrolled in the program.

我还没有注册开发者计划。我确实有一个appleId,在我注册该计划之前一直等到应用程序或多或少准备就绪。

Anyway, when I try to run the app I just get told that

无论如何,当我尝试运行该应用程序时,我只是被告知

The 'In-App Purchase' feature is only available to users enrolled in Apple Developer Program. Please visit 
https://developer.apple.com/programs/ to enroll

I know there is some setting somewhere for me to turn off in-app purchases, just not sure where it is? I've scoured most of the settings pages, run searched etc. and just cant seem to get past this?

我知道有一些设置可以让我关闭应用内购买,只是不确定它在哪里?我已经浏览了大部分设置页面,运行搜索等,但似乎无法解决这个问题?

edit: heres my capabilities tab in my xcode project settings.

编辑:这是我的 xcode 项目设置中的功能选项卡。

xcode project settings

xcode 项目设置

回答by zephinzer

For anyone who's coming across the same problem, this issue arises when you 1) previously had a developer account which expired and 2) you had in-app purchases enabled.

对于遇到相同问题的任何人,当您 1) 之前拥有已过期的开发者帐户和 2) 启用了应用内购买时,就会出现此问题。

The solution is to go to click on the main project root in the left side panel which should reveal the project properties. Scroll to the bottom and there is a Linked Frameworks and Libraries. Remove the StoreKit.framework, go to Signing, disable the 'Automatically manage signing' option and enable it again. If needed, set your Team to 'None' and set it back to your Personal Development Team, which should trigger the automatic provisioning mechanism.

解决方案是单击左侧面板中的主项目根目录,这将显示项目属性。滚动到底部,有一个链接的框架和库。删除 StoreKit.framework,转到签名,禁用“自动管理签名”选项并再次启用它。如果需要,将您的团队设置为“无”并将其设置回您的个人发展团队,这应该会触发自动配置机制。

回答by Victor Maiorov

If nothing helps, you can edit YourProject.xcodeproj/project.pbxproj file and remove all strings containing StoreKitand

如果没有任何帮助,您可以编辑 YourProject.xcodeproj/project.pbxproj 文件并删除所有包含StoreKit

com.apple.InAppPurchase = {
    enabled = 1;
};

回答by dyatesupnorth

I fixed this by changing the provisioning profile in the project settings!

我通过更改项目设置中的配置文件来解决这个问题!

It was set to auto, changed it a provisioning profile containing my app name, all working now.

它设置为自动,将其更改为包含我的应用程序名称的配置文件,现在一切正常。

回答by Declan Conway

Hit the toggle in the Capabilities section and you should be good to go!

点击“功能”部分中的切换按钮,您应该一切顺利!

回答by Ziad Tamim

You question isn't clear enough.

你的问题不够清楚。

Check the image below to turn off In-App Purchase.

检查下图以关闭应用内购买。

enter image description here

在此处输入图片说明