Reputation: 15744
I'll explain the situation step by step
I've implemented urban airship following the guide
When a message comes from server my app shows a notification automatically which is what I don't want
What I want is to handle the message comes from the server and be able to show my notification manually
In order to do that I've added broadcastreceiver as documentation says and it works
However now my app shows 2 notification at the same time
I could not disable the notification which appears by the system automatically
Upvotes: 1
Views: 91
Reputation: 15744
in order to solve the problem
Create a custom NotificationFactory
set it like below
UAirship.takeOff(this, options, new UAirship.OnReadyCallback() {
@Override
public void onAirshipReady(UAirship airship) {
airship.getPushManager().setUserNotificationsEnabled(true);
airship.getInAppMessageManager().setDisplayAsapEnabled(true);
UrbanAirNotificationFactory factory = new UrbanAirNotificationFactory(getApplicationContext());
airship.getPushManager().setNotificationFactory(factory);
}
});
Upvotes: 2