Message:

Subscribe rss
Blog categories
All | Backendless features
Integrating Push Notifications into a Dropsource Project
December 14, 2018 by markpiller

Dropsource is an online platform for developing Android and iOS applications without coding. The platform also lets you download the source code for your app so you can make any changes to it and subsequently publish into the app store (note: downloading the source code is a paid option). If you’re looking to add support for push notifications to your Dropsource apps, Backendless fits right in with a relatively simple integration. When you add Backendless Push Notifications, you can instantly benefit from the following features:

  • Personalized push notification content – each recipient of your push notifications can see customized content.
  • Programmable action buttons with support for inline replies.
  • Customizable images and icons in the payload and rendering of push notifications.
  • Automatic push notification cancellation – self-destructed notifications.
  • Dynamic audience targeting – the audience of the published notifications can be customized with a query.

The video below includes a demonstration of an Android Dropsource app integrated with Backendless Push Notifications followed by a detailed overview of the actual integration process. The integration instructions are outlined in detail in this post following the video.

Integration Instructions

  1. Download the source code for your Dropsource app and open the project in Android studio.
  2. Make sure you can build the project. If the build process results in the following error:

    Navigate to the Android Studio properties, select Build, Execution, Deployment, then Compiler. Disable the Configure on demand option:
    disable-configure-on-demand
  3. Add Firebase to your project. This is required to enable FCM (Firebase Cloud Messaging), a service by Google which delivers push notifications to Android apps. Check the video for instructions starting at 12:01. Most importantly, this step includes:
    1. Adding google-services.json to the /app directory of your project
    2. Adding the following two dependencies into the dependencies element of  /app/build.gradle:
    3. Adding the following two lines at the bottom of  /app/build.gradle:
  4. Register FCM server key with Backendless. You can see this step in the video at 17:46.
  5. Add the Backendless dependency to your project. The simplest way to do this is by adding the following line to the  dependencies element of  /app/build.gradle: (you can check the latest version number of the Backendless SDK in the Maven Central repository):
  6. Register the Backendless Push service in Android manifest. Add the following configuration into the application element of your app’s AndroidManifest.xml file:
  7. Initialize Backendless SDK in your application. This code needs to be executed once, it makes sense to put it right into the main activity of the app. In the video the code is added in the setup() method of the DeviceRegistration activity:

    The YOUR-BACKENDLESS-APPLICATION-ID and YOUR-ANDROID-API-KEY values can be obtained from the main dashboard of your app in Backendless Console.
  8. If your Dropsource project includes user login AND if the login occurs before the device is registered with Backendless, add the following code:
  9. Register device with FCM and Backendless. The code below uses the dropsourcechannel messaging channel. If you registered the FCM server key with a specific channel (step #4 above), the channel must match. Otherwise, if the FCM server key is registered for all channels, then you can register the device with any channel – you can use the channel name for the logical grouping of the registered devices:
  10. Run the app and send push notifications from Backendless. For an overview of Backendless Push notifications capabilities, see the overview video. More information about Backendless Push Notifications is also available in the developer guide.
Share this post
Tweet about this on TwitterShare on FacebookGoogle+