I have a requirement where I want to send push notifications to the user.
For example
the app will have 2 users. If user 1 send a friend request to user 2 then user 2 should get a notification like " You got friend request from user 1" and when user 2 clicks on that notification he should able to see the user 1 profile.
I know how to do all these with the activities but here I am using web view, so please help me to solve with this. Any help is appreciable.
You can always access your Java code trough javascrtipt running on the web page your WebView is presenting. You can define a Java method (which sends the notification through your backend) and call it from your custom javascript.
Take a look at https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With