I have followed the instructions here to the dot. (https://documentation.onesignal.com/v3.0/docs/phonegap-sdk-setup)
My goal is to send Push Notifications from a server (Firebase or OneSignal) to my Android device which I am testing on Chrome browser or PhoneGap test app.
I have added the following code to my onDeviceReady
function and it runs;
console.log("OneSignal is here!");
var notificationOpenedCallback = function(jsonData) {
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
alert("Received my notification");
};
// c02be63f-e777-4b99-8775-dec62efxxxxx is my APP ID
window.plugins.OneSignal
.startInit("c02be63f-e777-4b99-8775-dec62efxxxxx")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
window.plugins.OneSignal.setSubscription (true);
window.plugins.OneSignal.enableNotificationWhenActive(true);
However, after running, I get the following errors. Can someone please explain what this error means?
Error: exec proxy not found for :: StatusBar :: _ready
(index):365 OneSignal is here!
(index):365 Error: exec proxy not found for :: OneSignalPush :: setNotificationReceivedHandler
(index):365 Error: exec proxy not found for :: OneSignalPush :: setNotificationOpenedHandler
(index):365 Error: exec proxy not found for :: OneSignalPush :: init
(index):365 Error: exec proxy not found for :: OneSignalPush :: setSubscription
I have noticed the same error for every other new plugin I tried. This means something is wrong.
Here is my config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.upen.testing" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Testing</name>
<description>
A blank PhoneGap app.
</description>
<author email="support@phonegap.com" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<access origin="*" />
<gap:plugin name="onesignal-cordova-plugin" source="npm" spec="^2.2.4" />
<preference name="phonegap-version" value="cli-7.1.1" />
<preference name="android-build-tool" value="gradle" />
<preference name="android-minSdkVersion" value="15" />
<engine name="browser" spec="~5.0.1" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
<plugin name="onesignal-cordova-plugin" spec="~2.2.4" />
<plugin name="cordova-plugin-statusbar" spec="~2.3.0" />
<plugin name="cordova-plugin-fcm" spec="^2.1.2" />
<engine name="android" spec="~6.3.0" />
</widget>