Differences in Arcgis Runtime SDK for iOS and calling REST directly

1203
11
Jump to solution
03-29-2023 05:24 AM
frankm
by
New Contributor III

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.

'replicaOptions': '{ "syncDataOptions": 5 }'
 
I find replicaOptions mentioned in the docs for the REST Api:
https://developers.arcgis.com/rest/services-reference/enterprise/create-replica.htm
 
However, no mention of it in https://developers.arcgis.com/ios/api-reference/

Does anyone know how I can turn it off - is is possible without calling REST directly?
0 Kudos
1 Solution

Accepted Solutions
MarkDostal
Esri Contributor

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

View solution in original post

11 Replies
MarkDostal
Esri Contributor

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

frankm
by
New Contributor III

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.

0 Kudos
frankm
by
New Contributor III

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?

0 Kudos
MarkDostal
Esri Contributor

The "replicaName" property is not currently supported by Runtime. What is your use case for using the replica name?

0 Kudos
frankm
by
New Contributor III

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.

0 Kudos
MarkDostal
Esri Contributor

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.

 

0 Kudos
frankm
by
New Contributor III

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!

0 Kudos
MarkDostal
Esri Contributor

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

0 Kudos
frankm
by
New Contributor III

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?

0 Kudos