使用新的显式应用ID,应用内购买更新了应用。 SKProductsRequest返回空的产品列表 [英] Updated app with new explicit app id, in-app purchase. SKProductsRequest returns empty list of products

查看:106
本文介绍了使用新的显式应用ID,应用内购买更新了应用。 SKProductsRequest返回空的产品列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我的应用的当前待售版本使用通配符应用ID,并且捆绑包ID很简单且不具备不符合 com.companyname.appname 约定(它只是'appname')。它使用的App ID只是'bundleseed。*'形式,我相信,当使用配置文件签名时,会产生'bundleseed.appname'。 (为什么?因为这个应用程序自Apple推出显式App ID之前的2.x天以来,并且在XCode引入com.companyname约定之前就已存在。)

The current for-sale version of my app uses a wildcard app ID, and the bundle ID is simple and doesn't conform to the com.companyname.appname convention (it's just 'appname'). The App ID it uses is simply of the form 'bundleseed.*', resulting in, I believe, 'bundleseed.appname' when signed with the provisioning profile. (Why? Because this app has been around since the early 2.x days before Apple recommended explicit App IDs, and before XCode introduced the com.companyname convention.)

I将应用程序内购买添加到应用程序,这需要显式应用程序ID。我按照技术Q& A QA1680从通配符更新的说明进行操作应用程序ID到显式应用程序ID 。结果是我有一个新的显式应用ID,形式为'newbundleseed.appname',用于签署应用的新配置文件指定了这一点。 info.plist中的捆绑包ID保持相同的appname。

I'm adding In-App purchase to the app, which requires an Explicit App ID. I've followed the instructions in Technical Q&A QA1680 Updating from a wildcard App ID to an explicit App ID. The result is that I have a new explicit app ID of the form 'newbundleseed.appname', and the new provisioning profile used to sign the app specifies this. The bundle ID in the info.plist remained the same 'appname'.

问题:

当我从旧版本顶部的XCode部署新应用程序时,它似乎工作正常。旧版应用实例将替换为新应用,并且所有新功能都已到位。 但是,当应用程序提交SKProductsRequest时,它会生成一个空的产品列表。如果我将新应用程序部署为全新安装(而不是复制旧版本),那么一切都按预期工作 - SKProductsRequest结果在我的可用产品的完整列表中。

When I deploy the new app from XCode over the top of the old version it appears to work fine. The old-version app instance is replaced with the new app and all of the new features are in place. However, when the app submits a SKProductsRequest it results in an empty list of products. If I deploy the new app as a fresh install (not copying over an old version) then everything works as expected - SKProductsRequest results in a full list of my available products.

我还注意到升级的版本继承了旧版本的某些方面,这对我来说很奇怪。具体来说,旧版本的应用程序有一个default.png,新应用程序还没有作为构建的一部分,但升级的应用程序在加载时会显示旧的default.png。就好像升级的应用程序是新旧的合并。

I also noticed that the upgraded build carries forward some aspects of the old version, which is strange to me. Specifically, the old version of the app had a default.png which the new app doesn't yet have as part of the build, yet the upgraded app displays the old default.png while it is loading. It's as if the upgraded app is a merge of the old and new.

我主要担心的是应用程序内购买对我的升级用户有效。我是否在使用Explicit App ID做错了,或者这只是我使用In App Purchase沙箱的问题?在这种情况下,我可以确信它会在发布时发挥作用吗?

My primary concern is that In-App purchase will work for my upgrade users. Am I doing something wrong with the Explicit App ID, or is this just an issue with the fact that I'm using the In App Purchase sandbox? In which case, ow can I be confident it will work when released?

此外,任何关于新应用程序为何/如何看起来不会取代旧应用程序包的见解in-full?

Also, any insight on why/how the new app doesn't seemingly replace the old app bundle in-full?

我唯一能想到的是,我应该使用旧的捆绑种子而不是生成新的捆绑种子(详见QA1680)在创建新的App ID时。即旧的App id是'oldbundleseed。*'而我现在的新ID是'newbundleseed.appname',也许它应该是'oldbundleseed.appname'。但我不能这样做,因为供应门户网站不会让我创建一个仅由捆绑种子不同的应用程序ID。如果这是我的问题,该怎么办?联系Apple?

The only thing I can think of is that instead of generating a new bundle seed (as detailed in QA1680), I should have used the old bundle seed when creating the new App ID. i.e. the old App id is 'oldbundleseed.*' and my current new one is 'newbundleseed.appname', and perhaps it should be 'oldbundleseed.appname'. But I cannot do this because the provisioning portal wont let me create an app ID that differs only by bundle seed. If this is my issue, what to do? Contact Apple?

TL / DR:现有的应用程序,使用新的显式应用程序ID进行更新以支持IAP,除SKProductRequests外正常工作在应用程序升级时产生空产品列表,而干净安装产生填充产品列表。

TL/DR: an existing app, updated with a new explicit app ID as to support IAP, works fine except that SKProductRequests result in empty product lists when the app was updgraded vs. a clean install where they result in a populated product list.

推荐答案

你在升级吗?如果您正在构建并运行,那么最终会遇到此问题,即应用程序未完全重写。
Xcode做出一些优化决定,只复制真正更改的文件,这会使事情变得混乱。

How are you doing the upgrade? If you are do a build and run, you will end up with this problem where app is not completely re-written. Xcode makes some "optimization" decision and copies only files that are really changed and it messes things up.

创建一个adhoc分发并将其下载到具有旧版应用程序的设备。检查adhoc构建是否正确枚举。

Create an adhoc distribution and download it to the device that has the older version of the app. Check if that adhoc build enumerates it properly.

这篇关于使用新的显式应用ID,应用内购买更新了应用。 SKProductsRequest返回空的产品列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