Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:10:52+00:00 2026-06-15T10:10:52+00:00

On a iPhone 4/iOS 4 device, sandbox App Store is reporting this error during

  • 0

On a iPhone 4/iOS 4 device, sandbox App Store is reporting this error during verification:

21002: The data in the receipt-data property was malformed.

On a iPhone 5/iOS 6 device, the same code works (status == 0, receipt returned) without any problems.

I’ve restarted the device, made sure the Apple ID is logged out, even made a new test user account. Same result. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:10:53+00:00Added an answer on June 15, 2026 at 10:10 am

    This Error means the JSON Object that you have created to send for verification is not in correct format.

    {
        "receipt-data" : "(receipt bytes here)"
    }
    

    So My suggestion is to Debug the same on iPhone 4/iOS 4. In case, you are Using Json Framework to create JSON object (for receipt validation) it will work only with iOS 5.0 & above.

    Adding Code I had Implemented a few months I Used SBJson to write N parse.

    NSString *base64TxReceiptStr=[NSData Base64Encode:transaction.transactionReceipt];
    
    SBJsonWriter *writer = [[SBJsonWriter alloc] init];
    NSDictionary *command = [NSDictionary dictionaryWithObjectsAndKeys:
                             base64TxReceiptStr, @"receipt-data",
                             nil];
    NSString *jsonString = [writer stringWithObject:command];
    NSData *requestBody=[jsonString dataUsingEncoding:NSUTF8StringEncoding];
    NSMutableURLRequest *txReceiptVerificationRequest=[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://sandbox.itunes.apple.com/verifyReceipt"]];
    [txReceiptVerificationRequest setHTTPBody:requestBody];
    [txReceiptVerificationRequest setHTTPMethod:@"POST"];
    
    NSURLResponse *response=nil;
    NSError *error=nil;
    NSData *responseData=[NSURLConnection sendSynchronousRequest:txReceiptVerificationRequest returningResponse:&response error:&error];
    NSString * receivedString=[[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    
    
    SBJsonParser *parser = [[SBJsonParser alloc] init];
    NSDictionary *aobject =[parser objectWithString:receivedString];`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This works on the iPhone BTW (Both running iOS 5.1) My app freezes when
I have an iPhone (iOS) app that keeps data in a local SQLite database
1) Is it possible for an iPhone (iOS device) to automatically open an App
Apple ships an app named Contacts on every iOS device. On the iPhone and
I'm having this problem where I get this error on my iPhone: Terminating app
I'm trying to create an iOS (iPhone specific) app where users have to authenticate
Possible Duplicate: Parsing XML data to NSMutableArray iOS - iPhone <ForecastResult> <Forecast> <Date>2012-06-27T00:00:00</Date> <WeatherID>4</WeatherID>
Im having a problem opening the settings preferences in my IOS iphone app. At
I have this jailbroken iPhone 3G with iOS version 4.2.1 (the latest supported version).
I'm using AFJSONRequestOperation in an iPhone app (targeting iOS 5) - basically making a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.