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

  • Question

  • User8827 posted

    We've recently released a new App based on the Universal API to the App Store and we see a very strange behavior of the App.

    You can get the full details in this StackOverflow question, but since this may be an issue with the Xamarin API binding, I hope someone else may be experiencing a similar issue or can confirm that it is indeed working for them (just so that we can rule out Xamarin is at fault and point our fingers to Apple instead).

    This is our code:

      var request = new SKProductsRequest( new NSSet( ... ) );
            _runningRequests.Add( request );
            request.ReceivedResponse += HandleReceivedResponse;
            request.RequestFailed += HandleRequestFailed;
            request.RequestFinished += HandleRequestFinnished;
        // ....
        void HandleReceivedResponse( object sender, SKProductsRequestResponseEventArgs e )
            ViewModel.IsProcessing = false;
            foreach (var item in e.Response.InvalidProducts)
                Console.WriteLine( "Invalid product: " + item );
            var products = e.Response.Products.Select( x => new InAppProductViewModel( x.LocalizedTitle, x.ProductIdentifier, x.LocalizedDescription, LocalizedPrice( x ), IsPurchased( x ), () => Purchase( x ) ) );
            var vms = products.ToList();
            ViewModel.UpdateProducts( vms );

    Pretty straightforward: * In the Sandbox/Test environment we can query product ids just fine and receive proper responses, on iOS 7 and iOS8 devices * The App passed review, we're already successfully selling items, so it's working for some users. * Yet, we have customers reporting that they are unable to see anything in our In App Store. They all have in common that they're running iOS 7 devices.

    We can reproduce the issue - with the version released on the App Store on the console we see the output "Invalid product id" for each identifier we pass into the SKProductRequest. The identifiers match exactly what we specified in code.

    Now, I'm puzzled because the App works fine on iOS8 devices and in the iOS7 Sandbox. The product identifiers that we pass in are 100% correct as confirmed by the console output.

    Anyone experienced something similar? Anyone have a Universal App with IAP on the App Store? Would be great if you can tell me the name and how to check IAPs in you App to see whether you have the same issue on an iOS7 device or whether it's just our App.

    Tuesday, March 10, 2015 1:24 PM

All replies

  • User3589 posted

    We are experiencing the same issue.

    All SKProductsRequest calls with product identifiers fail on iOS7, but they succeed on iOS8. Debug and AdHoc builds do work on iOS7, but the AppStore version does not work. All product identifiers are returned as InvalidProducts.

    As a workaround we ask our app users that report this issue to upgrade to iOS8, but that is not possible on all devices.

    Tuesday, March 24, 2015 11:11 AM
  • User8827 posted

    Great to hear that I'm not the only one. Can you please file a bug with Apple at bugreporter.apple.com and reference the bug 20259831 (which I have created) and indicate that you need this to be worked on ASAP!

    We have been informed that it appears to be an iOS issue and they are not sure what is causing this behavior.

    Opening a DTS incident might help as well. It has the bonus that you get a real human to answer your questions and turn around to emails is usually 24hrs. You have 2 free DTS incidents per Apple Developer Center member year, so good reason to burn one. Feel free to reference our DTS incident which is tracked as number 619835720.

    Tuesday, March 24, 2015 9:38 PM
  • User8827 posted

    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 CompileITunesMetada task, which creates a rouge metadata plist file that can break In App Purchases on iOS7 -->
      <Target Name="_CompileITunesMetadata" DependsOnTargets="_DetectSdkLocations;_DetectAppManifest;_GenerateBundleName;_CompileAppManifest">
         <Message Text="Skipping CompileITunesMetada task, which creates a rouge metadata plist file that can break In App Purchases on iOS7" />

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

    Friday, April 17, 2015 9:25 AM
  • User20627 posted

    According to https://bugzilla.xamarin.com/show_bug.cgi?id=29180, this bug should be fixed. But not sure if it's released or not. Can't find any information regarding this bug in release log.

    I encountered the same problem with the latest release of my app. My Xamarin Studio is 5.9 and up to date. Anyone has further information?

    Friday, May 8, 2015 12:47 PM
  • User1044 posted

    If you are building your IPAs as part of the build process (as opposed to creating them in the Archive View and using Xamarin Studio's publishing wizard), then install this build of Xamarin.iOS: http://storage.bos.internalx.com/macios-mac-macios-cycle5/ef/efa88a77bcda8a432f1d5b9b6291d1d8b7f29b98/monotouch-

    Otherwise if you are using Xamarin Studio's Publishing Workflow (from the Archive View), install this build of Xamarin Studio: http://storage.bos.internalx.com/monodevelop-lion-monodevelop-5.9-branch/3f/3f4af9ed439f5603afbdc7e5c10274802f2b3339/XamarinStudio-

    Friday, May 8, 2015 3:27 PM
  • User223656 posted

    I was always getting Invalid products. After updating it to Xcode 8.2 and Xamarin to latest version it worked

    Tuesday, January 3, 2017 6:28 AM