Problems with Push Notifications using Wordpress+OneSignal+Android

Hi there,

How do I open Push Notificstions sent from my Wordpress Blog via OneSignal in the Android App and not in the browser?
This topic keeps me busy but I cannot seem to find the correct solution.

I came across this code here but its not working either

import android.content.Intent;
import android.util.Log;
import com.onesignal.OSNotificationAction;
import com.onesignal.OSNotificationOpenResult;
import com.onesignal.OSNotification;
import com.onesignal.OSNotificationPayload;
import com.onesignal.OneSignal;
import org.json.JSONObject;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class Activity1 extends AppCompatActivity {

    protected void onCreate(Bundle savedInstanceState) {

        WebView webview = (WebView) findViewById(;

                .setNotificationOpenedHandler(new ExampleNotificationOpenedHandler())
    private class ExampleNotificationOpenedHandler implements OneSignal.NotificationOpenedHandler {
        public void notificationOpened(String message, JSONObject additionalData, boolean isActive) {
            if (additionalData != null && additionalData.has(""))

Open in new window

The error message is
Error:(31, 13) error: Activity1.ExampleNotificationOpenedHandler is not abstract and does not override abstract method notificationOpened(OSNotificationOpenResult) in NotificationOpenedHandler
Error:(34, 17) error: cannot find symbol variable webView
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.