I am attempting to sync my offline geodatabase of a Feature Layer for the first time using these steps
Sync offline edits—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
I have made sure my changes are in my offline .geodatabase file on my machine, but after I sync my changes they don't appear to be syncing. My feature layer has 3 layers in it. When I set the geodatabase to sync, do I need to specify the layers to sync or something? Shouldn't it sync everything in the feature service. The changes don't seem to be uploading?
SyncGeodatabaseParameters <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> syncParameters
<SPAN class="comment token">// only sync the 1 layer</SPAN>
layerOptions<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>
SyncLayerOption <SPAN class="punctuation token">{</SPAN>
layerId<SPAN class="punctuation token">:</SPAN> app<SPAN class="punctuation token">.</SPAN>layerId <SPAN class="comment token">//My feature service with 3 layers, shouldn't it sync everything.</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token">// push up edits</SPAN>
geodatabaseSyncDirection<SPAN class="punctuation token">:</SPAN> Enums<SPAN class="punctuation token">.</SPAN>SyncDirectionUpload
<SPAN class="punctuation token">}</SPAN>
GeodatabaseSyncTask <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> geodatabaseSyncTask
url<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"myURL/FeatureServer"</SPAN>
property <SPAN class="keyword token">var</SPAN> generateJob
property <SPAN class="keyword token">var</SPAN> syncJob
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">executeSync</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// execute the asynchronous task and obtain the job</SPAN>
<SPAN class="comment token">//syncOverrideGDB is not null and is the feature service with 3 layers</SPAN>
syncJob <SPAN class="operator token">=</SPAN> <SPAN class="token function">syncGeodatabase</SPAN><SPAN class="punctuation token">(</SPAN>syncParameters<SPAN class="punctuation token">,</SPAN> syncOverrideGDB<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// check if the job is valid</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>syncJob<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// show the sync window</SPAN>
syncWindow<SPAN class="punctuation token">.</SPAN>visible <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// connect to the job's status changed signal to know once it is done</SPAN>
syncJob<SPAN class="punctuation token">.</SPAN>jobStatusChanged<SPAN class="punctuation token">.</SPAN><SPAN class="token function">connect</SPAN><SPAN class="punctuation token">(</SPAN>updateSyncJobStatus<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// start the job</SPAN>
syncJob<SPAN class="punctuation token">.</SPAN><SPAN class="token function">start</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// a valid job was not obtained, so show an error</SPAN>
syncWindow<SPAN class="punctuation token">.</SPAN>visible <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Sync failed"</SPAN><SPAN class="punctuation token">;</SPAN>
syncWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hideWindow</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">5000</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">updateSyncJobStatus</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">switch</SPAN><SPAN class="punctuation token">(</SPAN>syncJob<SPAN class="punctuation token">.</SPAN>jobStatus<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">case</SPAN> Enums<SPAN class="punctuation token">.</SPAN>JobStatusFailed<SPAN class="punctuation token">:</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Sync failed"</SPAN><SPAN class="punctuation token">;</SPAN>
syncWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hideWindow</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">5000</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> Enums<SPAN class="punctuation token">.</SPAN>JobStatusNotStarted<SPAN class="punctuation token">:</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Job not started"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> Enums<SPAN class="punctuation token">.</SPAN>JobStatusPaused<SPAN class="punctuation token">:</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Job paused"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> Enums<SPAN class="punctuation token">.</SPAN>JobStatusStarted<SPAN class="punctuation token">:</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"In progress..."</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> Enums<SPAN class="punctuation token">.</SPAN>JobStatusSucceeded<SPAN class="punctuation token">:</SPAN>
statusText <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Complete"</SPAN><SPAN class="punctuation token">;</SPAN>
syncWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hideWindow</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">1500</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">default</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>