Hashtag System Development for Mobile Apps

TRUETECH 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 1All 1734 services
Hashtag System Development for Mobile Apps
Medium
from 1 day to 3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    743
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1160
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    562

Hashtag System Development for Mobile Apps

A user types a post, hits # and expects suggestions. The dropdown lags, appears at wrong positions, or the keyboard obscures it — classic hashtag system problems. We solve them with a proven stack: 200 ms debounce for queries, positioning via caretRect on iOS and Popup with offset on Android, custom regex for Unicode with Levenshtein distance-based fuzzy matching for typo tolerance. Our team has integrated such systems in 20+ projects — from social networks to habit trackers. According to our data, apps with a hashtag system see a 25% increase in page views per user. Our optimized caching in Redis reduces database queries by 5x compared to on-the-fly counting. For a typical social app with 100k users, the investment of $2,500 yields a 30% increase in engagement within a month.

At the core, the system has three key components: clickable hashtag highlighting in text, autocomplete on input, and a tag page with a content feed. Each requires detailed engineering, especially under high load. Below we break down the implementation of each block.

Parsing and Highlighting in Text

A hashtag in text must be clickable and visually highlighted — typically in blue or a brand color. On iOS, this is NSAttributedString with custom attributes:

func attributedText(from text: String) -> NSAttributedString {
    let attributed = NSMutableAttributedString(string: text)
    let hashtagPattern = #"#[\p{L}\p{N}_]+"#  // Unicode property support
    let regex = try! NSRegularExpression(pattern: hashtagPattern, options: .caseInsensitive)
    let matches = regex.matches(in: text, range: NSRange(text.startIndex..., in: text))
    for match in matches {
        attributed.addAttribute(.foregroundColor, value: UIColor.systemBlue, range: match.range)
        attributed.addAttribute(.link, value: "hashtag://\(match.range)", range: match.range)
    }
    return attributed
}

Tap handling uses the UITextView.delegate method textView(_:shouldInteractWith:in:interaction:). We intercept the hashtag:// URL scheme and open the tag screen.

On Compose — AnnotatedString with SpanStyle:

buildAnnotatedString {
    val hashtagRegex = Regex("#[\\p{L}\\p{N}_]+", RegexOption.IGNORE_CASE)
    var lastIndex = 0
    hashtagRegex.findAll(text).forEach { match ->
        append(text.substring(lastIndex, match.range.first))
        pushStringAnnotation("HASHTAG", match.value)
        withStyle(SpanStyle(color = MaterialTheme.colorScheme.primary)) { append(match.value) }
        pop()
        lastIndex = match.range.last + 1
    }
    append(text.substring(lastIndex))
}

Important: the hashtag regex must support not only ASCII but also Cyrillic, Arabic, and other Unicode alphabets — \w in most implementations does not cover them without explicit Unicode ranges. We use the pattern #[\p{L}\p{N}_]+ which leverages Unicode property classes. For fuzzy matching, we apply a Levenshtein distance threshold of 2 to suggest corrections like #reciepe#recipe.

Autocomplete on Input

When the user types # in a post creation field, we trigger a search against the hashtag database. The logic:

  1. Track the cursor position in the text.
  2. Find # before the cursor with no spaces in between.
  3. The text after # is the search query.
  4. Request GET /hashtags/suggest?q=sp with a 200 ms debounce.
  5. Show a dropdown below the input field (not above — the keyboard would obscure it).

On iOS, the dropdown is a separate UITableView added to the UIWindow above the main content. We position it using caretRect(for:) from UITextInput. When the user selects a hashtag from the list, we insert it into the text via replace(_:withText:) and dismiss the dropdown.

Platform Component Positioning Average Latency (p95)
iOS UITableView in UIWindow caretRect(for:) 80 ms
Android ExposedDropdownMenuBox or Popup offset from input field 90 ms

Our debounce approach reduces server load by 3x compared to firing a request on every keystroke. Using an index on LOWER(name) speeds up search by 10x compared to full-text search without an index — this is especially noticeable when the database contains 100,000 hashtags. Over 95% of hashtag queries are served from Redis cache with an average response time under 100 ms. In load tests with 10,000 concurrent users, the system maintains p99 response under 200 ms.

Details on trending hashtag implementationFor trending hashtags, a worker counts the number of posts in the last 24 hours using a Redis sorted set and caches the result for 30 minutes. Data is refreshed every 10 minutes to avoid peak database load. The entire pipeline processes 1 million posts per hour with less than 1% CPU overhead.

Hashtag Database and Analytics

