I am trying to refactor an app here that has some problems with going offline using defaultGenerateGeodatabaseParameters, and I was asked by the our Python team to alter the request somewhat.
I managed to change it to match except for one thing, replicaOptions, which I need to remove.
Solved! Go to Solution.
Hello and thank you for your question. If you look at the REST API you reference, there's the following "replicaOptions":
//(bit 0): Includes annotation features
{"syncDataOptions": 1}
//(bit 1): Includes dimension feature layers
{"syncDataOptions": 2}
//(bit 2): Includes contingent values
{"syncDataOptions": 4}
For ease-of-use, these options are called out explicitly as properties in the GenerateGeodatabaseParameters object:
@property (nonatomic, assign, readwrite) BOOL shouldSyncDimensions;
@property (nonatomic, assign, readwrite) BOOL shouldSyncContingentValues;
@property (nonatomic, assign, readwrite) BOOL shouldSyncAnnotations;
The default value for those there properties are `YES`. From your post,'replicaOptions': '{ "syncDataOptions": 5 }' indicates that `shouldSyncAnnotations` and `shouldSyncContingentValues` are set to `YES`, as the "5" is the bitwise-Or of those two properties (as specified in the REST API)
Setting those values to "NO" should give you the result you want.
If you still encounter problems, please let us know. Also, what specific problems are you encountering.
Thank you!
Mark
Hello and thank you for your question. If you look at the REST API you reference, there's the following "replicaOptions":
//(bit 0): Includes annotation features
{"syncDataOptions": 1}
//(bit 1): Includes dimension feature layers
{"syncDataOptions": 2}
//(bit 2): Includes contingent values
{"syncDataOptions": 4}
For ease-of-use, these options are called out explicitly as properties in the GenerateGeodatabaseParameters object:
@property (nonatomic, assign, readwrite) BOOL shouldSyncDimensions;
@property (nonatomic, assign, readwrite) BOOL shouldSyncContingentValues;
@property (nonatomic, assign, readwrite) BOOL shouldSyncAnnotations;
The default value for those there properties are `YES`. From your post,'replicaOptions': '{ "syncDataOptions": 5 }' indicates that `shouldSyncAnnotations` and `shouldSyncContingentValues` are set to `YES`, as the "5" is the bitwise-Or of those two properties (as specified in the REST API)
Setting those values to "NO" should give you the result you want.
If you still encounter problems, please let us know. Also, what specific problems are you encountering.
Thank you!
Mark
Aaha! Thanks for the explaination. I did not look at it from that direction at all, note taken 🙂 I was searching the documentation site of the Runtime for iOS and it had no mention of replicaOptions or syncDataOptions and I did not make that connection to the should-parameters. Running a test now to see if it helps my issue.
According to my guys here they should help with performance when creating offline databases. Im basically trying to match the performance given to me by the Phython team, they asked me to adjust my request.
It worked, thanks!
I have one question though. In the REST specification there is a property "replicaName" I would like to use. Again I can't seem to find the corresponding setting in the Runtime SDK. Do you know where I set this value?
The "replicaName" property is not currently supported by Runtime. What is your use case for using the replica name?
Apparently the backend team says normally the replicas should be listed using an URL, url/FeatureServer/replicas.. but for some reason my replicas are not. Difference in POST request now is the replicaName is missing from what I am sending and they wanted me to test this in case that was the cause.
Where is the list of replicas being retrieved from?
The "Geodatabase" has a "syncID" property, which the doc states is the same as the replica ID described in the REST documentation. This is used by the service that created the geodatabase to uniquely identify it when carrying out sync operations. You can use this ID to uniquely identify the replicas.
I am unsure, I have to check over the holidays, but the way I understood it the backend guy wanted me to check since if they do it manually (with or without replicaname) via Python the replica gets listed in a list on the server - apparently, but those I make from the app with the SDK does not. Though it works fine though. Again, I'll check with them next week. Thanks for all the help so far!
No problem, glad to help! Let me know when you find out more information and I'll look into it on our end.
Have a good week!
Mark
Hi, the list was the list over replicas on the feature layer on the arcgis server. Apparently they guys told me the name really shouldn't matter in this case, but somehow replicas created my my calls using the iOS runtime don't appear on that list - even though they seem to work. The name not being set was the only apparently visible difference from their test, but they have since tested not giving their replicas name, and they still appear. Any ideas what could be the cause my replicas are not showing?