2014-12-19 52 views
0

我已經從IOS evernote sdks Migration_from_SDK_1_x.md遷移到evernote-cloud-sdk-ios,以支持我們的Daily Notes應用程序的64位體系結構。Evernote iOS雲SDK - 下載EDAMResource數據時出錯

我按照指南(https://github.com/evernote/evernote-cloud-sdk-ios/blob/master/Migration_from_SDK_1_x.md)中提到的步驟遷移。

遷移後的一切工作正常,除了下載資源數據。

當我嘗試使用ENNoteStoreClient類的getResourceDataWithGuid:API下載附件(圖像)時,我們始終得到以下錯誤。

錯誤域= ENErrorDomain代碼= 1 「失蹤結果:getResourceData失敗:未知的結果」 的UserInfo = 0x16b40490 {NSLocalizedDescription =缺少結果:getResourceData失敗:未知的結果}

步驟來重現

  1. 創建Evernote中的一個筆記。
  2. 將圖像附加到該筆記。
  3. 並嘗試下載資源..

下面是獲得EDAMNote,然後從中獲取EDAMResource的代碼片段。

ENNoteStoreClient *noteStore=[ENSession sharedSession].primaryNoteStore; 

    EDAMSyncChunkFilter *filter=[[EDAMSyncChunkFilter alloc]init]; 
    filter.includeNotes = @YES; 
    filter.includeNoteResources = @YES; 
    filter.includeNoteAttributes = @YES; 
    filter.includeNotebooks = @YES; 
    filter.includeTags = @YES; 
    filter.includeSearches = @NO; 
    filter.includeResources = @NO; 
    filter.includeLinkedNotebooks = @NO; 
    filter.includeExpunged = [NSNumber numberWithBool:!fullSunc]; 
    filter.includeNoteApplicationDataFullMap = @YES; 
    filter.includeResourceApplicationDataFullMap = @NO; 
    filter.includeNoteResourceApplicationDataFullMap = @YES; 
    filter.requireNoteContentClass = nil; 
    [noteStore getFilteredSyncChunkAfterUSN:currentUSN 
           maxEntries:255 
            filter:filter 
            success:^(EDAMSyncChunk *syncChunk) 
    { 
     completionHandler(syncChunk,nil); 
    } 
            failure:^(NSError *error) 
    { 
     completionHandler(nil,error); 
    }]; 
} 

//I then extract the required EDAMNote from the syncChunk. 


5. if I try to download the resource associated with this EDAMNote using 「getResourceDataWithGuid:」 API, it always returns the error. This was working fine in earlier version. Here is the code snippet. 

EDAMResource *resource = self.evernoteResource; 
ENNoteStoreClient *noteStore = [ENSession sharedSession].primaryNoteStore; 

[noteStore getResourceDataWithGuid:resource.guid success:^(NSData *data) 
    { 


    } failure:^(NSError *error) 
    { 

    }]; 
} 

錯誤域= ENErrorDomain代碼= 1 「缺少結果:getResourceData失敗:未知的結果」 的UserInfo = 0x16b40490 {NSLocalizedDescription =缺少結果:getResourceData失敗:未知的結果}

我還觀察到以下日誌在獲取此錯誤之前由SDK提供的控制檯中。 跳過字段:由於類型不匹配(收到:11)。

我已經在示例應用程序中試過這個程序,並觀察到相同的行爲。

有人遇到過這個問題嗎?

+1

答案在這裏:http://stackoverflow.com/questions/25243353/unable-to-download-the-note-attachmet-using-evernote-ios-sdk/27564429#27564429 – loganathan 2014-12-19 10:49:25

回答