Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inAppPurchase.restoreCompletedTransactions does nothing #27819

Closed
3 tasks done
wolfoo2931 opened this issue Feb 19, 2021 · 5 comments
Closed
3 tasks done

inAppPurchase.restoreCompletedTransactions does nothing #27819

wolfoo2931 opened this issue Feb 19, 2021 · 5 comments

Comments

@wolfoo2931
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • v11.2.1
  • Operating System:
    • macOS 10.15.6
  • Last Known Working Electron version:
    • This has not been working for me before

Expected Behavior

When executinginAppPurchase.restoreCompletedTransactions() I expect the app to open a dialog and to ask the user for its app store credentials. I would also expect the inAppPurchase.on('transactions-updated' ...) transaction handler to be triggered so I receive the recipe.

Actual Behavior

Nothing happens after inAppPurchase.restoreCompletedTransactions() is executed.

To Reproduce

Just execute inAppPurchase.restoreCompletedTransactions() in the main process of an electron app (electron version v11.2.1).

Additional Information

The use case for this functionality is not only to restore already purchased products but also to redeem promo codes.

@ckerr ckerr added bug 🪲 platform/macOS blocked/need-repro Needs a test case to reproduce the bug labels Feb 24, 2021
@ckerr
Copy link
Member

ckerr commented Feb 24, 2021

Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

I'm adding the blocked/needs-repro label for this reason. After you make a test case, please link to it in a followup comment.

Thanks in advance! Your help is appreciated.

@ckerr ckerr added the 11-x-y label Feb 24, 2021
@electron-triage
Copy link

Thank you for your issue!

We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.

@ChrisChou-freeman
Copy link

Hi, did you resolve the problem? i have the same issue here, is this api broken? i'm using electron version 28.

@electron-issue-triage electron-issue-triage bot removed the blocked/need-repro Needs a test case to reproduce the bug label Apr 4, 2024
@wolfoo2931
Copy link
Author

Hi @ChrisChou-freeman,

this is a long time ago but as I remember I had a misunderstanding about how the API works.

I think:

  1. you have to put a button somewhere that says "restore"
  2. When the user clicks the "restore" button, you have to send an IPC message to the main process, the main process then executes inAppPurchase.restoreCompletedTransactions() when it receives the message from the render process.
  3. You then can wait for inAppPurchase.on("transactions-updated" () => ...) notifications. Especially for notifications where transaction.transactionState === "restored"

Best Regards,
Oliver
working on MonsterWriter

@ChrisChou-freeman
Copy link

Hi, sorry for take this long to response, didn't notice email before, yes this is how i implement it in my code, my problem is when i call inAppPurchase.restoreCompletedTransactions(), I didn't receive any "transactions-updated" event, it just does nothing. but when i test in testFlight environment call in-app-purchase api it can receive "transactions-updated" event normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants