Xamarin InAppPurchase iOS component restore problem

I am using this component and it was working in production without a problem. But I am having an issue recently while restoring auto-renewable products;

"InAppPurchasesRestored" - Raised whenever products have been restored from the iTunes App Store.
"InAppProductRestored" - Raised whenever a product is restored from the iTunes App Store.

I can get every product by catching the event "InAppProductRestored" but somehow "InAppPurchasesRestored" event is not called anymore so I cannot get the count of it. I was doing purchased receipt process in this event handler because I check the latest purchased product and send the receipt to our server here. "InAppProductRestored" calls every product that is purchased previously so its not helping me in this case.

PurchaseManager.RestoreProducts (); //calls nothing currently PurchaseManager.RestorePreviousPurchases (); //call just "InAppProductRestored"

I am executing both of them for restore. (I am using the apple sandbox environment - SimulateiTunesAppStore = false)

Persistence settings in AppDelegate are like below;

PurchaseManager.AutomaticPersistenceType = InAppPurchasePersistenceType.LocalFile; PurchaseManager.PersistenceFilename = "AtomicData"; PurchaseManager.ShuffleProductsOnPersistence = false; PurchaseManager.AutoPersistAfterPurchase = true; PurchaseManager.FullPersistence = true;

Any help or advice would be great. Thanks!

Posts

  • SlavaBaroulineSlavaBarouline AUMember ✭✭

    I am also experiencing problems with the restore functionality after the iOS 10 upgrade.

    Both calls do not seem to do anything:

    PurchaseManager.RestoreProducts ();
    PurchaseManager.RestorePreviousPurchases ();

    I tried to contact Xamarin support, but got nowhere.

    Also my crash reporting shows some strange errors caused by the component.

    This does look like a bug to me.

    I really need some help here.

    Thanks
    Slava

  • JimmyGarridoJimmyGarrido USXamarin Team Xamurai

    Are you able to reproduce the same issue with the sample project included in the component? I tested the sample project on iOS10 and it was working on my end.

    Can you create a project that reproduces the issue and share it? You can also PM me a link to it if you don't want to post it publicly.

    Thanks!

  • SlavaBaroulineSlavaBarouline AUMember ✭✭

    Yes, I can reproduce the same issue with the Unified sample project.

    I have replaced app id with one of mine and replaced all the IAPs with one my app has.
    The app shows my IAP - so this part seems to work.

    Then I press "Restore" button and nothing happens.

    I get a message in the logs:
    Invariant Culture 2014-05-28 01:30:30 +0000 to 28/05/2014 11:30:30 AM

    That's all.

    What could be wrong?

    Thanks

  • SlavaBaroulineSlavaBarouline AUMember ✭✭

    I also re-generated the Development Profile, but it did not help.

    What else could be wrong?

    Thanks

  • JimmyGarridoJimmyGarrido USXamarin Team Xamurai

    @SlavaBarouline Were you able to reproduce the issue with the sample project before replacing the app ID and IAPs? Can you post or PM me the entire debug output and device log?

  • SlavaBaroulineSlavaBarouline AUMember ✭✭
    edited November 2016

    @JimmyGarrido

    Hi Jimmy

    I tried a fresh copy of a unified sample app with the default ids.

    When I press "Restore", the app is asking for credentials and then nothing happens at all.
    So there is no debug output after the line

    2016-11-09 09:29:34.106 InAppPurchaseTestUnified[3493:788923] Xamarin.InAppBilling: User can make payments to iTunes App Store.

    Can you replicate this issue?

    When I look at the device log there is too much info.
    Do I need to filter it somehow?

    Thanks

  • JimmyGarridoJimmyGarrido USXamarin Team Xamurai

    @SlavaBarouline I am also seeing the AppleID login prompt when running on a device and tying to restore purchases but this expected as it's hitting the sandbox environment since only apps downloaded from the App Store connect to the production environment.

    When you replaced the sample IAPs with your app's IAPs did you also see the login prompt? If so, does the test user account you used have any purchases associated with it to restore? For the device you don't need to filter it, you can save it to a text file or Gist and link to it since it's too much info to post directly here.

  • Leon-BoonLeon-Boon NLUniversity
    edited November 2016

    I'm experiencing the same problem. Anyone already resolved this issue?

    Restoring works but i don't get the count (PurchaseManager.InAppPurchasesRestored isn't called), i want to show the user when there are no products to restore, this is currently not possible.

  • Greg767Greg767 CHMember ✭✭

    @JimmyGarrido
    I also experience the problem that the PurchaseManager.InAppPurchasesRestored is not called anymore. It was functioning correctly in my published app, but now it is not called anymore. Quite a problem..

  • SteveResnickSteveResnick USMember ✭✭

    Same problem here. My code used to work but now InAppPurchasesRestored is never called.

Sign In or Register to comment.