Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- public void onMessageReceived(RemoteMessage remoteMessage) {
- Intent intent = new Intent(this, ActivityQuePodeIniciarAberturaDeLink.class);
- intent.putExtra( "URL", remoteMessage.getData().get("link") );
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
- // .setSmallIcon( R.drawable.qualquer_icone )
- .setTicker( "Abrir URL" )
- .setContentTitle( "Abrir URL" )
- .setContentText( "Abrir URL no YouTube" )
- // .setLargeIcon( bitmapQualquer )
- .setContentIntent( pendingIntent );
- NotificationManager notifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- notifyManager.notify( 0, builder.build() );
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement