Sonia
Sonia

Reputation: 23

Urban Airship notification does not be shown in android device while message is being received

I have integrated the urban airship library to an android project. My problem is that I try to send a message via test push notification in urban airship dashboard. While I see in logcat -> Received push message: Bundle[{com.urbanairship.push.ALERT=bla blaba etc which means that I receive the message no notification dialog is being shown. What am I doing wrong? Moreover, I have added the intent receiver class and tried to add a custom notification dialog but nothing worked. On IntentReceiver class the function that is being called is

protected void onBackgroundPushReceived(Context context, PushMessage message)

but not

onPushReceived(Context context, PushMessage message, int notificationId)

Thanks.

Upvotes: 1

Views: 1675

Answers (1)

android_Muncher
android_Muncher

Reputation: 1057

        //Change your UAirship.takeoff() to this :

        //Urban Airship
         AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(getApplicationContext());

        // Take off initializes the services
        UAirship.takeOff(this, options); 
        UAirship.shared().getPushManager().setUserNotificationsEnabled(true);

  //From this

  UAirship.takeOff(this, new UAirship.OnReadyCallback() { 
     @Override public void onAirshipReady(UAirship airship) { 
             // Perform any airship configurations here 
             airship.getPushManager().setPushEnabled(true); 
   }); 

Upvotes: 4

Related Questions