Я создал файл OneSignalNotificationExtender. java в
node_modules \ onesignal-cordova-plugin \ src \ android \ com \ plugin \ gcm \ OneSignalNotificationExtender. java
со следующим кодом:
import com.onesignal.OSNotificationReceivedResult;
import com.onesignal.NotificationExtenderService;
public class OneSignalNotificationExtender extends NotificationExtenderService {
@Override
protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) {
return false;
}
}
Это мой AndroidManifest. xml на
платформах \ android \ app \ src \ main \ AndroidManifest. xml
<service android:exported="false" android:name=".OneSignalNotificationExtender" android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
<action android:name="com.onesignal.NotificationExtender" />
</intent-filter>
</service>
Мое приложение теперь падает, когда получает уведомление. Ниже мое сообщение об ошибке:
java.lang.RuntimeException: Unable to instantiate service io.SMECS.us.OneSignalNotificationExtender: java.lang.ClassNotFoundException: Didn't find class "io.SMECS.us.OneSignalNotificationExtender" on path: DexPathList[[zip file "/data/app/io.SMECS.us-0MNYrvhTOW1AK21u2PKJIA==/base.apk"],nativeLibraryDirectories=[/data/app/io.SMECS.us-0MNYrvhTOW1AK21u2PKJIA==/lib/arm64, /data/app/io.SMECS.us-0MNYrvhTOW1AK21u2PKJIA==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]