Skip to content

Commit

Permalink
purchuase
Browse files Browse the repository at this point in the history
  • Loading branch information
hussienalrubaye committed Nov 20, 2016
1 parent c283d02 commit 50c22ea
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions in app purchase.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@

//3- got o AndroidSDK/extra/google/play_billing/sample
// copy all files in util folder to your app util folder
// add aidl file to your project with name IInAppBillingService.aidl
//chnage apk name of head all files
// add aidl folder and copy it content from other project


//4- add product in your play console

//5- add this code to your activity

//***************************Payment***************************
private static final String TAG =
"com.alrubaye.familyfinder";
private static final String TAG ="Your_packge_ID";
// test ITEM_SKU android.test.purchased
// test token mypurchasetoken
static final String ITEM_SKU = "com.alrubaye.addmembers";
static final String ITEM_SKU = "android.test.purchased";
IabHelper mHelper;

IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
Expand Down Expand Up @@ -58,10 +59,7 @@ public void onConsumeFinished(Purchase purchase,
IabResult result) {

if (result.isSuccess()) {
// clickButton.setEnabled(true);
GlobalClass.AdditionUsers=GlobalClass.AdditionUsers+1;
FileLoad fileLoad=new FileLoad(getApplicationContext());
fileLoad.SaveData();
// purchuase is done
} else {
// handle error
}
Expand All @@ -83,7 +81,7 @@ void PayItem(String ITEM_SKU){
//***************************************************************
// 7- in oncreate() add this code
//In app purchase
String base64EncodedPublicKey = "your_key"
String base64EncodedPublicKey = "your_API_key" ;

mHelper = new IabHelper(this, base64EncodedPublicKey);

Expand Down

0 comments on commit 50c22ea

Please sign in to comment.