We're using ArcGIS SDK to develop a native mobile application. We have Enabled Attachments for the feature layer we published to ArcGIS Online. This is what we encounterd when trying to add an attachment using the
Is your app properly licensed for editing?
Sorry - I realize now you are editing directly against a feature service an not using an offline database.
Hi Michael,
Thanks for your reply. We are indeed trying to edit features (add attachment in this instance) in an offline database. We have synced the feature layer and are trying to upload a photo there. At this stage, our app is licensed for developers use only.
Just a guess, but maybe the feature you're trying to add the attachment to isn't "loaded". We actively prevent edits to features that aren't in the loaded state.
Can you try calling the "load()" method on the feature first, and after it finishes loading see if the addAttachment() call works.
We expect calling asynchronous methods like addAttachment() would internally first load the feature, but maybe it was missed in this particular case
Thanks for the suggestion, Divesh. We have given it a try but was still not able to luck out. addAttachment() still does not work after we have loaded the feature using the load() method.
Any other suggestions?
Hmmm, i can't think of any. We'll have to debug into your data to see what could be going wrong?
Can you share your .geodatabase file with us and provide some code that shows how you're trying to add an attachment to it