We are trying to build a simple follow feature for our IOS app. We have two API's our Brand API
with an array of objects containing unique brand ids for our brands within each object. And our Firebase API
where we store users. Within the Firebase API
it has a key called followingBrands with and array of objects called composed of the unique brand ids from our
Brand API` as keys with the value true. The objects are created once a user has followed the brand from liking the brand on our app.
When the app loads we check to see if Firebase API
's brand ids keys matches the Brand API
's brand ID then show a star to indicate the user is already following the brand.
Our problem is Brand API
is implemented with pagination, (i.e. offset), so how will we verify all brands they are following if not all the unique brand ids will be available to compare with our Firebase API
?
We use swift on the IOS side. And the Brand API
is built using django-tastypie
Firebase API
"user_id" : {
"currentFollowingCount" : 0,
"displayName" : "",
"email" : "",
"followingBrands" : {
"unique_brand_id" : true
},
"provider" : "Facebook",
"userID" : "user_id"
}
Brand API
{
"labels": [
{
"id": "unique_brand_id"
}
],
"meta": {
"limit": 10,
"next": "/api/?limit=10&offset=10",
"offset": 0,
"previous": null,
"total_count": 33
}
}