Official Content

Group of events triggered at the start and end of the offline synchronization of application data. It allows you to run code before and after sending/receiving data from the application to the server. A particular distinction is made for synchronization to the multimedia file device. 

ModuleUbication_PNG DefExo_PNG

 

Properties

It does not have any.

Methods

It does not have any.

Events

These events are only taken into account when the application is automatically synchronized, where the process is asynchronous.

If synchronization is run manually (by means of the Synchronization.Receive() or Synchronization.Send() methods), the developer can make the appropriate checks directly at the event.

The only event that triggers both with manual and automatic synchronization is the Synchronization.ReceiveAfterFinish(), since the download of multimedia files is always performed asynchronously in a parallel process.

SendBeforeStart

Triggered when it starts synchronizing the multimedia data and table records content from the device to the server.

SendAfterFinish

Triggered after the device data has been synchronized with the server. 

ReceiveBeforeStart

Triggered when it starts synchronizing data from the server to the device.

ReceiveAfterSaveData

Triggered at the end of the synchronization of tables' records from the server to the device.

ReceiveAfterFinish

Triggered at the end of the synchronization of multimedia files from the server to the device. 

Example

The following example will be based on the Sales sample. Select the SalesOfflineDatabase object, and change the Data Receive Criteria property to Manual. 

Next, change the ClientStart event of the Sales Menu object to deploy a Progress external object and run the synchronization of the device and the server.

Sample code:

Event ClientStart
    Composite
        SaveDeviceId()
        GeneXus.Common.UI.Progress.ShowWithTitle('Downloading images...')
        &res = Synchronization.Receive()
    EndComposite
Endevent
Once the multimedia data has been synchronized with the device, the Progress external object will be hidden.
Event GeneXus.SD.Synchronization.Synchronization.ReceiveAfterFinish
        GeneXus.Common.UI.Progress.Hide()
EndEvent
SDRelativeTimerSam2_gif

Availability

This external object is available as of GeneXus 16 upgrade 4

Scope

Platforms Smart Devices (iOS)

See also

Offline Native Mobile Applications

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant