android-mesosfer-integration

How to Send Push Notification Android Mobile Apps from Mesosfer Backend as a Service

This tutorial is about How to Send Push Notification Android Mobile Apps from Mesosfer Backend as a Service.

Introduction

This Tutorial is the last session of Android Mobile Apps series. In this tutorial you will be required some dependency source code you created in the previous session. In this session, we’ll create module to send push notification Android Mobile Apps from Mesosfer Backend as a Service.

Prerequisites

To follow this tutorial, you will need to prepare these items below :

  • Sign up for an account in Mesosfer Backend as a Service.
  • Install latest android studio. In this tutorial, the author used android studio version 2.2.1
  • Download code from previous section.

Getting Started

In this session we will create a simple push notifications that will be delivered to the mobile android. The Mesosfer Android SDK chooses a reasonable default configuration so that you do not have to worry about GCM registration ids, sender ids, or API keys. In particular, the SDK will automatically register your app for push at startup time using the mesosphere’s sender ID (523325046971) and the resulting registration will store the ID in the deviceToken field of the app’s current MesosferInstallation.

To be able to receive push notifications from Mesosfer Backend, you have to do some configurations. First, add the Mesosfer.SetPushNotification to the class MesosferApp.

how-to-send-push-notification-android-mobile-apps-from-mesosfer-backend-as-a-service-mesosfer-set-pushnotification

Go to AndroidManifest.xml, add some permissions.

Then add receiver in the tag application.

Reinstall your apps and then you will see that your data installation is added.

how-to-send-push-notification-android-mobile-apps-from-mesosfer-backend-as-a-service-installation-bucket

For the next, we will try to deliver push to the user with apps you just made installed. Go to menu push and insert message you want to show.

how-to-send-push-notification-android-mobile-apps-from-mesosfer-backend-as-a-service-send-push

Here is the result in mobile apps after push button is clicked.

how-to-send-push-notification-android-mobile-apps-from-mesosfer-backend-as-a-service-result-push

Data history of your push notification will be saved in Past Pushes.

how-to-send-push-notification-android-mobile-apps-from-mesosfer-backend-as-a-service-past-push

Everything is done! Download full version code here.

Conclusion

We have created module to send push notification from Mesosfer Bucket. Very simple and quick, isn’t it? You do not have to worry about GCM registration ids, sender ids, or API keys, All of them have been handled by Mesosfer. Mesosfer helps you connect your project to the cloud. Cut off the development process so you can straight into the delivery process instead stumble on the complicated infrastructure.

Having more than 5 years experience in IT Consultant with the last position as Backend as a Service Developer and has an experience in planning, implementing IT Information System.