{"id":1926,"date":"2017-12-07T02:59:52","date_gmt":"2017-12-07T10:59:52","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vsappcenter\/?p=1926"},"modified":"2024-10-09T04:45:46","modified_gmt":"2024-10-09T09:45:46","slug":"build-your-first-chat-app-with-microsoft-azure-visual-studio-app-center-and-rapid","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/appcenter\/build-your-first-chat-app-with-microsoft-azure-visual-studio-app-center-and-rapid\/","title":{"rendered":"Guest Blog | Zero to App in 20 Minutes: Build Your First Chat App with Microsoft Azure, Visual Studio App Center, and Rapid"},"content":{"rendered":"<p><em>This is a special guest post from David Drobik, co-founder at <a href=\"http:\/\/www.rapidrealtime.com\" target=\"_blank\" rel=\"noopener\">Rapid<\/a>. <\/em><\/p>\n<p>Until recently, we had only one option for communicating with friends, family, and colleagues from our mobile phones: Short Messaging System (SMS).<\/p>\n<p>Now, though, we don\u2019t have to limit our communication to 160 characters (the SMS max per message, in case you don\u2019t remember), and the options for real-time communication are virtually limitless.<\/p>\n<p>In my work at STRV, creating web and mobile apps for Silicon Valley\u2019s hottest companies and leading global brands, including Caviar, LegalZoom, Hallmark, and Lufthansa, and in developing our own real-time database (Rapid), we\u2019ve seen the mobile explosion, beginning with the earliest smartphones in 2004.<\/p>\n<p>Today we\u2019re seeing the chat explosion. From dating to customer service and team collaboration, you name it and there\u2019s a real-time messaging app for it. Industry research backs this up: <a href=\"http:\/\/www.businessinsider.com\/the-messaging-app-report-2015-11\" target=\"_blank\" rel=\"noopener\">Business Insider notes<\/a> the top four messaging apps are bigger than the top four social networks, and <a href=\"https:\/\/www.emarketer.com\/Article\/More-Than-Quarter-of-World-Will-Use-Mobile-Messaging-Apps-by-2019\/1014773\" target=\"_blank\" rel=\"noopener\">eMarketer predicts<\/a> that more than one-quarter of the world\u2019s population will be using mobile messaging apps by 2019.<\/p>\n<p>This is a massive opportunity, but chat interfaces are notoriously challenging to implement due to their complex asynchronous nature and underlying real-time infrastructure.<\/p>\n<p>We developed Rapid to solve this problem for ourselves, as a 160+ member development shop, and for you, as an indie, commercial, or enterprise developer. We\u2019ve combined numerous cloud services (the ones most critical to chat apps, including Azure Cosmos DB, Azure Redis, and Azure Container Service) into one simple real-time database to help you move fast.<\/p>\n<p>In twenty minutes or less, any developer can get their first real-time chat app up and running. In this post, we\u2019ll show you how (and why) to add \u201cchat apps\u201d to your StackOverflow Developer Story, GitHub repos, or [insert your preferred skills profile]. We\u2019ll dive into basic chat requirements, what separates the good from the great, plus give you the code samples and <a href=\"https:\/\/www.rapidrealtime.com\/docs\/guides\/build-ios-chat-app\/getting-started-preview\" target=\"_blank\" rel=\"noopener\">step-by-step docs<\/a> you need to get started.<\/p>\n<p><strong>But first, a little more on the rise of chat apps.<\/strong><\/p>\n<p><em>It\u2019s no surprise that real-time messaging has permeated all industries, verticals, and demographics; humans are social beings, and we crave interaction with others.<\/em><\/p>\n<p>Developers everywhere are incorporating social elements into their apps, from gamification to social sharing, and chat capabilities are arguably \u201csocial-plus.\u201d Real-time messaging is the most direct, fastest form of digital interaction. From a developer&#8217;s point of view, this results in happier, more engaged users; your user base launches your app more frequently, checking for updates, new messages, or shares with their friends.<\/p>\n<p>Chat drives user engagement and loyalty, but there\u2019s usually a trade-off. You want (and should) spend your time delivering a great user experience, not solving the server-side challenges, like scaling WebSockets, that chat messaging entails.<\/p>\n<p>With the help of Azure and <a href=\"https:\/\/www.visualstudio.com\/app-center\/\" target=\"_blank\" rel=\"noopener\">Visual Studio App Center<\/a>, Rapid removes these barriers. Without further ado, let\u2019s take a look at what it takes to build a chat app that people are eager to use again and again.<\/p>\n<h2>Anatomy of a Chat App<\/h2>\n<h2>Chat Channels<\/h2>\n<p><img class=\"aligncenter size-full wp-image-1927\" alt=\"Rapid app chat channels\" width=\"750\" height=\"516\" \/><\/p>\n<p>As users, we\u2019re accustomed to seeing chat groups where we can talk to dozens of friends or colleagues, in real-time or asynchronously, and direct messaging capabilities that allow us to communicate directly with one other person.<\/p>\n<p>As you build <em>your<\/em> chat app, you need to make sure you can display, search, and send messages to multiple groups and associated members, as well as limit message sends to conversations between individuals.<\/p>\n<h3>Building the List of Channels<\/h3>\n<p>Most chat apps contain a list of all chat groups, commonly called <em>channels<\/em>, where users search, select, and post messages. Whatever you refer to them as, they allow your users to easily navigate through conversations.<\/p>\n<p>In addition, don\u2019t forget the \u201ccreate a channel\u201d feature. Offering pre-existing channels in your chat app is great, but users also need to create channels for specific teams, interests, events, and more, as well as have the ability to invite users to collaborate.<\/p>\n<p><img class=\"aligncenter size-full wp-image-1935\" alt=\"Rapid create a channel\" width=\"750\" height=\"513\" \/><\/p>\n<h2>Implement and Send Messages<\/h2>\n<p>Channels are the framework for your app. The core of your app is building the actual <em>chat capabilities<\/em> and allowing your users to easily read, write, and send messages to other users and channels.<\/p>\n<h3>Building the List of Messages<\/h3>\n<p>Every chat app has a way of displaying messages to users, but the <em>best<\/em> chat apps make navigating through conversations with other users as simple as possible. Building a list of messages makes it easy for users to parse, search, and find messages. We\u2019ve seen this magnified in work-related chat applications, where colleagues sending new information quickly buries earlier (but important) information and documents.<\/p>\n<h2>Engage Users with Push Messages<\/h2>\n<p>According to a <a href=\"https:\/\/www.appannie.com\/en\/insights\/market-data\/global-consumer-app-usage-data\/\" target=\"_blank\" rel=\"noopener\">recent report from App Annie<\/a>, average US users have over 80 apps installed on their smartphones, but only <strong>use<\/strong> around 30 on a monthly basis. To make your app stand out on a busy home screen, re-engaging users with push notifications is crucial.<\/p>\n<p>We all know that as the number of App Store and Google Play apps increases, app discoverability gets harder and harder. How your app ranks in store searches (<a href=\"https:\/\/en.wikipedia.org\/wiki\/App_store_optimization\" target=\"_blank\" rel=\"noopener\">ASO<\/a>) depends on various criteria, and how frequently your app is used per day is a major factor. This is partially in your control; using push notifications thoughtfully can drive significant increases in app launch frequency and boost your rankings.<\/p>\n<h3>Sending Notifications with Azure Notification Hubs and Visual Studio App Center Push Service<\/h3>\n<p>To get started, identify when, how, and why you\u2019ll push notifications and conversation updates to your users.<\/p>\n<p>Just like with email, push notifications fit into two different categories:<\/p>\n<ol>\n<li><strong>Transactional Notifications<\/strong>: Notification that a new chat message is received.<\/li>\n<li><strong>Marketing Notifications<\/strong>: Messages intended to re-engage your users by promoting a new upgrade or by prompting them to check out your latest features.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/appcenter\/push\/\" target=\"_blank\" rel=\"noopener\">Visual Studio App Center\u2019s Push<\/a> service allows you to send re-engagement notifications directly from the App Center portal, and you can also use <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/notification-hubs\/\" target=\"_blank\" rel=\"noopener\">Azure Notification Hubs<\/a> to send push notifications dynamically from any backend (including on-premises).<\/p>\n<p>Both services handle device registrations for you, including storing device tokens and deleting them if they\u2019re no longer valid, which is a big advantage since it gives you one less moving part to worry about. On the implementation side, each service has its own client-side SDK, with a slightly different API. Visual Studio App Center\u2019s Push SDK handles most of the registration for you with a single line of code. The Notification Hubs SDK requires a deeper understanding of the platform\u2019s specific device registration process.<\/p>\n<h2>Next Steps: Make it Your Own<\/h2>\n<p>Ready to build your own chat app in 20 minutes? <a href=\"https:\/\/www.rapidrealtime.com\/demo\" target=\"_blank\" rel=\"noopener\">Check out our demo projects<\/a> (Android, iOS, and JavaScript) to <a href=\"https:\/\/github.com\/marketplace\/app-center\" target=\"_blank\" rel=\"noopener\">download the full source code and docs<\/a>, including detailed tutorial steps for the iOS version.<\/p>\n<p>From there, you can customize the UI, add more capabilities, and, most importantly, show it off to your colleagues and friends!<\/p>\n<p>To start sharing with others, <a href=\"https:\/\/docs.microsoft.com\/en-us\/mobile-center\/distribution\/\" target=\"_blank\" rel=\"noopener\">check out Visual Studio App Center\u2019s Distribute service<\/a>. You\u2019ll create and add members to distribution groups in minutes, send notifications to all group members with prompts to download your app, as well as automatically send notifications for future updates as you keep adding features.<\/p>\n<p>We can\u2019t wait to see what you build. And who knows\u2014you might have the next big real-time app!<\/p>\n<p><strong>More About Rapid<\/strong><\/p>\n<p>We started Rapid, a globally distributed real-time database, to solve common problems and make it easy for web or mobile developers to deliver real-time data from servers to any client (iOS, Android, React Native, or React.js).Rapid relies on Azure Cosmos DB and many other Microsoft Azure services (VMs, Containers Services, Redis Cache), surfacing its powerful hyperscale capabilities, like rich queries, auto indexing, low latency, and predictable throughput, in an easy-to-use UI.<\/p>\n<p>We\u2019re a startup passionate about helping other startups ship lightning-fast, amazing apps &#8211; from chat apps to games to IoT scenarios. Any situation where speed is essential, Rapid has developers covered.<\/p>\n<p>Special thanks to the Rapid team who helped with the heavy lifting on this post, namely: Martin Stava, Jakub Kinst, Jan Schwarz, Filip Skaloud and Daniel Kraus.<\/p>\n<p><em>If you haven\u2019t already, <a href=\"https:\/\/www.visualstudio.com\/app-center\/\" target=\"_blank\" rel=\"noopener\">create your Visual Studio App Center account<\/a>, connect your first app, and start shipping better apps now.<\/em><\/p>\n<p>Have an account? <a href=\"https:\/\/www.visualstudio.com\/app-center\/\" target=\"_blank\" rel=\"noopener\"><em>Log in<\/em><\/a> and let us know what you\u2019re working on!<\/p>\n<p><a href=\"https:\/\/appcenter.ms\/signup\"><img class=\"aligncenter wp-image-2585\" alt=\"Get started now button\" width=\"250\" \/><\/a><\/p>\n<p><strong>About the Author<\/strong><\/p>\n<p>David Drobik is the co-founder of <a href=\"http:\/\/www.rapidrealtime.com\" target=\"_blank\" rel=\"noopener\"><em>Rapid<\/em><\/a>, launching in early 2017. Prior to his work with Rapid, David led business development at <a href=\"http:\/\/www.strv.com\" target=\"_blank\" rel=\"noopener\"><em>STRV<\/em><\/a>, Silicon Valley\u2019s go-to software development partner. He\u2019s enthusiastic about sharing his rich experience in tech and startups with the world through his <a href=\"https:\/\/medium.com\/@daviddrobik\" target=\"_blank\" rel=\"noopener\"><em>blog<\/em><\/a> and frequent community meet-ups, hackathons, and more.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a special guest post from David Drobik, co-founder at Rapid. Until recently, we had only one option for communicating with friends, family, and colleagues from our mobile phones: Short Messaging System (SMS). Now, though, we don\u2019t have to limit our communication to 160 characters (the SMS max per message, in case you don\u2019t [&hellip;]<\/p>\n","protected":false},"author":42,"featured_media":38034,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16],"tags":[10],"class_list":["post-1926","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobiledev","tag-guest-post"],"acf":[],"blog_post_summary":"<p>This is a special guest post from David Drobik, co-founder at Rapid. Until recently, we had only one option for communicating with friends, family, and colleagues from our mobile phones: Short Messaging System (SMS). Now, though, we don\u2019t have to limit our communication to 160 characters (the SMS max per message, in case you don\u2019t [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts\/1926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/comments?post=1926"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts\/1926\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/media\/38034"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/media?parent=1926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/categories?post=1926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/tags?post=1926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}