parent
c8eec9b54d
commit
ec3dddf50d
@ -331,7 +331,12 @@ angular.module('myApp.services', [])
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isAvailable () {
|
function isAvailable () {
|
||||||
return window.navigator && window.navigator.mozContacts && window.navigator.mozContacts.getAll;
|
try {
|
||||||
|
return navigator.mozContacts && navigator.mozContacts.getAll;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(dT(), 'phonebook n/a', e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPhonebookImport () {
|
function openPhonebookImport () {
|
||||||
@ -347,9 +352,14 @@ angular.module('myApp.services', [])
|
|||||||
return phonebookContactsPromise;
|
return phonebookContactsPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var request = window.navigator.mozContacts.getAll({});
|
||||||
|
} catch (e) {
|
||||||
|
return $q.reject(e);
|
||||||
|
}
|
||||||
|
|
||||||
var deferred = $q.defer(),
|
var deferred = $q.defer(),
|
||||||
contacts = [],
|
contacts = [],
|
||||||
request = window.navigator.mozContacts.getAll({}),
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
request.onsuccess = function () {
|
request.onsuccess = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user