How to redirect to Android app/play store from an Android notification of a Facebook Request?

1.1k Views Asked by At

I have an android app, from where a user can invite facebook friends to join. I have that part working fine. I used Requests API and did everything as facebook says it should be done.

However, the problem is that when the other user receives the Facebook notification, it triggers an Android Notification (at the top bar), but when this android notification is clicked NOTHING happens. If the user goes to the facebook app, and taps the notification, it sends him to the play store or app. I need the android notification to do the same. What am I missing?

1

There are 1 best solutions below

2
ii7scw On

To get redirected form clicking on notification you should use

    Intent intent = new Intent(this,*YourClass.class);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent ,PendingIntent.FLAG_UPDATE_CURRENT);
    notification.setContentIntent(pendingIntent)

Explained here: TheNewBoston