M
M
Maxim Ovcharik2015-07-06 07:57:47
Classmates
Maxim Ovcharik, 2015-07-06 07:57:47

How can I handle the closing of HAPI.UI.show* modals?

With API_callback, everything is clear, but it only sends notifications for confirming or canceling an action, with the modal closing with a cross on the top right, nothing is transferred to the callback.
And a second, somewhat related question: is there a limit to how often these modals are raised? Because sometimes they don't open.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Ovcharik, 2015-09-21
@movl

I will describe, in general, how I overcame the problems I described with the Odnoklassniki API, it will suddenly help someone. The solution is somewhat dubious, but they helped me increase the responsiveness of the interface and allowed me to collect statistics correctly.
Cross:
By clicking on the button that calls the virtual machine, I broadcast the mousemove event on the window, I need to broadcast after a certain timeout, for me it is 500ms, because the window may not open immediately. Even if the window was opened, and then immediately closed, by clicking on an empty area, for example, the event will still be caught after the timeout has expired and it can be correctly processed. With payments in this regard, everything is a little more complicated, since the event about a successful transaction does not come there, when you click on the cross, despite the fact that it was completed, you had to check through the server here. There is still such a moment, while testing, the response events from the modal came guaranteed earlier than the mouse movement event, which actually made it possible to make such a crutch.
Raise modal frequency:
With frequent attempts to raise the modal, it happens that the window does not always open, which is impossible to catch. Empirically revealed that the maximum required timeout after the last closing (!) of the window API is 2500ms. As a result, I came to a solution where all calls turn into a queue, and in case of clicking on the button that pulls the API until the timeout has expired, I block the interface for the remaining timeout time, asking me to wait a bit, after which I actually call the API method.

V
Valery Ozhiganov, 2015-08-18
@vozhiganov

FAPI.UI.showPayment why is there no API_callback when closing the successful purchase dialog?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question