quora
  • Recent
Add chat and video calling using QuickBlox chat API and SDK

Build Your Own Messenger With Real-Time Chat & Video APIs

Add instant messaging and online video chat to any Android, iOS, or Web application, with ease and flexibility. In-app chat and calling APIs and SDKs, trusted globally by developers, startups, and enterprises.

phone
QuickBlox Bayshore
QuickBlox NextGen
QuickBlox MORABANC
QuickBlox ZUELLIG PHARMA
QuickBlox Teladoc
QuickBlox OMRON

Launch quickly and convert more prospects with real‑time Chat, Audio, and Video communication

If you own a product, you know exactly how drawn-out and exorbitant it can be to build to build real-time communication features from scratch. Quickblox can help you design, create, and enter the market at a much faster rate with APIs and SDKs that shortcut product and engineering delivery. Convert your ideas into a successful product with us and watch the engagement rate rise, while you build a loyal user base.

Over 30,000 software developers and organizations worldwide are using QuickBlox messaging API.

200+

enterprise instances

22K+

applications

75M+

chats per day

2.5B+

requests per month

Wherever you are in your product journey, we have chat, voice, and video APIs ready to build new features into your app

Why QuickBlox?

Quickblox APIs are equipped to support mobile applications and websites at different stages, be it a fresh product idea, an MVP, early stage startup or a scaling enterprise. Our documentation and developer support are highly efficient to make your dream product a reality.

QuickBlox

Chat API and Feature-Rich SDKs

Our versatile software is designed for multi‑platform use including iOS, Android, and the Web.

QuickBlox

SDKs and Code Samples:

Cross-platform kits and sample apps for easy and quick integration of chat.

QuickBlox

Restful API:

Enable real-time communication via the server.

QuickBlox

UI Kits:

Customize everything as you want with our ready UI Kits.

QuickBlox

Q-Consultation:

White‑label solution for teleconsultation and similar use cases.

QuickBlox

Fully Customizable White Label Solutions

Customizable UI Kits to speed up your design workflow and build a product of your vision as well as a ready white‑label solution for virtual rooms and video calling use cases.

QuickBlox

Cloud & Dedicated Infrastructure

Host your apps wherever you want - opt for a dedicated fully managed server or on‑premises infrastructure. Pick a cloud provider that’s best as per your business goals.

QuickBlox

Cloud:

A dedicated QuickBlox cloud or your own virtual cloud?

QuickBlox

On-Premise:

Deployed and managed on your own physical server.

QuickBlox

Docs:

Integrating QuickBlox across multiple platforms.

QuickBlox

Support:

Quickblox support is a click away.

QuickBlox

Rich Documentation & Constant Support

Get easy step by step guidance to build a powerful chat/messaging/communication app. Easily integrate new features using our documentation and developer support.

Do you need additional security, compliance, and support for the long-term ?

We have a more scalable and flexible solution for you, customized to your unique business/app requirements.

Insanely powerful in-app chat solutions- for every industry

  • Healthcare

    Provide better care for your patients and teams using feature-rich HIPAA‑compliant chat solutions. Integrate powerful telemedicine communication tools into your existing platform.

    QuickBlox
  • Finance & Banking

    Secure communication solutions for the financial and banking industry to support your clients. Easily integrated with your banking APIs with full customization available.

    QuickBlox
  • Marketplaces & E-commerce

    Integrate chat and calling into your e‑commerce marketplace platform to connect with customers using chat, audio, and video calling features.

    QuickBlox
  • Education & Coaching

    Add communication functions to connect teachers with students, coaches with players, and trainers with clients. Appropriate for any remote learning application.

    QuickBlox

Trusted by Developers & Product Owners

Explore Documentation

Familiarize yourself with our chat and calling APIs. Use our platform SDKs and code samples to learn more about the software and integration process.

Start For FREE. Customize Everything. Build Your Dream Online Platform.

Our real-time chat and messaging solutions scale as your business grows, and can be customized to create 100% custom in-app messaging.

QUICKBLOX
QuickBlox post-box

Q-Consultation for every industry

Securely hold virtual meetings and video conferences

Learn More>

Want to learn more about our products and services?

Speak to us now

How to Implement Push Notifications in your Android App

Kirill Tolmachev
1 Jun 2022
adding push notifications to your Android App

In the article, How to get your Android App ready to add Push Notifications, we showed you how to set up the necessary data and files in your application and admin panel to get your App ready to add this feature. Now that you’ve completed these steps, you’re ready to create a class for received push notifications.

Tutorial

First of all, you should add a class that extends QBFcmPushListenerService. In the example below, it is called PushListenerService.

Push Listener Service

In a callback sendPushMessage you can add custom logic for handling the received message.

For example, you can add a class to show notifications with information with static methods.

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;

import androidx.annotation.DrawableRes;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;

public class NotificationUtils {
    private static final String CHANNEL_ONE_ID = "com.quickblox.samples.ONE";// The id of the channel.
    private static final String CHANNEL_ONE_NAME = "Channel One";

    public static void showNotification(Context context, Class<? extends Activity> activityClass,
                                        String title, String message, @DrawableRes int icon,
                                        int notificationId) {
        NotificationManager notificationManager =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            createChannelIfNotExist(notificationManager);
        }
        Notification notification = buildNotification(context, activityClass, title, message, icon);

        notificationManager.notify(notificationId, notification);
    }

    @RequiresApi(api = Build.VERSION_CODES.O)
    private static void createChannelIfNotExist(NotificationManager notificationManager) {
        if (notificationManager.getNotificationChannel(CHANNEL_ONE_ID) == null) {
            int importance = NotificationManager.IMPORTANCE_HIGH;
            NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ONE_ID,
                    CHANNEL_ONE_NAME, importance);
            notificationChannel.enableLights(true);
            notificationChannel.setLightColor(Color.BLUE);
            notificationChannel.setShowBadge(true);
            notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
            notificationManager.createNotificationChannel(notificationChannel);
        }
    }

    private static Notification buildNotification(Context context, Class<? extends Activity> activityClass,
                                                  String title, String message, @DrawableRes int icon) {
        Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

        return new NotificationCompat.Builder(context, CHANNEL_ONE_ID)
                .setSmallIcon(icon)
                .setContentTitle(title)
                .setContentText(message)
                .setAutoCancel(true)
                .setSound(defaultSoundUri)
                .setContentIntent(buildContentIntent(context, activityClass, message))
                .build();
    }

    private static PendingIntent buildContentIntent(Context context, Class<? extends Activity> activityClass, String message) {
        Intent intent = new Intent(context, activityClass);
        intent.putExtra(FcmConsts.EXTRA_FCM_MESSAGE, message);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    }
}

And call static method showNotification to show notifications like in the code below.

Show notifications

Of course, instead of App.getInstance you should pass a Context and instead of SplashActivity.class you should pass any Activity class from your application.

notification_title is your text from String resource which you can show in a notification message in a title space. You should use a drawable icon to show a picture in a notification message.

Next, you should add the following changes in the AndroidManifest.xml file.

Register PushListenerService and register QBFcmPushInstanceIDService.

Manifest service

You’re done !

Now that you’ve implemented these steps, your App is ready to receive and display push notifications. Got more questions? Contact support.

Want to learn more about building Android Apps? Check out our other tutorials:

How to Launch Android Chat an Webrtc Video Conferencing Samples
How to Build an Android Chat Application with Kotlin using QuickBlox SDK

Leave a Comment

Your email address will not be published. Required fields are marked *

Read More

Ready to get started?

QUICKBLOX
QuickBlox post-box