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

IAP finish transaction functionality #21

Closed
haligalaph opened this Issue Jul 21, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@haligalaph

haligalaph commented Jul 21, 2017

There is no analogue of finishTransaction method from StoreKit in iap plugin.
So if I need to send information about purchased inapp to my server and something goes wrong, inapp will be lost forever. Because finishTransaction method already has been called inside plugin.

@yinjimmy

This comment has been minimized.

Show comment
Hide comment
@yinjimmy

yinjimmy Jul 28, 2017

En, you can store the information in location, then send them to your server?

But why inapp will be lost when finish the transaction?

yinjimmy commented Jul 28, 2017

En, you can store the information in location, then send them to your server?

But why inapp will be lost when finish the transaction?

@haligalaph

This comment has been minimized.

Show comment
Hide comment
@haligalaph

haligalaph Jul 28, 2017

My app won't be notified about finished transaction any after. Yes, of course, I can store information about transactions by myself, but Apple has already implemented this functionality. So why should I rewrite it?

haligalaph commented Jul 28, 2017

My app won't be notified about finished transaction any after. Yes, of course, I can store information about transactions by myself, but Apple has already implemented this functionality. So why should I rewrite it?

@darkdukey

This comment has been minimized.

Show comment
Hide comment
@darkdukey

darkdukey Jul 28, 2017

Contributor

Yes, the main concern when we design the IAP api is to make it easy to use, that's why we hide a lot of steps from the average user.

If you want a really safe implementation, I would suggest that save all the user info on your server, and after IAP success, you'll get a receipt, once you verify the receipt, you can update user's coin/gem, item on the server, then sync the account from your server to client.

Contributor

darkdukey commented Jul 28, 2017

Yes, the main concern when we design the IAP api is to make it easy to use, that's why we hide a lot of steps from the average user.

If you want a really safe implementation, I would suggest that save all the user info on your server, and after IAP success, you'll get a receipt, once you verify the receipt, you can update user's coin/gem, item on the server, then sync the account from your server to client.

@haligalaph

This comment has been minimized.

Show comment
Hide comment
@haligalaph

haligalaph Jul 28, 2017

Yes, all user info is stored on server. Once I get notification about success IAP, I will send message to the server. So user's coins will be updated on server side. But if server doesn't receive this message for some reason, IAP will be lost. Transaction has been finished, and client won't get notification about it again. If I could manually call finishTransaction, I would call it only after getting responce from server, that user's balance has been updated.

haligalaph commented Jul 28, 2017

Yes, all user info is stored on server. Once I get notification about success IAP, I will send message to the server. So user's coins will be updated on server side. But if server doesn't receive this message for some reason, IAP will be lost. Transaction has been finished, and client won't get notification about it again. If I could manually call finishTransaction, I would call it only after getting responce from server, that user's balance has been updated.

@haligalaph

This comment has been minimized.

Show comment
Hide comment
@haligalaph

haligalaph Jul 28, 2017

Simplicity of using sdkbox is one of its big benefits. But for correct implementation of IAP in client-server schema, finishTransaction is definitely needed.

haligalaph commented Jul 28, 2017

Simplicity of using sdkbox is one of its big benefits. But for correct implementation of IAP in client-server schema, finishTransaction is definitely needed.

@darkdukey

This comment has been minimized.

Show comment
Hide comment
@darkdukey

darkdukey Jul 28, 2017

Contributor

Yes, I agree with this, maybe we can add an option setAutoFinishTransaction(false) if that flag is set then developer will have to call finishTransaction themselves.

Contributor

darkdukey commented Jul 28, 2017

Yes, I agree with this, maybe we can add an option setAutoFinishTransaction(false) if that flag is set then developer will have to call finishTransaction themselves.

@haligalaph

This comment has been minimized.

Show comment
Hide comment
@haligalaph

haligalaph Jul 31, 2017

It would be great.

haligalaph commented Jul 31, 2017

It would be great.

@yinjimmy

This comment has been minimized.

Show comment
Hide comment
@yinjimmy

yinjimmy commented Sep 28, 2017

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