Issue with permissions and HashMap on Android

hi there,
I have an app on iOS and currently beta testing on Android. I am using backendless for a series of common operations (creating users, data objects, updating such entities, etc.). I have also implemented certain mechanisms using permissions and ACL to ensure the app is secure.

On Android I’m having issues with granting permissions to specific users. In particular, I have a routine in which I upload an object (create) or update an object, such object is an HashMap as the mapping to class was not working for me. Right now I am looking at the update routine, so I first fetch the HashMap representing my object using BackendlessDataQuery, and Backendless.Persistence.of( “MyClassOnBackendless” ).find(dataQuery, new AsyncCallback<BackendlessCollection<Map>>() - once I updated the fields in this HashMap, I push it online again with Backendless.Persistence.of( “MyClassOnBackendless” ).save( summaryToStore, new AsyncCallback<Map>(), and everything works correctly, so obviously the HashMap includes all the information it needs to include.

However, when I call DataPermission.FIND.grantForUser(object_id_of_the_user, my_hash_map, grantForUserResponder); it doesnt work. In particular, I get “Object id is null 8011”, which doesnt make much sense as the object my_hash_map can be updated using the save function shown above, and I also checked that it contains an objectId and it does, so it is not null (same for object_id_of_the_user, which is a String of the correct objectId for the user to whom I want to grant permission).

Any ideas? The same exact logic in terms of sequence of operations, creating/updating objects and granting permissions works fine on iOS, where however there are no hashmaps, which I think might be the problem here.

The way I retrieve the HashMap is public void handleResponse( BackendlessCollection<Map> myHashMap ) and then I do List<Map> curr_page = (List<Map>) myHashMap.getCurrentPage() and finally I loop over it and get the object as HashMap my_hash_map = (HashMap) myHashMap.getCurrentPage().get(i);

Thank you for your help.

Marco

I have created an internal ticket for this issue (BKNDLSS-13993)

hi guys, any news on this? Thanks

Hi Marco

This issue has been fixed but the fix is not released yet.
It will be released tomorrow, but you can go ahead and use not released library which can be download here :
https://github.com/Backendless/Android-SDK/tree/master/out

Great news, thanks. Will try this out and let you know if I have issues.

Sorry Vitaly, I need to update my gradle file as I include backendless that way, I assume I need to wait until tomorrow (no problem), what version is this though? Thanks!

Hi Marco
We’ve just deployed the new version of Android-SDK to the maven repository (version 3.0.25).
It’ll appear as soon as maven approve it. It can take some time.
Stay tuned.
Regards Ilya

confirming that the issue has been fixed and everything works as expected. Thanks!