OneSignal / OneSignal-Cordova-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Other
251 stars 197 forks source link

Android NotificationServiceExtension #776

Open alextapia007 opened 2 years ago

alextapia007 commented 2 years ago

Description:

when trying to implement NotificationServiceExtension throw errors: cannot find symbol import com.onesignal.OSMutableNotification;

symbol: class OSMutableNotification location: package com.onesignal

cannot find symbol import com.onesignal.OSNotificationReceivedEvent;

symbol: class OSNotificationReceivedEvent location: package com.onesignal

cannot find symbol import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler;

symbol: class OSRemoteNotificationReceivedHandler location: class com.onesignal.OneSignal

Environment

Cordova CLI : 9.0.0 Cordova-Android v9.1.0 NodeJS : v16.13.0 npm : 7.24.0 OS : macOS Monterey plugin version: onesignal-cordova-plugin 2.11.3

Steps to Reproduce Issue:

  1. Add the onesignal-cordova-plugin (2.11.3) to your project
  2. Add android platform
  3. Add new java file with the code from : https://documentation.onesignal.com/docs/service-extensions#android-notification-service-extension
  4. Compile.
alextapia007 commented 2 years ago

using the last sdk solve the problem, but: how do i know if it work well? WhatsApp Image 2022-03-23 at 1 50 57 PM if i cant see any change? im using the axemple code from https://documentation.onesignal.com/docs/service-extensions#notification-extender-service