Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onMessageReceived(RemoteMessage remoteMessage){
- super.onMessageReceived(remoteMessage);
- getimage(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());
- }
- public void getimage(String title,String message){
- NotificationCompat.Builder builder=new NotificationCompat.Builder(this,"mynotification")
- .setContentTitle(title)
- .setLargeIcon(BitmapFactory.decodeResource(this.getResources(),
- R.drawable.otplogo
- ))
- .setSmallIcon(R.drawable.otplogo)
- .setAutoCancel(true)
- .setContentText(message);
- NotificationManagerCompat manager =NotificationManagerCompat.from(this);
- manager.notify(999,builder.build());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement