Persistent storage / on-device storage for storing likes

Hi everyone,
I read all of the forum posts and watched all tutorials on device storage but I can’t seem to understand how I should implement it in my case.

  • I am showing a list of posts to the user of the app.
  • The user can like this or that post.
  • The first time the user opens the app, she obviously has not liked any post yet.
  • Between app launches I want to save which posts the user has liked.

I am unsure if I should use on-device storage or persistent storage. And in both cases (I have already tried) I don’t understand which data structure I should use. I thought I can use a list of post_ids and every time the user likes a post, store the post id in the list. But can’t seem to make this work.

Thank you so much!