我的应用程序当前正在从 Firebase 控制台接收文本、图像以及两者作为推送通知。我也想从 Firebase 控制台向应用用户发送一个 URL 作为通知。单击通知时。用户将被重定向到特定的 URL,例如。www.google.com如何在以下代码中执行此操作?
package com.example.khan.andronotification;
/**
* Created by AndroidBash on 20-Aug-16.
*/
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "FirebaseMessageService";
Bitmap bitmap;
/**
* Called when message is received.
*
* @param remoteMessage Object representing the message …Run Code Online (Sandbox Code Playgroud) 我的应用程序当前正在接收来自Firebase控制台的文本,图像和两者作为推送通知.我也希望将来自我的Firebase控制台的通知发送给应用用户.点击通知后,用户将被重定向到特定的网址,即www.facebook.com.如何在以下代码中执行此操作? 请看这个我想要的图像
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "FirebaseMessageService";
Bitmap bitmap;
/**
* Called when message is received.
*
* @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
*/
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// There are two types of messages data messages and notification messages. Data messages are handled
// here in onMessageReceived whether the app is in the foreground or background. Data messages are the type
// …Run Code Online (Sandbox Code Playgroud)