1

In previous version of ArcGIS, the classAGSJSONRequestOperation had few methods to set target and actions. But in ArcGIS iOS runtime SDK v100.2 (latest version), there is no way to set the targets and actions.

Is it possible to use the AGSJSONRequestOperation class or any other replacements for this?

2 Answers 2

1

After few search, found the following solution

AGSCredential* cred = UserManager.credential;

AGSJSONRequestOperation * jsonOperation = [[AGSJSONRequestOperation alloc] initWithRemoteResource:nil URL:BMURL(URL) queryParameters:makeQueryParameters(body) method:method];

if (credential)
{
    [jsonOperation setCredential:cred];
}

[jsonOperation.requestConfiguration setTimeoutInterval:60];
[jsonOperation.requestConfiguration setUserHeaders:[GeoManager requestHeaders]];

[jsonOperation registerListener:@"l1" forCompletion:^(id  _Nullable result, NSError * _Nullable error) {

    if(error == nil)
    {
        [mngr operationSucceeded:mngr.requestOperation result:result];

    }
    else
    {
        [mngr operationFailed:mngr.requestOperation result:result];
    }

}];

[jsonOperation execute];
-1

I found another example, valid for the latest SDK versions (tested with 100.11). The idea is basically the same, but it has some more details about the parameters.

Also, it is in Swift.

Here you have it: https://gist.github.com/nixta/9db8be083b1823f1cbbe87db5cef6325

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.