Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access most recently used emojis list in iOS

In iOS, in the native Emoji keyboard, you can see your most recently used Emojis. I would like to know if it is possible to get the data on those Emojis (which is app-independent) from inside my app.

My goal is to display the most used emoji, given a user, in my app.

like image 927
jood Avatar asked May 13 '16 04:05

jood


People also ask

How do I find most frequently used emojis on my Iphone?

Tap the emoji button and look to see what your most frequently used emoji is. It's the one at the tippy-top of the list (unless you're using an Android device, which will show your most recently used emoji, not your most frequently used emoji).

How can I see my frequently used emojis?

In the Google Chat emoji picker, your most frequently used emojis can be found under the new β€œFrequently Used” section.

How does Iphone decide the order of recent emojis?

Emoji are ordered in 2 ways, under different priorities. The emoji that you use the most will always appear at the top. Emoji that you have recently used will appear after emoji that are used frequently. If this order is unexpected, and you want to provide feedback, Apple would love to gather your feedback!


1 Answers

If you just want an Emoji selector you could use/modify libraries like SYEmojiPopover or AGEmojiKeyboard which allows you to have full control on the output without messing with the iOS internals (albeit the "recents" list will be app-specific).


On iOS 9 the preferences are stored in the com.apple.EmojiPreferences suite, which you could extract the list of most recently used emoji by:

// swift 3:
let prefs = UserDefaults(suiteName: "com.apple.EmojiPreferences")!
let defaults = prefs.dictionary(forKey: "EmojiDefaultsKey")!["EmojiRecentsDefaultsKey"]! as! [String: Any]
let recents = defaults["RecentsKey"]! as! [String]
print(recents)

// swift 2:
let prefs = NSUserDefaults(suiteName: "com.apple.EmojiPreferences")!
let recents = prefs.dictionaryForKey("EmojiDefaultsKey")!["EmojiRecentsDefaultsKey"]!["RecentsKey"]! as! [String]
print(recents)

// prints e.g. ["πŸ”", "🚳", "🚿", "βŒ›", "πŸ‘Ά", "πŸ‡ΏπŸ‡¦", "β›ͺ", "πŸš†", "πŸš…"]

Note that this is UNDOCUMENTED, and I have only checked it works on iOS 9 when deployed via Xcode. There is no guarantee that the App Store reviewers will allow this usage, nor there is any guarantee that it will work in the past or future versions.

like image 135
kennytm Avatar answered Oct 13 '22 22:10

kennytm