国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
iAP二次(服務(wù)端/客戶端)驗(yàn)證

 iAP服務(wù)端驗(yàn)證,網(wǎng)絡(luò)上介紹的東西不多,找很很久才找到蘋果的官方文檔,記錄下來。

Verifying an App Receipt

Communication with the App Store is structured as JSONdictionaries, as defined in RFC 4627. To verify the receipt,perform the following steps:

 

  1. Retrieve the receipt data and base64 encode it (using the RFC 4648form of base64). Use the appStoreReceiptURL methodof NSBundle to locate theapp’s receipt, and then read the entire file.

    If the appStoreReceiptURL methodis not available, you can fall back to the value of atransaction's transactionReceipt property forbackward compatibility.

  2. Create a JSON object with a single key named receipt-data whosevalue is the base64-encoded receipt data. Your JSON object shouldlook like this:

    {
        "receipt-data" : "(receipt bytes here)"
    }
  3. Send the JSON object to the App Store using an HTTP POST request.The URL for the store is https://buy.itunes.apple.com/verifyReceipt.

  4. The response received from the App Store is a JSON object with thekeys status and receipt.(When validating an auto-renewable subscription, the responsecontains additional keys, as described in “Verifyingan Auto-Renewable Subscription Receipt”). Itshould look something like this:

    {
        "status" : 0,
        "receipt" : { (receipt here) }
    }

    If the value of the status keyis 0,this is a valid receipt. If the value is anything otherthan 0,this receipt is invalid.

The value of the receipt keyis a JSON object that contains the receipt’s fields. Forinformation about the fields in a receipt,see “ReceiptFields.”

沙盒測(cè)試的時(shí)候地址是:https://sandbox.itunes.apple.com/verifyReceipt 

 

下面這個(gè)差不多就是上面官方文檔的中文介紹版本: 

Verify an App Store Transaction Receipt【蘋果服務(wù)端驗(yàn)證一個(gè)應(yīng)用程序商店交易收據(jù)有效性】
http://blog.csdn.net/saindy5828/article/details/6414014

 同時(shí)還提供了JAVA版的代碼:

 

public int verifyReceipt( byte[] receipt){
      int status = -1;

       //This is the URL of the REST webservice in iTunes App Store
       URL url = new URL("
https://buy.itunes.apple.com/verifyReceipt");

       //make connection, use post mode
       HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
       connection.setRequestMethod("POST");
       connection.setDoOutput(true);
       connection.setAllowUserInteraction(false);

       //Encode the binary receipt data into Base 64
       //Here I'm using org.apache.commons.codec.binary.Base64 as anencoder, since commons-codec is already in Grails classpath
       Base64 encoder = new Base64();
       String encodedReceipt = newString(encoder.encode(receipt));

       //Create a JSON query object
       //Here I'm using Grails'org.codehaus.groovy.grails.web.json.JSONObject
       Map map = new HashMap();
       map.put("receipt-data", encodedReceipt);
       JSONObject jsonObject = new JSONObject(map);

       //Write the JSON query object to the connection output stream
       PrintStream ps = newPrintStream(connection.getOutputStream());
       ps.print(jsonObject.toString());
       ps.close();

       //Call the service
       BufferedReader br = new BufferedReader(newInputStreamReader(connection.getInputStream()));
       //Extract response
       String str;
       StringBuffer sb = new StringBuffer();
       while ((str = br.readLine()) != null) {
           sb.append(str);
           sb.append("/n");
       }
       br.close();
       String response = sb.toString();

       //Deserialize response
       JSONObject result = new JSONObject(response);
      status = result.getInt("status");
       if (status == 0) {
           //provide content
       } else {
           //signal error, throw an exception, do your stuff honey!
       }

       return status ;


   }

 

InAppPurchurse 驗(yàn)證訂單,這個(gè)提供了IOS客戶端和WEB PHP端的代碼:
http://hi.baidu.com/492437598/item/d8df142af5b8cfcbddf69a19

 

下面這個(gè)也類似,也有代碼

iPhone/iPad的IAP防破解之第三方服務(wù)器二次驗(yàn)證(附代碼)
http://www.anagyris.com/iphone_ipad_iap_anti_crack.html

 

http://www.360doc.com/content/12/0815/16/1440938_230331166.shtml

 

下面這個(gè)分析的比較詳細(xì)

iPhone In App Purchase購(gòu)買完成時(shí)驗(yàn)證transactionReceipt
http://www.cnblogs.com/eagley/archive/2011/06/15/2081577.html

============

客戶端驗(yàn)證

下面李華明的這個(gè)是在客戶端做驗(yàn)證:

【iOS-iap防護(hù)】驗(yàn)證用戶付費(fèi)收據(jù)!拒絕iap Cracker!! http://xiaominghimi.blog.51cto.com/2614927/829760

 

-----------------

APPSTORE 官方文檔

 

About In-App Purchase https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction.html

 

 

Receipt Validation Programming Guide
 https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Introduction.html#//apple_ref/doc/uid/TP40010573

 

1-1)Validating Receipts Locally
https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html#//apple_ref/doc/uid/TP40010573-CH1-SW2

 

 1-2)“Receipt Fields”
https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

 

2-1)Validating Receipts With the AppStore(使用這個(gè)哈)
https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

 

2-2)“Receipt Fields”
https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Verify an App Store Transaction Receipt 【蘋果服務(wù)端 驗(yàn)證一個(gè)應(yīng)用程序商店交易收據(jù)有效性】
PHP數(shù)組由sql行構(gòu)成json_encode
使用AQuery異步請(qǐng)求網(wǎng)絡(luò)
Java服務(wù)器端List對(duì)象轉(zhuǎn)換為JSON對(duì)象并返回客戶端實(shí)例
json_encode
PHP連接MySQL數(shù)據(jù)庫并以json格式輸出
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服