0

Context: I'm an early-stage Swift developer creating a third-party keyboard for iPhone. Already have the app created (via XCode) so the users can click buttons to insert text into FB Messenger, Text Message, etc. There is currently no information stored as to what the user previously clicked (e.g., application is completely fresh every time it's opened).

Problem: I want to create two categories in my keyboard:

1) Most popular (all)

2) Most popular (you)

As their names suggest, these categories would show the most popular buttons that all users of the app have used, as well as what you have used, most recently.

What I've tried: Already tried Googling and searching Stack Overflow for tutorials on databases, user profiles, etc., but it's been difficult to figure out whether those are applicable given I don't need (or want) users to have to sign in to use my app.

I understand that there may be many ways to solve my problem, so would be happy to go through tutorials are read up about specific types of databases or app architecture if someone can point me in the right direction.

Thanks so much!

vk2015
  • 1,118
  • 1
  • 12
  • 16

1 Answers1

0

A database does not [technically] have to require users to log in. Nearly every does because it usually costs money to maintain a database and they want to have some way of revoking access to users who attempt to hack it and consume all your bandwidth.

On iOS, CloudKit has a free database service. You're limited in how much data can be transferred each day, but your system could easily have no problem with that.

If you record the frequency of uses of buttons on your keyboard and, say each day, publish that on CloudKit while also downloading things published by others, you could do what you want.

You'll have a problem though with having lots of users because it'll start to consume your entire bandwidth allotment just downloading the current state, so you might want to instead have a fuzzy rolling window to get some representation of the frequency of button presses instead of an exact representation, but you can figure this out as you go along.

iAdjunct
  • 2,739
  • 1
  • 18
  • 27