StoreKit returns invalid product identifiers - only on the real App Store, only on iOS7

孤街浪徒 提交于 2019-12-03 16:45:06
Johannes Rudolph

Good news - Apple finally figured out what the cause of the issue. It appears that Xamarin.iOS started adding an iTunesMetadata.plist file to the App bundle during the build process (even though we're not building IPAs and deploy via xcode archives).

Quoting our iOS support engineer:

The issue appears to be that in the deliverable asset which you uploaded to iTunesConnect, there is a “rogue iTunesMetadata.plist” which is not present in other in app purchase apps that do work under iOS 6/7. The issue here is that there is the same file that is built into the app when the app gets installed from the Store to the device. Because this file is present in the app bundle already, the one the StoreKit installs isn’t used. The reason this is a problem is that the iTunesMetaData.plist is missing the 2 field values that are normally included in the fetchSoftwareAddOns URL request that is generated when the SKProductsRequest is called.

As a temporary workaround, I've patched out the "_CompileITunesMetadata" msbuild task to prevent generation of an iTunesMetadata.plist

  <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
  <!-- NOP out CompileITunesMetadata task, which creates a rogue metadata plist file that can break In App Purchases on iOS7 -->
  <Target Name="_CompileITunesMetadata" DependsOnTargets="_DetectSdkLocations;_DetectAppManifest;_GenerateBundleName;_CompileAppManifest">
     <Message Text="Skipping CompileITunesMetadata task, which creates a rogue metadata plist file that can break In App Purchases on iOS7" />
  </Target>

Our iOS support engineer indicated to me that iTunesConnect may build in validation routines to prevent/reject App submissions that contain a rogue iTunesMetadata.plist, so that hopefully others won't be hit by this weird behavior.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!