Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 132

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
03/12/13 09:11 PM (12 years ago)

need help setting up in app purchase

I'm trying to use the easy in-app purchase plugin for the first time in a new app I'm building, but it's stuck on the "Please wait..." image. I followed the Word how-to document, making sure my product ID was the same on both iTunes Connect and my control panel, and made sure my Product ID started with my Bundle ID. I added some NSLog statements to try and diagnose where the issue is happening. Debugger shows that the proper product ID is being sent to the store request, but the request comes back with a product count of 0. Has anyone else come across this issue, or know what might be causing it?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/12/13 09:21 PM (12 years ago)
Well, I think I figured out what might be wrong - and unfortunately I don't think there's anything I can do about it. I didn't 'attach' the in-app purchase to the app in iTunes Connect when I set it up. At the top of the in-app purchase screen on iTunes Connect is the following warning: "Your first In-App Purchase(s) must be submitted with a new app version. Select them from the In-App Purchases section of the Version Details page and then click Ready to Upload Binary." So, I went to the Version Details page and clicked "ready to upload binary". Then I realized I should have selected the product before pressing the ready to upload button. And now, I can't seem to revert back to the previous state to where I can select the product. Perhaps this needs to be added to the how-to document so others don't mess it up. Looks like I'll have to submit the app without the in-app purchase option, then turn around and submit "version 2". :(
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/12/13 09:35 PM (12 years ago)
Okay - that wasn't the issue. I uploaded my app for review, then rejected it and then was able to attach the in-app product to the app on iTunes Connect. However, I still receive 0 products back from the store and can't get past the "Please wait".
 
theMonster
Code is Art
Profile
Posts: 435
Reg: Oct 18, 2011
US
8,050
like
03/13/13 03:13 AM (12 years ago)
The problem is at least one of these things: a) You entered your product ID wrong b) Your App ID is wrong c) Your not testing on a physical device d) Your profile isn't set up e) The connection between you and the apple servers is somehow "messed up" Guarantee it's one of these things. When you get the "spinwheel of death" it's a setup issue.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/13/13 05:37 AM (12 years ago)
1)I did a copy paste on the product ID and triple checked it 2)AppID has to be correct since I was able to submit the app for review and then reject it 3) tested on iPhone 4S 6.1 with dev target of 6.0 5) Connection is fine as verified by getting back "0 products" in the Store response received section That leaves the profile I guess. What do I need to do to diagnose that? I just woke up and not in front of my computer, so I'm not remembering what "profile" you're referring to.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/13/13 08:49 AM (12 years ago)
Okay - so once I got back to my computer, I tried it again with the same results. Then I shut XCode and the Simulator down (after resetting content and settings) and loaded it back up. I ran the app on the simulator and it grabbed the product from the store. The description doesn't show until I hit the buy button, but at least I got it to find the product. BUT: It still doesn't work on my iPhone. I can see that it is going through the proper steps of initializing the store object, sending the productID off (which is the correct ID), and receiving a response back from the App Store. But that response is still "0 products found".
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/13/13 09:45 AM (12 years ago)
Okay - after some digging around on the internet, I found that having a jailbroken device may cause this problem. I added the following code in the "(void)productsRequest" method of iAPManager.m. - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSLog(@"received response from store"); NSArray *myProducts = response.products; NSLog(@"number of products is:%i", [myProducts count]); NSMutableArray *myEasyProducts = [NSMutableArray array]; for (NSString *invalidProductId in response.invalidProductIdentifiers) { NSLog(@"Invalid product id: %@" , invalidProductId); } for (int i = 0; i < myProducts.count; i++) <remaining code is the same> That revealed that the "productId" was coming back as invalid, which can be for a variety of reasons. This webpage gave some insight: http://troybrant.net/blog/2010/01/invalid-product-ids/
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/13/13 10:47 AM (12 years ago)
Got it working finally. Turned out the jailbreak was the issue. After a little more research, I found all I needed to do was remove "AppSync" in Cydia, which is what causes the problems with sandboxing in-app purchases. After removing that, it works great. Hopefully this will help someone else.
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
03/23/13 06:08 PM (12 years ago)
@Chris, What is this 'Word how-to document' that you mentioned? Where do I find it? Thanks €
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
03/23/13 06:34 PM (12 years ago)
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
03/23/13 06:37 PM (12 years ago)
OMG! you just changed my life. Bloody Brilliant! Thanks Georgios Do you know if I can have multiple IAP in an app?
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
03/23/13 06:42 PM (12 years ago)
can't remember right now… wait until someone else answers or search a bit… Happy to help anyway!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.