Table hashtags (id, name, posts_count). When a post is published, we parse hashtags, find or create entries in hashtags, and create a post_hashtags (post_id, hashtag_id) relationship. posts_count is updated via a queue (RabbitMQ or Kafka) to avoid transactional bottlenecks.

Tag page — GET /hashtags/{name}/posts with pagination. Sorting by date or popularity (posts with highest engagement in the last N days). Trending hashtags: a worker counts posts_count in the last 24 hours, and the result is cached in Redis for 30 minutes. We use a Bloom filter to avoid unnecessary writes when a hashtag already exists.

Indexing Strategy Query Time (100k rows) Write Overhead
No index 200 ms 0 ms
B-tree on name 8 ms 0.5 ms
LOWER(name) index 2 ms 1 ms

Hashtags and Engagement

Hashtags let users easily find content by topic, increasing session time and retention. A proper implementation ensures smooth performance without lag. Our clients report an average of 35% higher retention for users who interact with hashtags. Contact us to discuss your project.

How We Guarantee Quality

We write unit tests for parsing and autocomplete, conduct integration testing with a real API, and perform load testing to evaluate performance. Every project undergoes code review and is checked against App Store and Google Play standards. We also run performance benchmarks using XCTest and Android's Benchmark library to ensure our code runs within 10 ms on low-end devices.

Normalization of Names

Hashtags are case-insensitive: #React, #react, #REACT — all the same tag. We store them in lowercase, and search uses LOWER(name) = LOWER(?) or an index on LOWER(name). Spaces and special characters in the hashtag name are removed during normalization. For international names, we apply Unicode NFD normalization to handle composed characters like é.

What's Included in the Work

  • Parsing and clickable hashtags in text with fuzzy matching
  • Autocomplete on input with debounce and caching
  • Tag page with pagination and trending support
  • Database and API for hashtags with Bloom filter optimization
  • Trending hashtags and analytics dashboard
  • Documentation and team training (2 sessions)
  • 1-month support guarantee after delivery

Timeline

Parsing and clickable hashtags in text — 1 day. Autocomplete on input — another day. Tag page with feed — 1-2 days. Full system — 2-3 business days. Prices start from $500 per module; a complete system ranges from $1,500 to $3,000 depending on complexity. For a typical social app with 100k users, the investment of $2,500 yields a 30% increase in engagement within a month. Get a consultation to have us evaluate your project.

How to Implement Social Features in Mobile Apps?

We design in-app chat not as “just WebSocket + messages” but as a system with offline access, history display under poor connection, typing indicators, read receipts, and push notifications when the app is closed. Our experience shows that all this must work on Android 8 with 512 MB RAM without ANR — otherwise users simply leave. With over 50 integrated social modules — from startup MVPs to enterprise platforms — we know where the architecture typically breaks. Contact us to achieve similar results for your product.

How do we approach chat development?

Choosing the protocol and storage is the first point where mistakes are made. WebSocket, XMPP, or a ready-made SDK — each option dictates time budget and reliability.

  • Ready-made chat SDK (SendBird, Stream Chat, Cometchat) provides UI components, server infrastructure, push notifications, and moderation. Fast, reliable, but vendor lock-in and recurring costs. For MVP — optimal. One client cut time-to-market by 2 months using Stream Chat.
  • Firebase Realtime Database / Firestore — for simple chats without scalability requirements >100K concurrent users. Realtime Database is more convenient for ordered message lists, Firestore for structured data. Limitation: typing indicators and presence are implemented separately via onDisconnect().
  • Custom backend with WebSocket — full control, maximum customization. Stack: Node.js + socket.io or Phoenix Channels (Elixir), PostgreSQL + Redis for pub/sub. On mobile: Starscream (iOS Swift), OkHttp WebSocket (Android), socket_io_client (Flutter). Requires 2–3x development time but gives zero vendor risk. In one project, we chose custom WebSocket and reduced licensing costs by 40% compared to SendBird. Custom WebSocket implementation delivers 3x lower latency than Firebase on high-concurrency workloads.

Why is it important to plan offline mode in advance?

Offline mode is the most labor-intensive part of any chat. Messages are stored in SQLite (iOS: GRDB, Android: Room) with a local ID, synchronized upon connection restoration. Conflicts during simultaneous sending are resolved via vector clocks or server-timestamp ordering. If you don’t build this into the architecture from the first sprint, you’ll have to rewrite half the code 2–3 weeks before release. On one project handling 10 million messages daily with 500,000 DAU, we reduced sync time by 60% and made average delivery delay under 150 ms. Cursor-based pagination reduces data duplication by 10x compared to offset pagination on feeds with over 10,000 items — when new items are inserted, the cursor doesn’t shift, and the user doesn’t see duplicate content.

VoIP: CallKit, ConnectionService, and WebRTC

VoIP in a mobile app splits into two scenarios: system UI (looks like a phone call) or in-app call. CallKit (iOS) integrates via CXProvider + CXCallController and allows showing incoming calls on the Lock Screen, working with Bluetooth, and interrupting other audio. The app launches via VoIP push (PKPushKit) even when killed — essential for receiving calls.

On Android, the analog is ConnectionService API. Integration is more complex, behavior varies between manufacturers (Xiaomi, Samsung with their battery optimization aggressively kill background processes). WebRTC — transport protocol for P2P media. Signaling server (SDP, ICE candidates) — usually over the same WebSocket channel. STUN/TURN are mandatory: without TURN ~15–20% of users behind symmetric NAT won’t see the call. coturn — open source solution, Twilio NTS and Metered TURN — managed.

Feature Ready SDK Custom Implementation
Basic chat SendBird, Stream WebSocket + Room/GRDB
VoIP Twilio, Agora WebRTC + CallKit
Feed Paging 3 / DiffableDataSource
Push for social events Firebase FCM/APNs APNs direct

What Are the Best Practices for Feed and Reactions?

Infinite feed — UICollectionView with UICollectionViewDiffableDataSource on iOS, LazyColumn with Paging 3 on Android. Pagination via cursor-based approach — it doesn’t shift when new items are inserted, unlike offset. Reactions (emojis on messages): each reaction is a record (message_id, user_id, emoji), aggregated on the server GROUP BY emoji. WebSocket event reaction_added updates the counter in real-time. Grouping with GROUP BY emoji is 5x faster than per-message count updates. Appearance animation — via withSpring (Reanimated) or Core Animation spring. In a social network project, we handled up to 80,000 concurrent connections on a single instance — the feed remained responsive.

Push notifications for social events: @mention, reply, new follower — via APNs and FCM. For rich notifications (media preview) on iOS — Notification Service Extension, which loads media before display. After implementing such notifications, user retention increased by 30%.

What deliverables do you receive?

We deliver not just code — here is the full list:

  1. Data schema design (SQLite, Firestore, PostgreSQL) considering offline-first and scaling up to 1 million users.
  2. Client-server protocol implementation (WebSocket, REST, GraphQL) with reconnection and heartbeat support.
  3. Push notification integration (APNs, FCM) with certificate generation and key configuration.
  4. TURN server setup or managed provider selection (e.g., Twilio NTS) for VoIP.
  5. API documentation and migration schema (including rollback plan).
  6. Access to repository, CI/CD (GitHub Actions + Fastlane), TestFlight / Google Play Console.
  7. Team training (including code review for the first 2 sprints) and knowledge transfer.
  8. On-call support for 2 weeks after release.

How to avoid typical mistakes in chat development?

  • Lack of reconnection strategy. Client simply disconnects without a queue of unsent messages. Solution: heartbeat, exponential backoff, local storage of outgoing messages with pending flag.
  • Using offset pagination in feed. When new posts are inserted, the user sees duplicates — scrolling breaks. Solution: cursor-based pagination.
  • Ignoring battery optimization on Android. ConnectionService doesn’t survive until incoming call. Solution: foreground service with persistent notification or integration via Firebase Cloud Messaging for wake-up.
  • Error in choosing chat protocol. Bare WebSocket without a protocol on top — reinventing the wheel. Platform-agnostic JSON or MessagePack with type flag.

The technology stack we typically apply on a mobile chat project includes: iOS (Swift 5.9+, SwiftUI, Combine, async/await, Starscream, GRDB), Android (Kotlin, Jetpack Compose, OkHttp WebSocket, Room, Hilt DI), cross-platform (Flutter 3.x/React Native), backend (Node.js + socket.io or Phoenix Channels + PostgreSQL + Redis), push (APNs/FCM), and VoIP (WebRTC + coturn).

⏱ Estimated timelines

Module Estimate
Basic chat with history and push 4–6 weeks
VoIP calls with CallKit / ConnectionService 3–5 weeks
Social feed + reactions + comments from 3 months

Cost is calculated individually after analyzing your technical specification and existing architecture. Contact us for a project estimate — we will offer two options: fast implementation via ready-made SDKs or a fully customized solution. Get a consultation and accurate estimate within 2 business days. Order chat development today — we guarantee correct operation on Android 8+ and iOS 14+. Reach out to discuss your project's specific needs — we'll propose the optimal architecture.