无法在FirefoxOS上获取联系人

时间:2014-08-13 13:09:07

标签: mobile firefox-os

我有一个FirefoxOS设备,我正在尝试创建一个管理联系人的应用程序。我无法从设备和模拟器中获取联系人(两者都有1.3版本) 以下是我的代码(摘自帮助):

var cursor = navigator.mozContacts.getAll({});

cursor.onsuccess = function() {
    if (cursor.result) {
        console.log("Got contact with name: " + cursor.result.name.join(" "));
        cursor.continue();
    } else {
        alert("Done!");
    }
};

cursor.onerror = function() {
    alert("Error getting contacts");
    console.log( cursor );
};

以下是我的清单文件中的细分:

...
"permissions": {
        "storage": {
            "description": "Required for storing data"
        },
        "contacts": {
            "description": "Needed to access the contacts",
            "access": "readonly"
        }
    },
...

始终属于onerror功能。需要帮助。

1 个答案:

答案 0 :(得分:1)

你是否在清单中设置了:

"type": "privileged",

否则请在失败时发布cursor.error的值。

相关问题