2016-04-22 3 views
1

Ionic 1.3(vs 1.0)を使用してから、cordova-plugin-contactsモジュールはiOS 9で無効な日付エラーを返します。Ionic/Cordova連絡先プラグインの返品時に、Ionic 1.3へのアップグレード後にiOSで日付が無効になる

これは私のアプリを爆発させたので、誰かがそれをトラブルシューティングする方法の方向を教えてくれることを願っています!ありがとう。

エラー

enter image description here

var opts = { //search options 
     // filter: '',         // 'Bob' 
     // multiple: true,          // Yes, return any contact that matches criteria 
     fields: ['displayName', 'name'], // These are the fields to search for 'bob'. 
     desiredFields: ['name', 'phoneNumbers'] //return fields. 
    }; 
    $cordovaContacts.find(opts).then(function(allContacts) {}).catch(function(error) { 
     //error is caught here; 
    }); 

答えて

0

問題は、イオン1.3にbirthdayフィールドはコルドバコンタクトによって無効な日付を返された(下のスクリーンショットを参照)、連絡先のにアクセスするための後続のすべての試みということですプロパティには、エラーを生成するオブジェクト全体のシリアル化が含まれます。私の(ハッキー)解決策は、誕生日以外の連絡先のプロパティをプレーンなJavascriptオブジェクトにコピーしてそこからアクセスすることでした。

enter image description here

例えば、

allContacts.forEach(function (c) { 
     if (c.name.givenName && c.phoneNumbers) { 
     contacts.push({name: c.name, phoneNumbers: c.phoneNumbers}); // grab only the properties you need avoiding birthday 
     } 
    }); 

https://github.com/driftyco/ng-cordova/issues/1233

関連する問題