• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
StoreKit problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

StoreKit problem


  • Subject: StoreKit problem
  • From: Development <email@hidden>
  • Date: Tue, 29 Dec 2009 19:53:40 -0700

I am trying to use the store kit. Everything works until i send the data to my php script to verify the transaction below is the code that sends to the script and then i get this error:
response {"status":21002, "exception":"java.lang.IllegalArgumentException: propertyListFromString parsed an object, but there's still more text in the string. A plist should contain only one top-level object. Line number: 6, column: 2."}

				NSUserDefaults * settings = [NSUserDefaults standardUserDefaults];
				UIDevice *thisDevice = [UIDevice currentDevice];
				NSString * udid =thisDevice.uniqueIdentifier;

				NSURL * url = [NSURL URLWithString:@"http://fornextsoft.com/script.php";];

				NSString *myRequestString = [NSString stringWithFormat:@"UDID=%@&transaction=%@",udid,
											 [NSString encode:(const uint8_t*)[[item transactionReceipt] bytes]
													   length:[[item transactionReceipt] length]]];

				NSData *myRequestData = [myRequestString dataUsingEncoding:NSUTF8StringEncoding];

				NSLog(@"Request string: %@",myRequestString);

				NSMutableURLRequest *request = [ [ NSMutableURLRequest alloc ] initWithURL:url];
				[ request setHTTPMethod: @"POST" ];
				[ request setHTTPBody: myRequestData ];
				[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
				NSURLResponse* urlResponse;
				NSError* error;
				NSData* result = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];

				NSString * response = [[NSString alloc]initWithData:result encoding:NSUTF8StringEncoding];
				NSLog(@"response %@",response);
			[[SKPaymentQueue defaultQueue]finishTransaction:item];




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: testing email code in the simulator (MFMailComposeViewControllerDelegate)
  • Next by Date: MyDocument.xib v MainMenu.xib
  • Previous by thread: Re: testing email code in the simulator (MFMailComposeViewControllerDelegate)
  • Next by thread: MyDocument.xib v MainMenu.xib
  • Index(es):
    • Date
    • Thread