Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-22-2011, 10:58 AM   #1 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Question In App Purchase - 'No Products Found'

Every I try to use In App Purchase, it says 'No Products Found' in the console. I double checked that the IBAction was hooked up to the button, and I got this code off of a tutorial. YouTube - XCode Tutorial: In-App Purchase

If anyone knows why this is happening or if there is something wrong in my code, let me know...

.h
Code:
#import <StoreKit/StoreKit.h>
Code:
<SKProductsRequestDelegate, SKPaymentTransactionObserver>
Code:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response;
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions;
.m
Code:
#define kInAppPurchaseProUpgradeProductId @"com.lsmdev.mutecount.001"
Purchase action (Hooked up to my button)
Code:
- (IBAction)purchase {
	SKPayment *payment = [SKPayment paymentWithProductIdentifier:kInAppPurchaseProUpgradeProductId];
	[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
	[[SKPaymentQueue defaultQueue] addPayment:payment];
}
Code:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
	SKProduct *validProduct = nil;
	int count = [response.products count];
	if (count > 0) {
		validProduct = [response.products objectAtIndex:0];
	} 
	else if (!validProduct) {
		NSLog(@"No products available");
	}
}

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
	for (SKPaymentTransaction *transaction in transactions) {
		switch (transaction.transactionState) {
			case SKPaymentTransactionStatePurchasing:
				NSLog(@"Purchasing Now");
				break;
				
			case SKPaymentTransactionStatePurchased:
				[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
				
				//Call showlabel method to show the label
				[self showlabel];
				
				NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
				[prefs setObject:@"test" forKey:@"stringVal"];
				[prefs synchronize];
				
				UIImage *image = [UIImage imageNamed: @"P2-3-Main-P.png"];
				[background setImage:image];
				NSLog(@"Transaction Purchased");
				break;
				
			case SKPaymentTransactionStateRestored:
				[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
				NSLog(@"Transaction Restored");
				break;
				
			case SKPaymentTransactionStateFailed:
				if (transaction.error.code != SKErrorPaymentCancelled) {
					NSLog(@"An error encountered");
				}
				
				[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
				
				break;
		}
	}
}


- (void)showlabel {
	
	[scorelabel setHidden:NO];
	
}
In the viewdidload:
Code:
	NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
	// getting the string
	iapstring = [prefs stringForKey:@"stringVal"];
	
	//Free Version
	if (iapstring == nil) {
		//Action
		UIImage *image = [UIImage imageNamed: @"P2-3-Main-L.png"];
		[background setImage:image];
		
	}
	
	//Paid Version
	if (iapstring != nil) {
		//Action
		UIImage *image = [UIImage imageNamed: @"P2-3-Main-P.png"];
		[background setImage:image];
	}
	
	
	[scorelabel setHidden:YES];
	
	if ([SKPaymentQueue canMakePayments]) {
		NSLog(@"Parental-controls are disabled");
		
		//Put the link to the IAP from iTC in the string otherwise IAP will not work
		SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:kInAppPurchaseProUpgradeProductId]];
		productsRequest.delegate = self;
		[productsRequest start];
		//Not sure if you need the below line, check if it works
		//[productsRequest release];
	} else {
		NSLog(@"Parental-controls are enabled");
	}
	
}
iapstring is a nsstring i used in the nsuserdefaults to check if the item was purchased.

Update 2-23-11: I used a define to make it so I only had to put the product id in once and then use the define in the bolded lines to make it easier on myself. If anyone sees anything wrong, just post.

Thanks

Last edited by Objective Zero; 02-23-2011 at 11:21 AM. Reason: 2-23-11 Added new code (Bolded)
Objective Zero is offline   Reply With Quote
Old 02-22-2011, 11:38 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

do you have your products set up correctly in itunesConnect?
smithdale87 is offline   Reply With Quote
Old 02-22-2011, 12:10 PM   #3 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

And if you did set them up, did you wait enough time so that they get propagated through the servers, it can take several hours.
baja_yu is offline   Reply With Quote
Old 02-22-2011, 12:21 PM   #4 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

I waited about 19 hours hours now. Is the product id for the IAP itself or for the app ID? Is there anything that looks wrong in the code I provided?
Objective Zero is offline   Reply With Quote
Old 02-23-2011, 11:18 AM   #5 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Right now, I waited about 30 hours after I updated iTC. I am still using the same code above but changed one thing. And you can the changes in bold above.
Objective Zero is offline   Reply With Quote
Old 02-25-2011, 10:50 AM   #6 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Question

I changed the product id for the IAP to match the product id for the app but at the end I added a .platinum. Now I waited about 17 hours after I did so and still get 'No Products Available', and 'An Error Encountered'. Anyone have any ideas why?
Objective Zero is offline   Reply With Quote
Old 03-16-2011, 12:44 PM   #7 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

did you ever solve this? im having the same problem now.
Alexj17 is offline   Reply With Quote
Old 03-16-2011, 01:00 PM   #8 (permalink)
Registered Member
 
Join Date: Mar 2011
Location: The Netherlands
Posts: 44
Hollance is on a distinguished road
Default

I had the same issue. My products did not want to show up (in fact, they were in the list of invalid product identifiers in the response object). What helped is removing the app from the device and doing a new build. Then it magically worked again.
Hollance is offline   Reply With Quote
Old 03-16-2011, 05:48 PM   #9 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Quote:
Originally Posted by Alexj17 View Post
did you ever solve this? im having the same problem now.
Nope, I never got it to work.
Objective Zero is offline   Reply With Quote
Old 11-03-2011, 05:17 AM   #10 (permalink)
Registered Member
 
harshit2811's Avatar
 
Join Date: Aug 2010
Location: Baroda
Posts: 50
harshit2811 is on a distinguished road
Send a message via Yahoo to harshit2811
Default facting "no product availble" !

Hello i have also done same steps. registering product details in iTunes store.

Here attached screen shot of purchase detail.....



Should i have to upload binary to test app ??

Last edited by harshit2811; 11-03-2011 at 05:23 AM.
harshit2811 is offline   Reply With Quote
Old 11-06-2011, 12:19 AM   #11 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

No, you just need to upload a screenshot of what the app will look like after the IAP is bought. Then you can test before it is submitted.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 11-07-2011, 01:11 AM   #12 (permalink)
Registered Member
 
harshit2811's Avatar
 
Join Date: Aug 2010
Location: Baroda
Posts: 50
harshit2811 is on a distinguished road
Send a message via Yahoo to harshit2811
Default

Quote:
Originally Posted by Objective Zero View Post
No, you just need to upload a screenshot of what the app will look like after the IAP is bought. Then you can test before it is submitted.

Thanks for reply...I have done that. But still not getting product details ..So i googled it and found that before setting up IAP i have to sign Paid Contracts under "Contracts, Bank and TAX"..

I have my bank info ready but what abt TAX??? I m from India. What info i required to make this "Contracts In Effect".

Please guide me.
harshit2811 is offline   Reply With Quote
Old 11-07-2011, 03:07 PM   #13 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

You have to fill out tax information that goes with India, once the tax is set up then the In App Purchase will work.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 01-02-2012, 11:37 PM   #14 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 14
smith288 is on a distinguished road
Default

I have all the correct steps completed:

Signed contract
Correct productids
Current app in the store with full unique bundle id
Products in itunes connect are marked as cleared for sale and screenshot attached to items
Provision files have been completely redone (deleted locally and phone and rebuilt using the ones I just got from portal)
Delete app from phone
Ran from XCode

They show in the simulator but not the device when I run from xcode to the device.
smith288 is offline   Reply With Quote
Old 01-11-2012, 12:23 PM   #15 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 14
smith288 is on a distinguished road
Default

Anyone?
smith288 is offline   Reply With Quote
Old 01-11-2012, 12:40 PM   #16 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

Here's a new problem now

I have everything working fine one device, but on another it doesnt load any of the products, how can this be? The only thing can be different are the provisional profiles yeah?

Alex
Alexj17 is offline   Reply With Quote
Old 01-11-2012, 12:42 PM   #17 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 14
smith288 is on a distinguished road
Default

Did you use the FULL bundle plus the product id (com.company.app.productid) when you are requesting the list of products?
smith288 is offline   Reply With Quote
Old 01-11-2012, 12:51 PM   #18 (permalink)
www.Alexj17.com
 
Alexj17's Avatar
 
Join Date: May 2009
Location: Liverpool, England
Posts: 181
Alexj17 is on a distinguished road
Send a message via Skype™ to Alexj17
Default

My bundle ID in ITC is 'unlock.everything'.
Alexj17 is offline   Reply With Quote
Old 01-11-2012, 12:54 PM   #19 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 14
smith288 is on a distinguished road
Default

Here is what im doing
Code:
#define kInAppPurchaseNoProfessionalProductId @"com.mycompany.myappname.mycoolproduct"


    NSSet *productIdentifiers = [NSSet setWithObjects:kInAppPurchaseNoProfessionalProductId, nil];
    productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
    productsRequest.delegate = self;
    [productsRequest start];
But on the device, its always saying it's invalid. Simulator, it shows fine. Gah!
smith288 is offline   Reply With Quote
Old 01-12-2012, 03:24 AM   #20 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 8
Achuaswani is on a distinguished road
Default Check

check these
1. Ur bundle id - com.mycompany.myappname
2. No need of uploading binary and screenshot
3. should not be a jailbroken phone
4. building for iPhone OS3.0 and above
5. u r not using wildcard rght?

Last edited by Achuaswani; 01-12-2012 at 03:27 AM.
Achuaswani is offline   Reply With Quote
Old 01-12-2012, 10:17 AM   #21 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 14
smith288 is on a distinguished road
Default

Quote:
Originally Posted by Achuaswani View Post
check these
1. Ur bundle id - com.mycompany.myappname
2. No need of uploading binary and screenshot
3. should not be a jailbroken phone
4. building for iPhone OS3.0 and above
5. u r not using wildcard rght?
#3 got me good. I love my JB though.

Anyways, I restored my phone and ran my app on the device and it worked as I expected. In App products showing up now. Thanks!

And no, I dont use wildcards for any of my apps. Seems like a waste and limiting yourself.
smith288 is offline   Reply With Quote
Reply

Bookmarks

Tags
iap storekit

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 377
18 members and 359 guests
Absentia, akphyo, apatsufas, BinHex, cpsclicker, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, mottdog, Music Man, PavelMik, teebee74, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:14 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0