मैं कम से महान ट्यूटोरियल का पालन करने का पालन किया है: http://blog.blundell-apps.com/simple-inapp-billing-payment/Billingservice एंड्रॉयड - हस्ताक्षर नहीं
मैं फिर से सब कुछ ट्यूटोरियल का कहना है किया है और 3 बार सब कुछ पढ़ा है, लेकिन अभी भी मैं onReceive() : BillingReceiver.java
में intent.getStringExtra(INAPP_SIGNATURE)
में एक हस्ताक्षर प्राप्त नहीं कर रहा हूँ
जो मेरा ऐप क्रैश करता है क्योंकि ऐप हस्ताक्षर की तुलना नहीं कर सकता है यह सत्यापित करने के लिए कि खरीदारी सही तरीके से की जाती है या नहीं।
public class BillingReceiver extends BroadcastReceiver {
private static final String TAG = "BillingService";
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.i(TAG, "Received action: " + action);
if (ACTION_PURCHASE_STATE_CHANGED.equals(action)) {
String signedData = intent.getStringExtra(INAPP_SIGNED_DATA);
String signature = intent.getStringExtra(INAPP_SIGNATURE);
Log.e(TAG, "<!-- SIGNATURE : "+ intent.getExtras().getString("inapp_signature"));
Log.i(TAG, "<!-- SIGNATURE : "+intent.getStringExtra(INAPP_SIGNATURE));
purchaseStateChanged(context, signedData, signature);
} else if (ACTION_NOTIFY.equals(action)) {
String notifyId = intent.getStringExtra(NOTIFICATION_ID);
notify(context, notifyId);
} else if (ACTION_RESPONSE_CODE.equals(action)) {
long requestId = intent.getLongExtra(INAPP_REQUEST_ID, -1);
int responseCodeIndex = intent.getIntExtra(INAPP_RESPONSE_CODE, C.ResponseCode.RESULT_ERROR.ordinal());
checkResponseCode(context, requestId, responseCodeIndex);
} else {
Log.e(TAG, "unexpected action: " + action);
}
}
private void purchaseStateChanged(Context context, String signedData, String signature) {
Log.i(TAG, "purchaseStateChanged got signedData: " + signedData);
Log.i(TAG, "purchaseStateChanged got signature: " + signature);
BillingHelper.verifyPurchase(signedData, signature);
}
private void notify(Context context, String notifyId) {
Log.i(TAG, "notify got id: " + notifyId);
String[] notifyIds = {notifyId};
BillingHelper.getPurchaseInformation(notifyIds);
}
private void checkResponseCode(Context context, long requestId, int responseCodeIndex) {
Log.i(TAG, "checkResponseCode got requestId: " + requestId);
Log.i(TAG, "checkResponseCode got responseCode: " + C.ResponseCode.valueOf(responseCodeIndex));
}
}
मुझे एक ही समस्या का सामना करना पड़ रहा है। किसी भी मदद की सराहना की। –