Open android app from PUSH notification

前端 未结 4 1390
独厮守ぢ
独厮守ぢ 2021-02-06 02:41

Got a little problem that\'s been bugging me..

I\'ve set up my application to receive PUSH notifications from Urban Airship and that all works fine, but when I tap on a

4条回答
  •  被撕碎了的回忆
    2021-02-06 03:39

    you have to call pendingIntent before call .setAutoCancel(true);

    look at my builder :

        NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(),channel_id).setSmallIcon(R.drawable.logo).setSound(uri).setVibrate(new long[]{1000,1000,1000,1000,1000})
                .setOnlyAlertOnce(true).setContentIntent(pendingIntent).setAutoCancel(true);
    

提交回复
热议问题