I'm trying to open up a browser page to a specific url after the user opens an FCM Push Notification they've received. This is the code I currently have:
import android.content.Intent;
import android.net.Uri;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
public class FMMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);
}
}
On tapping the push notification from the FCM console, nothing happens. I've messed around with this for a while, looking for solutions online, but nothing seems to work.
Please can someone help with this issue?
Take note, I am incredibly new to this and don't understand a whole lot.