简体   繁体   English

是否可以在phonegap中永久保存Windows Phone 8仿真器上的联系人

[英]is it possible to save contacts on windows phone 8 emulator permanently in phonegap

Hi i'm unable to save the contacts in my windows phone 8 emulator permanently.contacts are saving just for a temporary period in people app.when i open that emulator and save contacts in it. 嗨,我无法将联系人永久保存在Windows Phone 8模拟器中。联系人只是在People app中暂时保存。当我打开该模拟器并在其中保存联系人时。 They are getting saved but when i close that emulator and again reopened..no any contacts are showing in that people app .I want to import that contacts in my app for sending some info.but i cant proceed as its not showing any contacts in it.I gone through phonegap tutorial tried this code also. 他们正在保存,但是当我关闭该模拟器并再次重新打开时。.该人应用程序中没有显示任何联系人。我想在我的应用程序中导入该联系人以发送一些信息。但是我无法继续进行操作,因为它没有显示任何联系人我通过phonegap教程也尝试了此代码。

document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {

    var contact = navigator.contacts.create();
    contact.displayName = "xyz";            
    var name = new ContactName();
    name.givenName = "abc";
    contact.name = name;
    contact.save(onSaveSuccess,onSaveError);
function onSaveSuccess(contact) {
    alert("Save Success");
}


function onSaveError(contactError) {
    alert("Error = " + contactError.code);
}

AFAIK you can't do that because WP8 API doesn't allow that. AFAIK您无法执行此操作,因为WP8 API不允许这样做。 You only have Read-only access to Contact API. 您仅具有对Contact API的只读访问权限。

See the documentation . 请参阅文档

EDIT: After reading a little more about your issues I found this one . 编辑:在阅读了有关您的问题的更多信息后,我发现了这个问题。 So I think that your problem is with emulator only, that doesn't persist data after turned off. 因此,我认为您的问题仅在于仿真器,它在关闭后不会持久保存数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM