Greetings everyone,
I've been trying to develop a custom app that interacts with the custom AGOL Feature Service I developed: https://services3.arcgis.com/epYSERo2s3KvpxDO/arcgis/rest/services/GeoLocate_v1/FeatureServer
The Feature Service is very simple - only has a Point layer with 2 text fields and the possibility to add attachments.
I create new features in my application and try to add an attachment locally.
When I sync with the Feature Service, all the data is synced EXCEPT the attachments.
When I try to manually add attachments in AGOL it works well in visualizing the attachments in-app, but I can't send attachments to the Feature Service.
Tried to add an API KEY but it didn't solve the problem.
Any assistance will be greatly appreciated.
Thanks,
Miguel
Solved! Go to Solution.
Hi ,
I was able to use your service and successfully add the attachment to feature and perform applyEdits using the below sample (modified to use ServiceGeodatabase.applyEdits() like in your example). Verified the applied attachment through arcgis online viewer.
https://github.com/Esri/arcgis-runtime-samples-android/tree/main/java/edit-feature-attachments
Do you see any errors from the applyEdits result or while adding the attachments or updating the feature? You can make those calls within try catch block and catch any exceptions.
Thanks
Rama
Hi ,
I was able to use your service and successfully add the attachment to feature and perform applyEdits using the below sample (modified to use ServiceGeodatabase.applyEdits() like in your example). Verified the applied attachment through arcgis online viewer.
https://github.com/Esri/arcgis-runtime-samples-android/tree/main/java/edit-feature-attachments
Do you see any errors from the applyEdits result or while adding the attachments or updating the feature? You can make those calls within try catch block and catch any exceptions.
Thanks
Rama
Greetings,
I'm sorry for the delay. I actually managed to get it to work using that same sample.
I noticed I wasn't properly adding the attachments to the features - that was the error.
Furthermore, that same example is of editing attachments in EXISTING features.
For future reference, here's what happened.
To make it work, for some reason, I couldn't add a feature WITH attachments. I needed to:
(1) Add a feature
(2) Query the feature service for that feature (because to add attachments I needed an ArcGISFeature, a simple Feature couldn't be used to add attachments)
(3) Edit that ArcGISFeature's attachments and add the picture.
Thank you