Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Smarter App Notifications With OpenBack

DZone's Guide to

Smarter App Notifications With OpenBack

The OpenBack SDK offers a framework for you to tailor your in-app notifications to users' contexts with features like intelligent routing.

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Notifications: you probably love them or hate them. I like them when they are useful to me, and this is something that the OpenBack SDK attempts to solve. It offers a framework for you to make your in-app notifications more than annoying notices, but tailoring them to users contexts and allowing them to do more with notifications.

The latest versions of both major mobile operating systems now offer more interactive notifications, but OpenBack builds on these and adds more to them with features such as intelligent routing, A/B testing and notifications dependent on device types. Much of the feature set is aimed squarely and marketing and sales folks, with integrations for tracking effectiveness, direct CRM connections, and personalisation. Features that many of us will love to hate, but are effective.

OpenBack works on iOS and Android, but I will use Android as an example for the rest of the post, hopefully, you can figure out how to transfer to iOS.

Set Up Your Campaign and Triggers

The first step is to create an app on the OpenBack dashboard that will match the app you create in Android Studio or Xcode. They key values to set are the package name, your Firebase cloud messaging key (for Android only), and what monitors to enable and how frequently they should check for updates.

OpenBack App Dashboard

Next, create a campaign, selecting a time span and the app that you will use for the campaign.

Campaign screen 1

On the next screen, you set the notification type you want to send and the text it contains.

Campaign screen 2

Finally, select the context triggers that will trigger the notification; for this example, I will select unlock as it’s the easiest to test.

Campaign screen 3

Add OpenBack to Your Project

You can find instructions for adding the OpenBack library to your application for iOS and Android. The library includes many of the permissions and dependencies you will need pre-configured, so you have to do minimal setup to get started.

Depending on the triggers you decide to use, it’s important to note and set the correct permissions, receivers, or intents for your application; for example, internet or location permissions, or the notifications won’t reach users devices.

For my Android unlock example, I need to add the following to the AndroidManifest.xml file:

<receiver android:name="com.openback.OpenBackReceiver" android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.USER_PRESENT" />
    </intent-filter>
</receiver>

And in MainActivity I simply start OpenBack:

…
@Override
protectedvoidonCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Contextcontext=getApplicationContext();

UserInfoExtrauserInfoExtra=newUserInfoExtra();
userInfoExtra.OptInUpdates="true";
// Initialize OpenBack 
try{
OpenBack.start(newOpenBack.Config(context)
        .setExtraUserInfo(userInfoExtra)
            .setUserEmail("test@openback.com"));
}catch(OpenBackExceptione){
e.printStackTrace();
}
  …
}

Start the app, and voila, as soon as the phone unlocks, the notification is displayed.

Notification

Looking through the list of context triggers, other ideas for updating users might be:

  • When a user passes a certain location.
  • When the weather changes to suit a particular item of clothing.
  • When a user starts roaming or changes mobile networks.
  • When it’s a user's birthday.

And that’s about it! Of course, all mobile operating systems include their own functionality for creating notifications, but for marketing style notifications OpenBack gives you and easy and quick way of controlling what you want to send to applications without having to write or change much code. For these use cases, it’s an ideal tool to keep your users informed about information that hopefully interests them.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:
ios ,android ,notifications ,mobile ,mobile app development

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}