fix: Send purchase-updated instead of purchase-update. #2739
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During some testing of restoring purchases using the getAvailablePurchases method with the alsoPublishToEventListener argument set to true I noticed that the events were not being published correctly. I also noticed in the logs an error message saying that purchase-update was not a supported event.
I had a look at the code in RNIapIosSk2.swift and it appears that the event name should actually be purchase-updated.
I fixed this locally and the error no longer appears and the purchase is now being published to the event listener.
Creating this as a draft PR as I am not too sure if there is anything else I need to do, this is my first contribution to the project.