簡體   English   中英

Pinterest IOS SDK getBoardPins響應代碼= -1011“請求失敗:錯誤請求(400)”

[英]Pinterest IOS SDK getBoardPins response Code=-1011 “Request failed: bad request (400)”

我收到一個錯誤的請求返回

 PDKClient.sharedInstance().getBoardPins(boardID, fields: ["image", "description"], withSuccess: { (responseObject :PDKResponseObject!) -> Void in

            print(responseObject.pins().first!.descriptionText)

            })  { (err :NSError!) -> Void in
                print("error NSError: \(err)")
        }

從以下位置傳遞boardID:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if let dvc = segue.destinationViewController as? PinCollectionViewController {
           dvc.boardID = selectedBoard.identifier
    }

我不知道為什么? 我知道我的板卡ID是正確的,並嘗試對其進行硬編碼。 我已經通過驗證了...

通過SDK:

/**
 *  Get a list of pins for the given board. The response can be used to get
 *  the bext page of pins.
 *
 *  @param boardId      ID of the board
 *  @param fields       The pin fields that will be returned by the api
 *  @param successBlock Called when the API call succeeds
 *  @param failureBlock Called when the API call fails
 */
- (void)getBoardPins:(NSString *)boardId
              fields:(NSSet *)fields
         withSuccess:(PDKClientSuccess)successBlock
          andFailure:(PDKClientFailure)failureBlock;

我將字段更改為:

PDKClient.sharedInstance().getBoardPins(boardID, fields: ["id", "image", "note"], withSuccess: { (responseObject :PDKResponseObject!) -> Void in

        print(responseObject.pins().first!.descriptionText)

        })  { (err :NSError!) -> Void in
            print("error NSError: \(err)")
    }

並能夠成功收到回復

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM