In my app I have enabled adding features to a hosted feature service by following the examples of the sample apps "Add and edit features" and "Local geodatabase editing". Based on the example of "Add and edit features" if I edit the service directly using GeodatabaseFeatureServiceTable::addFeature passing in the feature JSON I create for the feature to be added, it works. The result is the OBJECTID of the new feature.
However, if I create an offline geodatabase of the same feature service as in "Local geodatabase editing" and add a feature to it using GeodatabaseFeatureTable::addFeature passing in the same feature JSON, it fails. The result is always -1.
What am I doing wrong?
Thanks.