Tag: cordova

Phonegap PushPlugin重置徽章后打开应用程序

从后台input应用程序后,如何防止PushPlugin将徽章计数重置为0?

如何在iOS Phonegap应用程序中显示自定义的飞溅屏幕微调(即微调白色)?

是否有可能将默认的初始屏幕微调颜色更改为白色?

从手机重新启动设备

有没有办法用phonegap / cordova重新启动设备? 我怎么去做这个? 我认为它可能不可能在iPad / iPhone上,但它会在Android上。

为什么PhoneGap看起来比Titanium更快?

我试图衡量一些跨平台解决scheme的执行性能,其中包括:Titanium和PhoneGap。 所以这里是我的性能testing器的titanium版本的一个例子,它非常简单,但我只是想了解我的代码执行速度有多快: var looplength; var start1; var start2; var end1; var end2; var duration1; var duration2; var diff; var diffpiter; var power; var info; for (power = 0; power < 24; power++) { looplength = Math.pow(2, power); start1 = new Date().getTime(); for (iterator = 0; iterator < looplength; iterator++) {a=iterator;b=iterator;} end1 = new Date().getTime(); start2 […]

HTML5 Web SQL数据库问题

我公司目前正在过渡到一个新的架构,以及为移动设备提供服务的模型。 我们的应用程序传统上是基于Web的( HTML5 / CSS3 / JS / PHP / MYSQL ),所以我们希望能够将其移植到移动平台上,而不必重新发明轮子( Cordova ),以及独立的桌面AppJS ),以便我们不必担心浏览器相关的错误。 我们也正在从PHP过渡到NodeJS ,使这更加可行。 问题是我们的用户需要离线使用我们的应用程序的能力,在将其“同步”到我们的服务器之前它们可以存储多长时间或多less数据没有实际的限制。 使用AppJS,这不是一个问题,因为它们可以在sqlite数据库中存储所需的数据。 不过,我已经发现了关于WebSQL数据和cordova / phonegap的5MB配额的问题。 这对我们的业务需求提出了明显的技术挑战。 我知道有几个插件可以让你使用sqlite数据。 最初的sqlite插件(https://github.com/davibe/Phonegap-SQLitePlugin)缺lessandroid的文档,另一个(https://github.com/chbrody/Cordova-SQLitePlugin)要求我指定一个数据限制显然是不可能的。 因此,我只剩下很less的select,一个是将数据库拆分成由JS包装器控制的多个5MB段。 你可以将大型的数据结构拆分成多个5MB的websql数据库吗?在iOS和Android上没有问题? 在iOS和Android上的websql数据库总数是否有限制? 有没有其他的select,你会build议我们看看? 我们需要能够使用我们现有的HTML5和CSS的前端! 编辑 我们原来的架构从来没有真正与平板设备。 这是我们正在寻求纠正与cordova,以及build立一个更稳定的解决scheme。 最初,我们的离线产品运行在Server2Go堆栈上,由于各种应用程序在客户端计算机上运行,​​存在各种平台问题

离子Cordova使用Media插件在IOS上录制audio失败

我在离子应用程序上工作,我需要loggingaudio文件,所以我用cordova插件媒体,它工作正常的Android,但是当我尝试了它的ios我得到这个错误: {“message”:“无法使用AVAudioRecorder开始录制”,“code”:1} 这里是我的代码: var extension = '.wav'; var name = 'filename'; var audio = null; var filepath; $scope.startRecording = function() { name = Utils.generateFilename(); if(device.platform == "iOS") { //var path = "documents://"; //var path = cordova.file.documentsDirectory; //var path = cordova.file.cacheDirectory; var path = cordova.file.dataDirectory; path = path.replace("file:///", "cdvfile://"); } else if(device.platform == "Android") { var […]

iOS上的Phonegap 3.5媒体插件错误“无法使用AvAudioRecorder开始录制”

我正在尝试让用户在Phonegap应用程序中录制audio文件。 它在Android上运行良好,但在iOS上,当录制开始时,出现以下错误: “无法使用AvAudioRecorder开始录制”。 我使用.wav文件名,我首先创build文件,我已经按照我find的所有说明,我不断收到错误。 这是一段代码: theFileSystem.root.getFile(filename,{create:true},function(fileEntry){ mediaFileURL = fileEntry.toURL(); console.log('Created file ' + mediaFileURL); mediaRec = new Media(mediaFileURL, function(){ //console.log('Media File created'); }, function(err){ alert('Error creating the media file: ' + err.message); console.log(mediaFileURL); for(k in err){ console.log(k + ': ' + err[k]); } stopRecordingFile(); }); mediaRec.startRecord(); },function(err){ alert("Error setting audio file"); }); 我看到控制台消息“Created file …”,所以文件成功创build。 […]

钩子文件夹中使用节点脚本时的cordova插件安装问题

cordova3.4挂钩没有正确安装在iOS提到的插件。 我将install_plugins.js添加到其中包含以下代码的文件夹project/project_root/hooks/after_platform_add中: #!/usr/bin/env node //this hook installs all your plugins // add your plugins to this list–either the identifier, the filesystem location or the URL // It can also be git url like "https://github.com/chrisekelley/AppPreferences/" var pluginlist = [ "org.apache.cordova.camera", "org.apache.cordova.console", "org.apache.cordova.contacts", "org.apache.cordova.device", "org.apache.cordova.dialogs", "org.apache.cordova.file", "org.apache.cordova.file-transfer", "org.apache.cordova.geolocation", "org.apache.cordova.globalization", "org.apache.cordova.media", "org.apache.cordova.media-capture", "org.apache.cordova.network-information", "org.apache.cordova.splashscreen", "org.apache.cordova.statusbar" ]; // no […]

Cordova-Plugin-Contacts无法删除联系人字段

我正在从系统中检索所有联系人,如下所示: navigator.contacts.find(["*"], function (contacts) {}); 然后我从数组中select一个联系人(例如var myContact = contacts[4]; )。 联系人有两个或更多电话号码字段。 联系人对象的缩短版本: { phoneNumbers: [ {id: 0, type: "work", value: "123123123"}, {id: 1, type: "home", value: "3216532425"} ] } 当我从phoneNumbers数组中删除两个联系人字段之一,然后保存联系人,它仍然有设备上的两个号码。 当我重新检索联系人时,它又有两个数字。 (使用插件版本2.0.1在iOS 9.3上testing)如果我做错了什么或者插件是否行为错误,我在文档中找不到任何提示。 我创build了一个演示脚本,它重现了这个问题。 您可以使用它进行testing: http : //pastebin.com/XRdREL3Y 您可能需要删除第25行,最后删除testing联系人。 演示脚本的缩短版本: navigator.contacts.find(["*"], function (contacts) { // Pick a contact // (Make sure the contact has more […]

Phonegap / cordova命令行给出代码签名错误,xcode工作正常。 (IOS)

input命令时 phonegap run ios 我得到以下错误: === BUILD TARGET F-Securities OF PROJECT F-Securities WITH CONFIGURATION Debug === Check dependencies Code Sign error: No code signing identities found: No valid signing identities (ie certificate and private key pair) matching the team ID “XXXXXXXX” were found. CodeSign error: code signing is required for product type 'Application' in SDK […]