通知を送信するためにFirebaseを使用するアプリケーションがあります。 Iそれらを送信し、通知が現れた場合、スタイルが提供されていますが、私はそれが意図しない]をクリックし、代わりの私にそれをやったときに通知の残りは、また通知の意図が私のURLに従わない
Notification notification = new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(R.drawable.lascanadaslogo)
.setContentTitle("Titulo")
.setContentIntent(pi)
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle().bigText(remoteMessage.getNotification().getBody()))
.build();
が記述されていないようそれは私のアプリ(メインページ)にそれを行います。私はあなたの全体のコードを示しています。
public class MyFirebaseMessagingService extends FirebaseMessagingService{
private static final String TAG = "FCM Service";
/**
* Called when message is received.
*
* @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
*/
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.lascanadas.es/reservas"));
PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, 0);
Notification notification = new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(R.drawable.lascanadaslogo)
.setContentTitle("Titulo")
.setContentIntent(pi)
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle().bigText(remoteMessage.getNotification().getBody()))
.build();
NotificationManager notificationManager2 = (NotificationManager) getApplicationContext().getSystemService(Service.NOTIFICATION_SERVICE);
notificationManager2.notify(0, notification);
//Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
}
}
ありがとうございました!私はサーバーとしてラズベリーを持っています。私はそれに使用しなければならないプログラムはどれですか? –
@Jorge。私は確かにそのための簡単な選択肢があることを知っています。私はあなたにそれを手伝ってくれるでしょう。 'johnnnoni @ gmail.com'。長い議論はコメントではお勧めしません。私のメールを使ってください。 – Xenolion