Blog

A while ago I downloaded a mobile app for sports updates, I was asked to confirm the use of push notifications within the app – and I did… The nightmare began when I started receiving push notifications in the middle of night regarding some girls volleyball team (no offense…) and a high school basketball team (yes…).

The average mobile user, although spending many hours a week using his/her smartphone, is not aware of the option of canceling the receiving of push notifications through the device's settings. In the good case – the user will delete the harassing app, but on the worst case and not so unlikely as you might think – having such a bad experience with push notifications will cause the user not to approve this feature for the next apps he/she will download, a big loss for many app developers.

The conclusion is that app developers share a mutual responsibility to one another when using this feature, and should consider that while using it in their apps. So how can you still use push notifications in a proper way which will increase your users' engagement and make them more active in your app?


8 Tips that will help you


1.       Take schedules in to consideration

Remember that we don't all live in the same time zone. When you send a notification NOW because it seems reasonable for you, half of the world is probably a sleep! Not to mention weekends that are not the same throughout the world.

 2.       Relevancy is the keyword

You can learn so many things from the users' behavior in your app – what are they interested in? When do they usually login? How frequently? Some apps even know their users' gender and age.

Take Ebay's mobile app for example – they saw I'm interested in computer gadgets, so they won't send me notification about books or sport events but they are going to send notifications regarding computers and gadgets and I'm going to approve of that – because it is relevant to my common use of the app.

 3.       Let the user decide

Decide what? Many news apps ask you to choose your categories of interest upon your first activation off the app, and will send breaking news that are relevant only to those categories.

Consider the difference between "We wanted to inform you that…" and "You asked us to inform you when…". Users appreciate it – so should you.

 4.       Same same – but different

I always like using this Thai phrase whenever I can, so why not?

There are some differences between iOS and Android notifications: maximum length of the notification ( 256 Bytes in iOS and 4KB in Android ), a custom title (Android only), images (Android only), badges (default in iOS, harder to use in Android) and more.

It's a shame not to use the advantages of each platform and to be aware to the disadvantages of it as well.

 5.       Surprise the users with the inner content

Treat the notification as the doorway to your app. Many apps just open the main screen after the notification and they miss the point of push – users that click on notifications are more prone to act in the app, give them something special that they are not used to see and increase your chances of gaining another click from them next time.

 6.       Learn from your last pushes

Unlike SMS for example – you can learn a lot from push notifications after sending them: what is your opening percentage? In what hours users tend to open the notifications more? On which platform? If you give this things enough consideration on your next pushes you are guaranteed to achieve better results.

 7.       Fit in your users' every day

What do I mean by that? Take Dominos Pizza's app for example. They don't send me notifications every day or on a fixed day – but they do before sport events and always with some special offer which is valid only for that evening.

 

8.       Send short notification which will drive the user for action

As you are limited in the iOS devices for 256 Bytes anyway, you should treat the push as a billboard that your users cross by very quickly. If it's short and tempting and you made them stop and take a look for example – you did your job.

 

 

Implementing even some of these tips might prove very helpful for your push performance. It might seem like a lot of work, but the good news is that many 3rd party push notifications services offer this features out of box, and in a low cost.

Such is PushApps – the push notification service where I work and offer many of this features for app developers and publishers.

 


 

Today, most Android applications are integrated with the option to send push notifications. Developers and app publishers consider this capability as one of the most important actions in maintaining the relationship with their users and the ability to motivate them into performing certain actions within the app. However, in most applications the display of push notification message is quite basic - a miniature version of the app icon, a title (most of the time it will be the app name), with a short description below it.



 

Push notification message can be much more interesting! One of the better examples for it, is the way in which Groupon send their push messages - big and seductive picture, with important details such as price and the amount of discount. They also display action buttons!



 In this tutorial we will learn how to create a rich push notification message.

Integrating Push Notifications in your app

 If your app doesn’t yet support in basic push notification, please refer to PushApps short tutorial:
 

https://wiki.pushapps.mobi/display/PUSHAPPS/Android+Getting+Started

This tutorial assumes you have completed the basic push notifications integration, and you are able to receive notifications to your device. We will take you step by step from this phase and show you how to code and design the notification.

Push Notification received event

After you register the device to PushApps with your private keys, we would like to “take control” over the push notification received event. We would like to perform certain actions and display our custom view. With PushApps it’s easy:


1. In you Application class (if you don’t have one, please create it) register to PushApps with your Google API Project Number and PushApps Token.

register to PushApps with your Google API Project Number and PushApps Token

2. We want PushApps to notify us when a new push notification received to the device. For that, we need to implement the PushAppsMessageInterface.

 

implement the PushAppsMessageInterface

Creating the custom view

 

The first step in building your own unique View, is writing the XML. There is nothing new in this section - exactly as we build a new view for an Activity or a Fragment, same is here. Like all other XMLs, this one will also should be placed inside the res / layout directory. In this tutorial, we’re creating a similar view as the one as Groupon. However, you can create any view you want, while the only limit is the view height - remember that this is not a full-screen view (but only shown in the Notification Center).

 

1. Creating the XML:

 

Creating the custom view - Creating the XML


2. We would like to link our new XML with our code, and of course update the view values (such as text and image) with those we received in the push notification JSON:

 

Creating the custom view - link our new XML with our code

 

Sending a Push Notification from the PushApps Admin Console

 

Sending a push notification from the PushApps Admin Console is very simple. You can learn a lot about it from our WIKI -
http://wiki.pushapps.mobi/display/PUSHAPPS/Admin+Console.

Please notice that the parameters keys that you provide in the Admin Console should match those in your Android code

 

Finally!

 

Some minor side notes:

  • Notice that this code is compatible for Android devices running API 11 version or higher. There are similar solutions for custom push notifications view for older devices - just google it.
  • If you Notification Center in your device is full with other push notifications from other apps, the push notification view will appear in its small and regular view (without the custom view). That’s why it’s important to provide the parameters for the regular state (e.g. Small Icon, Content Title, Content Text).

Checkout the entire source code from here.

Happy Coding!