StoreKit problem
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