我按照这里的指示点。 (https://documentation.onesignal.com/v3.0/docs/phonegap-sdk-setup)没有任何插件可以在Cordova/PhoneGap Android混合移动应用程序中加载。怎么解决?
我的目标是将推送通知从服务器(Firebase或OneSignal)发送到我在Android设备上进行测试的Chrome浏览器或PhoneGap测试应用程序。
我已将下面的代码添加到我的onDeviceReady
函数中并且它运行;
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);
但是,运行后,我得到以下错误。有人可以解释这个错误的含义吗?
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
我注意到我试过的每个其他新插件都有同样的错误。这意味着有些事情是错的。
这是我3210
<?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="[email protected]" 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>
看到我的[回复](https://stackoverflow.com/questions/39066959/check-internet-connection-in-android-webview-cordova/39211383#39211383)快速指南科尔多瓦安装。 –
我已经安装了Cordova/PhoneGap/Node.js - 一切正常。除了在测试项目中加载的插件得到这个exec ...错误。 – Zac
我认为问题出在 。尝试下载并使用 –