Ich habe android-anwendung erstellt und ich benachrichtigung an eine bestimmte person mit firebase server. Hilf mir bitte.wie man fire base console in android app anrufen und senden an benachrichtigung in bestimmten benutzer app (device-fire base-gerät)
My code is:
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG="MyMessageservice";
RemoteMessage remoteMessage;
@Override
public void onMessageReceived(RemoteMessage remoteMessage){
String title=remoteMessage.getNotification().getTitle();
String message=remoteMessage.getNotification().getBody();
String lick_action=remoteMessage.getNotification().getClickAction();
Intent intent=new Intent(click_action);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
Uri notificattionSound= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationbuilder = new NotificationCompat.Builder(this);
notificationbuilder.setContentTitle(title);
notificationbuilder.setContentText(message);
notificationbuilder.setAutoCancel(true);
notificationbuilder.setSound(notificattionSound);
notificationbuilder.setSmallIcon(R.drawable.ic_launcher);
notificationbuilder.setContentIntent(pendingIntent);
notificationbuilder.setAutoCancel(true);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, notificationbuilder.build());
}
Haben Sie einen Fehler? –
nein, wie man Gerät zu Gerät Benachrichtigung sendet – Anbu
Es ist möglich ..? – Anbu