Message Reactions in Mobile App Chat

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Message Reactions in Mobile App Chat
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Message Reactions in Mobile Chat

Long-press on message → emoji picker → animated reaction under message. Seems simple, but production reveals details: two users react simultaneously — counter duplicates. Or picker overlaps keyboard. Or animation jumps because cell height recalculates without context.

How Data Is Organized

Table message_reactions: message_id, user_id, emoji (unicode symbol or short code), created_at, UNIQUE (message_id, user_id, emoji). Index on message_id — needed for fast fetching all reactions to message.

In API response message includes aggregated reactions:

"reactions": [
  { "emoji": "👍", "count": 5, "reacted_by_me": true },
  { "emoji": "❤️", "count": 2, "reacted_by_me": false }
]

Grouping SELECT emoji, COUNT(*), bool_or(user_id = $current_user_id) — executes fast with index on message_id. For huge reaction counts (thousands) — cache in Redis Hash with invalidation.

When adding/removing reaction, server broadcasts WebSocket event reaction.updated with message_id and updated reaction array to all conversation participants.

UI and Animations

Emoji Picker on Long Press

On iOS: UILongPressGestureRecognizer with minimumPressDuration = 0.35. On trigger — compute cell position in superview coordinates through convert(cell.frame, to: view), show custom UIView popup with quick-reactions (6-8 emoji) positioned above message. Haptic feedback through UIImpactFeedbackGenerator(style: .medium).impactOccurred().

In SwiftUI — .onLongPressGesture(minimumDuration: 0.35) + overlay with custom ReactionPickerView through ZStack.

On Android (Jetpack Compose): pointerInput(Unit) { detectTapGestures(onLongPress = {...}) } — show Popup with Row of quick-reactions.

Full emoji-picker (if needed) — emoji-picker-react library for Flutter Web, EmojiPicker for Android (library emoji-picker-android), custom UICollectionView by categories for iOS.

Displaying Reactions Under Message

Horizontal flow row of pills: [emoji + count]. On iOS: UICollectionView with custom UICollectionViewFlowLayout with line wrapping (estimatedItemSize = UICollectionViewFlowLayout.automaticSize). Or simpler — UIStackView with isLayoutMarginsRelativeArrangement and manual wrapping.

In Compose: FlowRow from accompanist-flowlayout (or native FlowRow from Compose Foundation 1.5+) — more convenient.

Critical moment: adding new reaction may increase cell height (new row added). Without proper animation, list jerks. In UIKit — performBatchUpdates with reloadItems(at:) + UIView.animate. In Compose — animateContentSize() on reaction container.

Add Animation

New reaction: icon "appears" with scale 0.3 → 1.2 → 1.0 + opacity 0 → 1. In UIKit — CASpringAnimation on transform.scale. In Compose — animate*AsState or AnimatedVisibility with custom EnterTransition.

Counter increment: number "scrolls" up (old goes up, new appears down). UIKit — CATransition(type: .push, subtype: .fromTop) on UILabel. Compose — AnimatedContent with slideInVertically + slideOutVertically.

List of Reactors

Tap on reaction pill → bottom sheet with user list. iOS: UISheetPresentationController (iOS 15+) with detents: [.medium()]. Android: ModalBottomSheet in Material3. Data: GET /messages/{id}/reactions?emoji=👍 → array {user_id, display_name, avatar_url}.

Own Reaction

If reacted_by_me = true — pill is highlighted (accent border or background). Tap it — removes reaction (toggle). Optimistic update: change UI immediately, rollback on error.

Scope of Work

Reactions as separate feature — 1-3 days with ready chat. Includes: API endpoint (add/remove), WebSocket event, reactions UI component, picker, animations, list of reactors. Cost depends on platform (iOS, Android, or both) and existing WebSocket protocol in project.