Skip to content

Commit 2c069cf

Browse files
committed
Remove OSNotificationOpenedHandler from NotificationServiceExtension
* Add setNotificationOpenedHandler on Example App * Remove OSNotificationOpenedHandler from NotificationServiceExtension to avoid user confusion
1 parent 89a0bc6 commit 2c069cf

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Examples/OneSignalDemo/app/src/main/java/com/onesignal/sdktest/application/MainApplication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.util.Log;
55

66
import com.onesignal.OSNotification;
7+
import com.onesignal.OSNotificationOpenedResult;
78
import com.onesignal.OneSignal;
89
import com.onesignal.sdktest.R;
910
import com.onesignal.sdktest.constant.Tag;
@@ -31,6 +32,9 @@ public void onCreate() {
3132
OneSignal.setAppId(appId);
3233
OneSignal.initWithContext(this);
3334

35+
OneSignal.setNotificationOpenedHandler(result ->
36+
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, "OSNotificationOpenedResult result: " + result.toString()));
37+
3438
OneSignal.setNotificationWillShowInForegroundHandler(notificationReceivedEvent -> {
3539
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, "NotificationWillShowInForegroundHandler fired!" +
3640
" with notification event: " + notificationReceivedEvent.toString());

Examples/OneSignalDemo/app/src/main/java/com/onesignal/sdktest/notification/NotificationServiceExtension.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
import com.onesignal.sdktest.R;
1111

1212
public class NotificationServiceExtension implements
13-
OneSignal.OSRemoteNotificationReceivedHandler,
14-
OneSignal.OSNotificationOpenedHandler {
13+
OneSignal.OSRemoteNotificationReceivedHandler {
1514

1615
@Override
1716
public void remoteNotificationReceived(Context context, OSNotificationReceivedEvent notificationReceivedEvent) {
@@ -33,8 +32,4 @@ public void remoteNotificationReceived(Context context, OSNotificationReceivedEv
3332
notificationReceivedEvent.complete(mutableNotification);
3433
}
3534

36-
@Override
37-
public void notificationOpened(OSNotificationOpenedResult result) {
38-
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, "OSNotificationOpenedResult result: " + result.toString());
39-
}
4035
}

0 commit comments

Comments
 (0)