IAP working on Xcode simulator but not on hardware...

…any ideas what might be at the root of this?

I did get IAP to work for a time on the test hardware I put it on (an original iPad). Since then if I try with the IAP sample project that ships with Corona I get the “Sorry! In-App purchases is not supported on this device” warning which is associated with a failed store transaction.

In short, things work fine on the Xcode simulator and I did get things working at first on my iPad but now both the sample IAP project and a custom one don’t work on the hardware.

Thanks for any thoughts anyone can share :slight_smile:

@ECHO, I have loadProductsCallback function in main.lua that prints all valid products (title, price and localized price) at the time app is launched.  And occasionally, it returns no products.  In fact, it just happened yesterday too.

When my app doesn’t find any valid products, IAP definitely fails.  (That said, I don’t remember if I got the same error message that you posted above.)  For me, the easiest solution is to reset the device (general > reset > erase all content and settings), reinstall the app and try it again – and sure enough, IAP tests successfully after that.  It seems to me things get a bit odd with iTunes Sandbox sometimes.

This may not be the most desirable solution for you, and the errors you are seeing might be caused by something different, but I thought I’d mention how I deal with the oddity like that.  (And so far, every oddities and issues I’ve come across when testing IAP on iOS device are resolved after I reset the device.)

Naomi

@Naomi, by chance I just discovered that deleting the app off the “desktop” (not sure what you call the desktop on a mobile device) and then reinstalling it has solved the problem (previously I had just been replacing the app in the Xcode organizer).

To be clear for anyone else that is having this problem: Don’t just drag the app back into the organizer and choose to “replace” it. First delete it off the device (hold icon and “X” it out) and then drag the app into the organizer).

In anycase, this is working for the time being… who know’s how it will go later today lol! 

Thank you Naomi, you are always so helpful on the forums :slight_smile:

@ECHO, I’m glad to hear you solved the IAP problem you were having.  

In my most recent case, I did not replace the app when installing it.  Or rather, if I remember correctly, I don’t think I’ve ever installed this particular app on the devices that had issues (although I had my other Corona apps already installed on them.)  So, if you ever encounter a similar problem like the one I described, you might consider resetting the device (as the last resort.)

Cheers,

Naomi

@ECHO, I have loadProductsCallback function in main.lua that prints all valid products (title, price and localized price) at the time app is launched.  And occasionally, it returns no products.  In fact, it just happened yesterday too.

When my app doesn’t find any valid products, IAP definitely fails.  (That said, I don’t remember if I got the same error message that you posted above.)  For me, the easiest solution is to reset the device (general > reset > erase all content and settings), reinstall the app and try it again – and sure enough, IAP tests successfully after that.  It seems to me things get a bit odd with iTunes Sandbox sometimes.

This may not be the most desirable solution for you, and the errors you are seeing might be caused by something different, but I thought I’d mention how I deal with the oddity like that.  (And so far, every oddities and issues I’ve come across when testing IAP on iOS device are resolved after I reset the device.)

Naomi

@Naomi, by chance I just discovered that deleting the app off the “desktop” (not sure what you call the desktop on a mobile device) and then reinstalling it has solved the problem (previously I had just been replacing the app in the Xcode organizer).

To be clear for anyone else that is having this problem: Don’t just drag the app back into the organizer and choose to “replace” it. First delete it off the device (hold icon and “X” it out) and then drag the app into the organizer).

In anycase, this is working for the time being… who know’s how it will go later today lol! 

Thank you Naomi, you are always so helpful on the forums :slight_smile:

@ECHO, I’m glad to hear you solved the IAP problem you were having.  

In my most recent case, I did not replace the app when installing it.  Or rather, if I remember correctly, I don’t think I’ve ever installed this particular app on the devices that had issues (although I had my other Corona apps already installed on them.)  So, if you ever encounter a similar problem like the one I described, you might consider resetting the device (as the last resort.)

Cheers,

Naomi