You can find more details on Pull and Pull module handling and operation in a corresponding
section
Push notifications are small pop-up windows that appear on screens of mobile phones and desktops, informing on important events and updates.
Learn more...
of Bitrix24 Self-hosted For Advanced Users learning course.
Mode of operation
Push & Pull module operates in two modes:
continuous connection to a special Queue server;
in server polling mode (60-20-10).
First mode is recommended, you'll get a significant degree of interactivity, but you will have to configure the Queue server or use a complete preconfigured Bitrix Virtual Appliance.
Second mode is used when first mode is unavailable. In this case, the module will query the server each 60 seconds and check, if data is available. When data is available, a hit occurs each 10 seconds. In case of no available data, a hit initially occurs after 20 seconds and then after each 60 seconds.
In both cases (queue server or server polling), module handling remains the same (except for a main channel).
Note: be advised that establishing connection with Push and Pull server requires ports 8893-8895 to be opened, they are necessary for push and pull server operation. If a situation with failed connection persists, provide SSH access to the server.
The API is split to PHP and JS portions. Principles for managing it are presented below.
PHP and JS
Connect the module to start the operation:
if (!CModule::IncludeModule('pull'))
return false;
and register dependency to the PULL module. Register dependency handler:
We subscribe to the command retrieval event (onPullEvent), and get module_id, command, params in the function; these parameters were specified when sending the command from PHP.
Example of component that handles the most complex subscription method BX.PULL.extendWatch.