IAP working in game but not in a sample update of the game built on device

I am updating a game I created  with IAP.  It works in the App store.  But now I am making changes to the game and testing it on my device.  I cant get the IAP to show up on my device.  it says:

“oops, please check your internet connection and try again”   But the IAP will show up on the game in the App store so its not an internet connection  What am I doing wrong?  Could it be Im not using the correct developmental provisioning profile?  I am using the iTunes test user account profile when building to device.

I assume it’s your code that’s displaying the “oops, please check your internet connection and try again” popup, right?  (As far as I know, that’s not an “official” error message from Apple…)  Therefore, I’d suggest you check your code to see under what conditions you display that popup.  Maybe you made some changes to that code (either intentionally or unintentionally) between the version on the App Store that’s working and the latest version that’s failing.

In particular, how do you check whether you have an internet connection?

I doubt it has to do with provisioning profiles.

  • Andrew

Okay I copied and pasted the same exact  code from the live app in the Appstore and the test version.  The live Appstore version still works but when I test on device what is happening is “(trans.state == “failed”)”.   What could be the reason for the exact same code not pulling up IAP on test device?

In addition to the state being marked as failed, the transaction table has some fields that describe the any errors.  Print out the whole table to see that information.

  • Andrew

“I doubt it has to do with provisioning profiles.”

-Actually it was the Provisioning Profile.  The IOS Team Provisioning Profile doesn’t work, but the game development profile I used works.   Thank you anyways for trying to help I’m sure I’ll be back as with more questions as I am trying to implement more IAP into the game! 

Ah, glad you got it working.  I’ve never used the iOS Team Provisioning Profile, only my apps’ development profiles, but I’m glad to know that the first one can cause issues.

  • Andrew

I have never used the team profile as well.  Well, when I have it’s caused problems, so I abandoned it’s use quite quickly.   Officially speaking, if you’re going to talk to any Apple service, be it GameCenter, Push Notifications or in this case IAP, you pretty much have to use a dedicated AppID/BundleID to make it work.

In fact I have a bogus “App” in iTunesConnect that I use to test random stuff against.  I also have two Provisioning Profiles based around the bundle ID’s:  com.mycompany.test and com.mycompany.test2 that I use for building my apps.  That way I don’t create a lot of junk in my Provisioning Portal.

I assume it’s your code that’s displaying the “oops, please check your internet connection and try again” popup, right?  (As far as I know, that’s not an “official” error message from Apple…)  Therefore, I’d suggest you check your code to see under what conditions you display that popup.  Maybe you made some changes to that code (either intentionally or unintentionally) between the version on the App Store that’s working and the latest version that’s failing.

In particular, how do you check whether you have an internet connection?

I doubt it has to do with provisioning profiles.

  • Andrew

Okay I copied and pasted the same exact  code from the live app in the Appstore and the test version.  The live Appstore version still works but when I test on device what is happening is “(trans.state == “failed”)”.   What could be the reason for the exact same code not pulling up IAP on test device?

In addition to the state being marked as failed, the transaction table has some fields that describe the any errors.  Print out the whole table to see that information.

  • Andrew

“I doubt it has to do with provisioning profiles.”

-Actually it was the Provisioning Profile.  The IOS Team Provisioning Profile doesn’t work, but the game development profile I used works.   Thank you anyways for trying to help I’m sure I’ll be back as with more questions as I am trying to implement more IAP into the game! 

Ah, glad you got it working.  I’ve never used the iOS Team Provisioning Profile, only my apps’ development profiles, but I’m glad to know that the first one can cause issues.

  • Andrew

I have never used the team profile as well.  Well, when I have it’s caused problems, so I abandoned it’s use quite quickly.   Officially speaking, if you’re going to talk to any Apple service, be it GameCenter, Push Notifications or in this case IAP, you pretty much have to use a dedicated AppID/BundleID to make it work.

In fact I have a bogus “App” in iTunesConnect that I use to test random stuff against.  I also have two Provisioning Profiles based around the bundle ID’s:  com.mycompany.test and com.mycompany.test2 that I use for building my apps.  That way I don’t create a lot of junk in my Provisioning Portal.