i'm adding urban airship push notifications android app. custom broadcastreceiver
receiving notifications when send test push. here's onreceive()
method.
public class intentreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { if(intent == null) return; string action = intent.getaction(); if (action.equals(pushmanager.action_push_received)) { int id = intent.getintextra(pushmanager.extra_notification_id, 0); //breakpoint here log.w("my app", "received push notification. alert: " + intent.getstringextra(pushmanager.extra_alert) + " [notificationid="+id+"]"); logpushextras(intent); } else if (action.equals(pushmanager.action_notification_opened)) { //other stuff here }
execution stops @ breakpoint (position shown in comment) , details logged.
no notification shown in notification area though. in other app ua push notifications, think did, doesn't seem working time.
i suspect i've done wrong in manifest file or i've forgotten implement class somewhere.
any ideas?
extra info
extended application:
public class extendedapplication extends application { public void oncreate(){ airshipconfigoptions options = airshipconfigoptions.loaddefaultoptions(this); uairship.takeoff(this, options); pushmanager.enablepush(); pushpreferences prefs = pushmanager.shared().getpreferences(); log.e("my app", "my application oncreate - app apid: " + prefs.getpushid()); pushmanager.shared().setintentreceiver(intentreceiver.class); } }
edit
i've tried adding
pushmanager.shared().setnotificationbuilder(new basicpushnotificationbuilder());
to extendedapplication suggested in this post.
i sending test push blank "alert" field ua site. tried text in there , works. don't know why, don't think that's should fail silently.
moral of story: don't leave alert field blank.
Comments
Post a Comment