iosswiftcore-datasimperium

Simperium and user groups


I've an app that needs to share data among users, but not all of them. The idea is that users can belong to different groups, like, for example, users of 2 different companies who are using my app. I'm evaluating Simperium, but before embedding its library in my iOS app I would like to understand if there is a way to isolate users to avoid reading data belonging to other groups. I don't know if that is possibile using different buckets and in that case; how do I create separate buckets?


Solution

  • The iOS SDK doesn't provide a sharing mechanism. Nevertheless, you could still use the REST API to do so.

    >>> curl -H 'X-Simperium-Token: { access_token }' \
        https://api.simperium.com/1/{ app_id }/{ bucket_name }/i/{ object id }/share/{ target username } -d '{"write_access": true}'
    

    Documentation can be found here.

    Other than that, it would be up to the Host App to implement any required user group management (perhaps a simple REST endpoint of your own, that returns the collection User ID's for the current user would do the trick).

    Hope that helps!