-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Add support for Amazon Appstore IAP #941
Comments
I saw there was a work in the past to support it, but it appears to be outdated and can't be used with the current react-native-iap library: It seems to be working in my own dev environment. But before I create a PR for it, it would be nice to get some real alpha/beta testers to review certain edge cases and get those polished properly as it's very possible I don't use all functionality in my own app. I tried to stay within the original react-native-iap API as possible. There are couple methods I don't do yet (I can add it if someone has a way to test properly). One of the breaking design decision in my fork is how to detect Google vs Amazon. I think detecting a device model/make is not a good approach because a user can install Google Play on a Kindle and get the app through Google (and vice versa when you can install Amazon Appstore on a Play-based device). We should get the IAP done through the correspondent API in this case. |
@nochkin Sounds really nice. I'd like to know the step to test out this. I don't have any |
I use a real Amazon device for testing purposes. I guess if you install Amazon Appstore on a non-Amazon device, that should do it. |
Here is the guide on how to add Amazon IAP support to the existing app: |
FYI, |
@hyochan Is there any plan to add this to a release? |
@curiousdustin, |
@nochkin does your fork include support for amazon subscription IAPs? |
@curiousdustin, Amazon does not bring that much traffic, so my testing in real life is kinda slow. If you could contribute in this aspect, that would be nice. |
Ok, I will likely be testing this out. I am currently using my own fork in production, but this was from before the major lifecycle related changes. I would really like to take advantage of all the great updates since then. |
Nice. I'm still in the process of implementing subscriptions for my own app (internal app-related logic, not the rn-iap), so let me know if anything. Amazon subscriptions API is kinda weird when being queried. For example, I have monthly and yearly subscription of the same service, but Amazon reports them identically. The only difference is the price, so I was thinking I'll figure out which one is which based on the price only. Do you have a lot of subscribed and new subscription users? |
Yes, the app I am using this for has hundreds of new subscriptions each month. Also any update that uses this will be thoroughly QA'd before release. We also have monthly and yearly options. As you described, they are both under a single ID for Amazon. In our case we are confirming the subscription via the Amazon API, which gives us information about the period. |
This sounds great. I'm glad my fork will have a proper testing in a different scenario. I need to show the period of subscription in the UI for the user to select. |
This may have changed, but we found that even if you present 2 options to the used, once they initiate the purchase flow, Amazon will display the period options with the first one preselected. So, we had to implement a new UI for amazon, where the user does not actually select the period, until they are in the Amazon purchase flow UI. |
Interesting idea actually. My UI won't fit this model, but I may consider this option if I decide to change it. I may still get to use it anyway. Thanks. |
@curiousdustin @nochkin |
I have not actually started implementing this fork yet in my project. Will likely be doing that next month. Sorry, I don't have much info on how the server side Amazon stuff works. A different person on my team handled the backend. I do know that currently we just hand off the product ID and the receipt ID to our server and it handles everything else as far as verifying and updating the subscription validity as needed. |
@kostiantyn-solianyk |
yea in test mode everything is ok with it, and with you fork actually too, working as needed(in the cases that I checked). We are stuck on the issue updating the subscription because amazon receipt doesn't have endDate of subscription, and it's actually weird. |
I'll see if I can re-prioritize my tasks so I can play with Amazon verifications on their subscriptions. |
@nochkin By the way, I noticed that methods |
You are right. My own app model does not use those. |
Similar to @kostiantyn-solianyk , I found that the following methods need to be implemented for Amazon:
|
@nochkin, Would you be able to describe how you are installing this fork in your app project? When I do something like this:
The module does not resolve because it is expecting the js built from typescript to be there, but the built version of the project does not exist on github. It only gets created for the module release package. In fact installing with npm and the line above, it doesn't even download the index.ts, because of the .npmignore file, I think. Does this make sense? |
Thanks a lot for the summary on the missing method implementations. I did not implement the "endConnection" because it was not needed, but I agree it needs to have the method for compatibility purposes. I installed locally, something like this: |
No worries! Ok, yeah I figured that local file reference would work, but doesn't make the project very portable. The workaround I am using right now to reference my own fork/branch is to define the dependency like this:
And in my branch I have changed the This works for now, I guess because my RN setup is automatically building TS based modules... |
Another important piece that appears to be missing is error handling. The Amazon implementation never runs any code to emit error events, such as this from the Google version: sendEvent(reactContext, "purchase-error", error); This means that the |
Noted. Good point. Thanks. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Bump! It would be great to have the amazon support in this plugin as well. I've been using the amazon's implementation made by @nochkin for auto-renewal subscriptions and the thing is quite reliable. It would be awesome to integrate this fork in the repo and have a larger base of contributors maintaining the implementation! Is there going to be any news on this later on or is the idea going to be dropped? |
I don't think it will be dropped. I believe the main stalling point is a few missing features (minor for my use-cases, but maybe major for someone's else). My own app is happy with the current state too. |
Yeah, I understand the situation, I'll be keeping an eye on this then! Thanks for the reply and I hope you get a little extra time for it 🤣 |
I pushed a PR (#1134 ) based on your great work @nochkin @curiousdustin ! 👏 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Resolved and now part of the 5.0.0 release: |
I think it would be nice to have support for Amazon Appstore IAP API.
The text was updated successfully, but these errors were encountered: