<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Akash</title>
    <description>The latest articles on Forem by Akash (@akashmani).</description>
    <link>https://forem.com/akashmani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F634564%2F5ca516f1-fe7c-4787-854f-1eacbee234a1.jpeg</url>
      <title>Forem: Akash</title>
      <link>https://forem.com/akashmani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/akashmani"/>
    <language>en</language>
    <item>
      <title>Adding Rich Messages to your In-App Chat</title>
      <dc:creator>Akash</dc:creator>
      <pubDate>Tue, 06 Jul 2021 05:58:34 +0000</pubDate>
      <link>https://forem.com/applozic/adding-rich-messages-to-your-in-app-chat-5gfo</link>
      <guid>https://forem.com/applozic/adding-rich-messages-to-your-in-app-chat-5gfo</guid>
      <description>&lt;p&gt;So, what exactly is &lt;em&gt;rich messaging&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;In some ways, it’s exactly what it sounds like: messaging that is deeper, richer, and more layered. But it’s also much more than that.&lt;/p&gt;

&lt;p&gt;Integrating rich messaging into your chat allows you to push something more interactive than just plain text. It allows both parties to share interactive media like images, buttons, and cards seamlessly. In addition, customers can easily interact and respond using rich messaging buttons and even make secure purchases. For example, giving customers the opportunity to view and purchase sandwiches within the chat window led to an &lt;a href="https://www.gsma.com/futurenetworks/wp-content/uploads/2020/03/RCS-Whitepaper-Infobip_Feb20.pdf"&gt;increase in Subway’s conversions by 140%&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Rich messaging can simplify interactions with your customers in a significant manner. If your in-app chat isn’t using rich messaging in 2021, you’re definitely missing out!&lt;/p&gt;

&lt;p&gt;To add rich messaging and other exciting features to your app, &lt;a href="https://console.applozic.com/signup"&gt;register for a free trial of Applozic's chat API&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Rich messaging using Applozic SDK&lt;/h2&gt;

&lt;p&gt;In addition to traditional messaging types like text and audio, Applozic also provides a set of messaging options in the form of &lt;em&gt;structured &lt;/em&gt;content templates. This article will guide you through creating a structure for sending some types of rich messages.&lt;/p&gt;

&lt;p&gt;In order to achieve this behavior, the information must be sent in a structured format that can be included in the metadata of a message. The most common format is JSON (Javascript Object Notation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Rich message UI is only Supported in Applozic-Android-SDK and Applozic-Swift-SDK.&lt;/p&gt;

&lt;h2&gt;Identifying a rich message&lt;/h2&gt;

&lt;p&gt;Rich messages in Applozic can be categorized into 4 types - Buttons, Images, Lists, and Cards. But before we get to them, let's talk about how to identify a rich message in our Applozic-powered chat app.&lt;/p&gt;

&lt;p&gt;To send a rich message, we need to add the &lt;em&gt;contentType&lt;/em&gt; property into the message's metadata to separate it from normal messages. The value of &lt;em&gt;contentType &lt;/em&gt;is &lt;em&gt;300&lt;/em&gt; for rich messages. Below is the metadata for all rich messages templates:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    "contentType":"300"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Apart from the content type, each rich message also has a &lt;em&gt;templateId&lt;/em&gt;, which is different for different types of rich messages. The data of the rich message must be passed onto its payload. We will examine the payload for some types of rich messages as we discuss them in detail.&lt;/p&gt;

&lt;p&gt;Here is how a rich message is generally structured:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    "message": "click on the buttons",
    "metadata": {
        "contentType": "300",//the content type is 300 for rich messages
        "templateId": "x",//x is a integer which differs for different types of rich messages
        "payload": "{//data pertaining to the rich message }"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here are the different types of rich messages you can use in Applozic:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Buttons&lt;ol&gt;
&lt;li&gt;Link Buttons&lt;/li&gt;
&lt;li&gt;Submit Buttons&lt;/li&gt;
&lt;li&gt;Suggested Replies&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;Images&lt;/li&gt;
&lt;li&gt;List&lt;/li&gt;
&lt;li&gt;Cards&lt;ol&gt;
&lt;li&gt;Generic Card&lt;/li&gt;
&lt;li&gt;Card Carousel&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article, we’ll be examining the implementation of suggested replies, images, and generic cards into our chat application&lt;/p&gt;

&lt;h2&gt;Suggested Reply Button&lt;/h2&gt;

&lt;h2&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sMVxUDi---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh5.googleusercontent.com/k0iUUADpby0I-DwcKPsyScbD49w6m2OV5C-yf-yVGS-BhnA5N56h0GzcKFuv8CbeQLtq8vtVb2QsqW-qcwB-nKj_-Y4jVgelpstIEeHguhth6zhD4CVisihiJSqK6mccmrr8ts2t"&gt;&lt;/h2&gt;

&lt;p&gt;Suggested Replies provide a way to send some common replies to messages with just a click, without having to type them out manually.&lt;/p&gt;

&lt;p&gt;To render suggested replies on the UI, we need to send 2 fields in the payload:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;title&lt;/em&gt;: display name for the button.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;message&lt;/em&gt;: A message that would be sent as a reply.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a sample payload for suggested replies:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;"payload": [{
   "title": "Yes",
   "message": "Cool! send me more."
   },
   {
   "title": "No",
   "message": "Not at all",
   }
}]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On clicking the button, a message would be sent with the text from the message property of the payload. To get the click outside the SDK you can use the following code. For Android, you will need to implement the &lt;em&gt;ALRichMessageListener&lt;/em&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public class SampleApplication extends Application implements ALRichMessageListener//this can also be an activity or a fragment
{
  
   @Override
    public void onAction(Context context, String action, Message message, Object object) {
        if("Click" == action){
              String text = (String) object;//object will be the message text from the button
          //message will be applozic message object
          }   
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here is the sample JSON for suggested replies:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
  "to": "userid",  
  // or
  // "groupId" : "groupId",
  "message": "Do you want more updates?",
    "metadata": {
        "contentType": "300",
        "templateId": "6",
        "payload": "[{\"title\": \"Yes\",\"message\": \"Cool! send me more.\"},         {\"title\": \"No\",\"message\": \"Not at all\"}]"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;
  
  
  Continue this Tutorial on Applozic Blog!
&lt;/h2&gt;

&lt;p&gt;We have the detailed tutorial with code snippets available on &lt;a href="https://www.applozic.com/blog/adding-rich-messaging-to-your-in-app-chat/"&gt;our blog&lt;/a&gt; for you to continue with your integration!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.applozic.com/blog/adding-rich-messaging-to-your-in-app-chat/"&gt;Click here&lt;/a&gt; to learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add images in chat&lt;/li&gt;
&lt;li&gt;Use Generic card templates&lt;/li&gt;
&lt;li&gt;Add lists in chat&lt;/li&gt;
&lt;li&gt;Use card carousels in chat&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Building a WhatsApp clone from scratch using Flutter</title>
      <dc:creator>Akash</dc:creator>
      <pubDate>Fri, 02 Jul 2021 15:05:58 +0000</pubDate>
      <link>https://forem.com/applozic/building-a-whatsapp-clone-from-scratch-using-flutter-57jg</link>
      <guid>https://forem.com/applozic/building-a-whatsapp-clone-from-scratch-using-flutter-57jg</guid>
      <description>&lt;p&gt;According to &lt;a href="https://www.statista.com/statistics/483255/number-of-mobile-messaging-users-worldwide/"&gt;Statista&lt;/a&gt;, around 2.77 billion mobile phone users accessed over-the-top messaging to communicate in 2020, and this figure is poised to reach three billion users in 2022. Of these, WhatsApp was the most popular mobile messenger app worldwide with over 2 billion users, mainly due to its first-mover advantage and user-friendly interface.&lt;/p&gt;

&lt;p&gt;However, due to concerns over the recent updates to WhatsApp’s privacy policies, &lt;a href="https://www.computerworld.com/article/3608988/whatsapps-new-privacy-policy-is-a-gift-to-other-messaging-apps.html"&gt;many users and businesses are on the lookout for alternatives&lt;/a&gt;. Check out our &lt;a href="https://www.applozic.com/blog/how-to-develop-a-secure-chat-alternative-to-whatsapp/"&gt;previous blog post&lt;/a&gt; to learn more about the security implications of WhatsApp’s policy updates.&lt;/p&gt;

&lt;p&gt;Thanks to Applzozic’s intuitive &lt;a href="https://docs.applozic.com/docs/overview"&gt;chat SDKs&lt;/a&gt; and &lt;a href="https://docs.applozic.com/reference"&gt;platform APIs&lt;/a&gt;, it‘s pretty easy to build your own chat alternative to WhatsApp! Before we delve into the code, let’s discuss the framework that we’ll use to implement our chat messenger app.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Why Flutter?&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CFiVZ7rV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.applozic.com/blog/wp-content/uploads/2021/04/flutter-1024x576.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CFiVZ7rV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.applozic.com/blog/wp-content/uploads/2021/04/flutter-1024x576.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Launched by Google in 2018, &lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt; is a free and open-source SDK for developing high-performing mobile, web, and desktop applications from a single codebase. &lt;/p&gt;

&lt;p&gt;An exciting feature of Flutter is its &lt;a href="https://flutter.dev/docs/resources/architectural-overview"&gt;layered structure&lt;/a&gt; that enables developers to build highly customizable and attractive apps with much lower time and effort, without compromising on performance. Moreover, experimenting new features and debugging errors is much faster in Flutter due to its &lt;a href="https://medium.com/podiihq/understanding-hot-reload-in-flutter-2dc28b317036"&gt;hot reload feature&lt;/a&gt; that reflects instant changes in the codebase within milliseconds&lt;/p&gt;

&lt;p&gt;Even though Flutter is a relatively new cross-platform app development framework compared to established contemporaries like React Native, &lt;a href="https://flutter.dev/showcase"&gt;many companies have started to migrate to Flutter&lt;/a&gt; due to its higher performance and flexible UI.&lt;/p&gt;

&lt;p&gt;Do note that we’ll only be delving into the code implementation of the app’s chat functionality using &lt;a href="https://github.com/AppLozic/Applozic-Flutter-Plugin"&gt;Applozic Flutter SDK&lt;/a&gt; in this article - &lt;a href="https://nanocastellano.medium.com/whatsapp-ui-clone-7f75773ad21b"&gt;here’s a simple tutorial&lt;/a&gt; on creating a UI for the app using Flutter.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Creating a new application and setting up dependencies&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a rel="noreferrer noopener" href="https://flutter.dev/docs/get-started/codelab"&gt;flutter.dev&lt;/a&gt; has a comprehensive starter tutorial on creating your first application using Flutter. Once you are ready to integrate using the Applozic SDK, follow these steps:&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;I. Installation&lt;/strong&gt;&lt;/h3&gt;

&lt;ol&gt;&lt;li&gt;Add the following dependency in your pubspec.yaml file:&lt;/li&gt;&lt;/ol&gt;

&lt;pre&gt;&lt;code&gt;dependencies:
  # other dependencies
applozic_flutter: ^0.0.4&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;2. Install the package as shown below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter pub get&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;3. Import the applozic_flutter in your .dart file to use the methods from Applozic:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import 'package:applozic_flutter/applozic_flutter.dart';&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;&lt;strong&gt;II. Authentication&lt;/strong&gt;&lt;/h3&gt;

&lt;h4&gt;Login&lt;/h4&gt;

&lt;p&gt;Create an Applozic user object, and pass it to the login() function as shown below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dynamic user = {
      'applicationId': "&amp;lt;APPLICATION_ID&amp;gt;",   //Mandatory
      'userId': userId.text,                 //Mandatory
      'displayName': displayName.text,
      'password': password.text,
      'authenticationTypeId': 1              //Mandatory
  };

ApplozicFlutter.login(user).then((response) {
      print("Login success : " + response)
    }).catchError((error, stack) =&amp;gt;
      print("Error while logging in : " + error.toString()));&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Please keep in mind that once the user is logged in, a new login is permitted only after the user logs out. Use this code to check if the user is already logged in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ApplozicFlutter.isLoggedIn().then((isLoggedIn) {
        if (isLoggedIn) {
          //The user is logged in
         } esle {
          //The user is not logged in
         }
     });&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Update logged in user details&lt;/h4&gt;

&lt;p&gt;You can update the logged in user details as given below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  dynamic user = {
                    'displayName': '&amp;lt;New name&amp;gt;'
                    'imageLink': '&amp;lt;New Image URL&amp;gt;'
                  }

  ApplozicFlutter.updateUserDetail(user)
                        .then(
                            (value) =&amp;gt; print("User details updated : " + value))
                        .catchError((e, s) =&amp;gt; print(
                            "Unable to update user details : " + e.toString()));&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Get logged in userID&lt;/h4&gt;

&lt;p&gt;You can get the userID of the logged in user as given below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  ApplozicFlutter.getLoggedInUserId().then((userId) {
      print("Logged in userId : " + userId);
    }).catchError((error, stack) {
      print("User get error : " + error);
   });&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;
  
  
  Continue this Tutorial on Applozic Blog!
&lt;/h2&gt;

&lt;p&gt;We have the detailed tutorial with code snippets available on &lt;a href="https://www.applozic.com/blog/building-a-whatsapp-clone-from-scratch-using-flutter/"&gt;our blog&lt;/a&gt; for you to continue with your integration!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.applozic.com/blog/building-a-whatsapp-clone-from-scratch-using-flutter/"&gt;Click here&lt;/a&gt; to learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up push notifications in your application&lt;/li&gt;
&lt;li&gt;Launch the Conversation screen and start messaging!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please leave your feedback and doubts in the comments below.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SDK vs API - What's the Difference?</title>
      <dc:creator>Akash</dc:creator>
      <pubDate>Thu, 17 Jun 2021 09:18:29 +0000</pubDate>
      <link>https://forem.com/applozic/sdk-vs-api-what-s-the-difference-12ec</link>
      <guid>https://forem.com/applozic/sdk-vs-api-what-s-the-difference-12ec</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PbSt-qJwU68"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Hello everyone! I'm Akash from &lt;a href="https://www.applozic.com/"&gt;Applozic&lt;/a&gt;, and today we'll take a look at what SDKs and APIs are, and how they differ from each other.&lt;/p&gt;

&lt;p&gt;So, what is an SDK?&lt;/p&gt;

&lt;p&gt;SDK stands for Software Development Kit. It is a collection of software development tools in one installable package. They facilitate the app development process.&lt;/p&gt;

&lt;p&gt;So an SDK contains: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Documents&lt;/li&gt;
&lt;li&gt;Code samples&lt;/li&gt;
&lt;li&gt;APIs &lt;/li&gt;
&lt;li&gt;Code libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s now summarize how SDK works.&lt;/p&gt;

&lt;p&gt;SDKs work with specific programming languages. They are easy to use because the goal is to make the jobs of developers easier, and save developers from writing code for already existing functionalities&lt;/p&gt;

&lt;p&gt;Let’s have a look at some examples of SDK:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A good example is Android SDK - they have all the elements needed to create the app such as sample source code, debugger, required libraries, amongst other things.&lt;/li&gt;
&lt;li&gt;Another example is Cloud SDK for Google Cloud Platforms - these contain tools that you need to manage applications and software in a Google Cloud Platform. Cloud SDK is a set of tools, including gcloud, gsutil, and bq command-line tools, client libraries &amp;amp; local emulators for developing with Google Cloud.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we now know what an SDK is, let's move on to APIs. What exactly is an API?&lt;/p&gt;

&lt;p&gt;APIs, which stand for Application Programming Interfaces, make the software development process easy by permitting a seamless and secure data transfer between two apps. It also helps to improve the exchange of functionality between two applications. So in essence, APIs allow two applications to talk to each other, relaying data from one end to another.&lt;/p&gt;

&lt;p&gt;Let’s review some examples of APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login with Facebook
When using websites, you can often find the option to log in using your Facebook account. It means that the website uses Facebook Login API to integrate their service and help users skip the sign-up process.&lt;/li&gt;
&lt;li&gt;Third-Party Payments 
You can often see the payment options of PayPal, Apple Pay, or Google Pay. It means that the payment system integrates these services through API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, what are the key differences between SDKs and APIs?&lt;/p&gt;

&lt;p&gt;Even though both concepts are indeed overlapped and interrelated, let's differentiate their purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An SDK is the toolbox you need to build applications while and API establishes communication between two applications; &lt;/li&gt;
&lt;li&gt;An SDK may contain APIs, but APIs cannot contain SDKs;&lt;/li&gt;
&lt;li&gt;SDKs are easy to use and faster to integrate while APIs don’t have code libraries and are easy to modify;&lt;/li&gt;
&lt;li&gt;SDKs contain all you need to communicate with another software and all you need to build software while APIs deliver a request from one app to another software and deliver a response back to the requesting app;&lt;/li&gt;
&lt;li&gt;Developers always use an SDK to build apps, but APIs only come in when there is a need to have external communication with other platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In fact, APIs and SDKs are both solution-bringers to developers, but each one is special in its way.&lt;/p&gt;

&lt;p&gt;So, is the difference clear now? If you have any doubts or queries about APIs or SDKs, feel free to drop a comment in the comment section below!&lt;/p&gt;

</description>
      <category>sdk</category>
      <category>api</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
