[英]Android phonegap/cordova app works in emulator but not on phone
I'm currently working on a phonegap/cordova 3.0 application with some friends which is supposed to have functionality which allows it to store reminders for future events and remind users when these events are approaching. 我目前正在与一些朋友一起使用phonegap / cordova 3.0应用程序,该应用程序应该具有允许其存储将来事件的提醒并在这些事件临近时提醒用户的功能。 I have installed the localNotification plugin (by Sebastián Katzer) in the phonegap app via the command line.
我已经通过命令行在phonegap应用程序中安装了localNotification插件(由SebastiánKatzer开发)。 I have cut my code down to a minimum and when it is run on an emulated device on my computer it works fine (Its just supposed to make a notification appear in the notifications tray at the moment) but when I install the app on a phone it doesn't work (it doesn't throw any errors either).
我已将代码缩减到最低限度,并且当它在计算机上的模拟设备上运行时,它可以正常工作(它只是应该使通知此时出现在通知托盘中),但是当我在手机上安装该应用程序时它不起作用(也不会引发任何错误)。 Here's my code I'd appreciate if anyone could give me any help/advice!
如果有人可以给我任何帮助/建议,这是我的代码,我将不胜感激!
<html>
<head>
<title>Test Storing Events</title>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
function addEvent()
{
window.plugin.notification.local.add({ message: 'Great app!' });
}
</script>
</head>
<body>
<h1>Apache Cordova</h1>
<input type="button" onclick="addEvent()" style="width: 100px; height: 100px;" value="Click me">
</body>
Hopefully this isn't too late. 希望这还不算太晚。 I have had problems with this plug-in recently.
我最近在使用此插件时遇到了问题。 To start with, look in logcat (I assume you have the Android tools installed so can run "adb logcat" at the command line).
首先,查看logcat(我假设您已安装Android工具,因此可以在命令行中运行“ adb logcat”)。 You will probably find Android is logging that no icon has been specified.
您可能会发现Android正在记录未指定图标的情况。 Older versions of Android chose one anyway but the version I had at one point (4.3 possibly) would simply beep and log the error.
无论如何,较旧的Android版本还是选择了一个版本,但是我在某一时刻拥有的版本(可能为4.3)只会发出哔哔声并记录错误。
Just try an earlier version of this plugin by specifying the version number in the config.xml setup. 只需在config.xml设置中指定版本号,即可尝试使用该插件的较早版本。 "version="0.7.0" works for me
“ version =” 0.7.0“对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.