[Webinar] Streamline your web hosting managementRegister Today

  • Status: Open
  • Priority: Low
  • Security: Public
  • Views: 25
  • Last Modified:

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.app.Application;
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.support.v7.app.AppCompatActivity;
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(R.id.webView);

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

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

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now