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 7973369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:04:53+00:00 2026-06-04T08:04:53+00:00

I hope someone can help me. I need to notify user after he successfully

  • 0

I hope someone can help me. I need to notify user after he successfully purchased an item via in-app billing service. […deleted confusing text…]

EDIT

TO be precise. From the demo Google project, I see that they use onRequestPurchaseResponse to catch RESULT_OK code. Inside of that method, I added the Toast and initiated the test purchase via android.test.purchased item. I got the Market’s windows and message “Authorizing purchase”. After the process completed, my Toast appeared.

@Override
public void onRequestPurchaseResponse(BillingService.RequestPurchase request,
                             Consts.ResponseCode responseCode) {
    if (Consts.DEBUG) {
        Log.d(TAG, request.mProductId + ": " + responseCode);
    }
    if (responseCode == Consts.ResponseCode.RESULT_OK) {
        if (Consts.DEBUG) {
            Log.i(TAG, "purchase was successfully sent to server");
        }
        showToast("purchase was successfully sent to server");//<- MY TOAST!
        logProductActivity(request.mProductId, "sending purchase request");
    } else if (responseCode == Consts.ResponseCode.RESULT_USER_CANCELED) {
        if (Consts.DEBUG) {
            Log.i(TAG, "user canceled purchase");
        }
        logProductActivity(request.mProductId, "dismissed purchase dialog");
    } else {
        if (Consts.DEBUG) {
            Log.i(TAG, "purchase failed");
        }
        logProductActivity(request.mProductId, "request purchase returned " + responseCode);
    }
}

My question is, is this the right place to place the message on successful purchase?

  • 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-04T08:04:54+00:00Added an answer on June 4, 2026 at 8:04 am

    It’s fine to put a message there, but that is not where the purchase gets completed. As you can see in the comments, it says that the purchase was successfully sent to the server. It does not mean that the purchase actually went through. This is called BEFORE your app is taken to Google Play to give the user the option to make the purchase. The user can still back out. If, however, the user presses BUY, the app restarts and the following code gets called.

    @Override
    public void onPurchaseStateChange(PurchaseState purchaseState, String itemId, int quantity, long purchaseTime, String developerPayload) {
    
        if (purchaseState == PurchaseState.PURCHASED) {
            // PUT YOUR CONFIRMATION MESSAGE HERE
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi Hope someone can help me. My .net app that connects (via tcp) to
I need to do a non greedy match and hope someone can help me.
I am stuck and in need of a hand. Hope someone can help? Anyone
I hope someone can help with the following. I'm trying to create a user-specific
I hope someone can help with this. I have created a map app that
I need some help and hope someone can help me with this issue: hturl
I hope someone can help me with a PivotControl issue. In my app there's
I hope someone can help me with the following: I need to know if
Hello I hope someone can help me. I need to know how to write
I really hope someone can help me along with this one... I need to

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.