Client self-connect Apple server to verify purchase completed receipt returned

Source: Internet
Author: User


    Write your test code here Nserror *error = nil;                                       Nsdictionary *requestcontents = @{@ "Receipt-data": [Receipt base64encodedstringwithoptions:0]        @ "Password": @ "29596c75453d49d4a8a46b7e89fff625"};    NSData *requestdata = [nsjsonserialization datawithjsonobject:requestcontents options:0 error:&error]; Nsurl *storeurl = [Nsurl urlwithstring:@ "Https://buy.itunes.apple.com/verifyReceipt"]; #ifdef DEBUG storeurl = [Nsurl UR lwithstring:@ "Https://sandbox.itunes.apple.com/verifyReceipt"]; #endif nsmutableurlrequest *storerequest = [    Nsmutableurlrequest Requestwithurl:storeurl];    [Storerequest sethttpmethod:@ "POST"];    [Storerequest Sethttpbody:requestdata];    NSData * data1 =[nsurlconnection sendsynchronousrequest:storerequest returningresponse:nil error:&error]; nsdictionary* Json1 = [nsjsonserialization jsonobjectwithdata:data1 options:nsjsonreadingmutableleaves error:&    ERROR]; NSLog (@ "%@", Json1);


Client self-connect Apple server to verify purchase completed receipt returned

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.