2016-09-25 6 views
0

Facebook에 OpenGraph 스토리를 게시하려고합니다. publish_actions은 아직 승인되지 않았지만 아직 승인을 위해 제출되지는 않았지만 해당 앱에 테스트 사용자를 사용하고 있으므로 제대로 작동합니다.OpenGraph 스토리를 게시 할 수 없습니다. OAuthException, 알 수없는 오류가 발생했습니다. 테스트 사용자

let loginManager: FBSDKLoginManager = FBSDKLoginManager() 
loginManager.logInWithPublishPermissions(["publish_actions"], fromViewController: self, handler: { (result, error) in 

    if error != nil 
    { 
     self.postOnFacebookSwitch.on = false 
    } 
    else 
    { 
     self.postOpenGraphStoryToFacebook() 
    } 
}) 

func postOpenGraphStoryToFacebook() 
{ 
    NSLog("postOpenGraphStoryToFacebook()")    

    let object = FBSDKShareOpenGraphObject(properties: ["og:type": "location", "og:title": "test location title", "place:location:latitude": 12.2, "place:location:longitude": 13.2]) 

    let action = FBSDKShareOpenGraphAction() 
    action.actionType = "testapp:check_in" 
    action.setObject(object, forKey: "location") 

    let content = FBSDKShareOpenGraphContent() 
    content.action = action 
    content.previewPropertyName = "location" 

    let shareAPI = FBSDKShareAPI() 
    shareAPI.delegate = self 
    shareAPI.shareContent = content 
    shareAPI.share() 
} 

여기에 전체 로그입니다 : 여기 내 코드는

2016-09-25 15:45:24.568 TestApp[72327:19648100] postOpenGraphStoryToFacebook() 
2016-09-25 15:45:24.848 TestApp[72327:19648100] didFailWithError Error Domain=com.facebook.sdk.share Code=201 "(null)" UserInfo={NSUnderlyingError=0x8287e6a0 {Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=500, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=An unknown error has occurred., NSRecoveryAttempter=<_FBSDKTemporaryErrorRecoveryAttempter: 0x8287bb30>, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=1, com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=1, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey=<CFBasicHash 0x8287f190 [0x3c7b1f8]>{type = mutable dict, count = 2, 
entries => 
    1 : <CFString 0x82880450 [0x3c7b1f8]>{contents = "code"} = <CFNumber 0x796da9b0 [0x3c7b1f8]>{value = +500, type = kCFNumberSInt64Type} 
    2 : <CFString 0x8f55ac [0x3c7b1f8]>{contents = "body"} = <CFBasicHash 0x8287e130 [0x3c7b1f8]>{type = immutable dict, count = 1, 
entries => 
    2 : <CFString 0x8287e750 [0x3c7b1f8]>{contents = "error"} = <CFBasicHash 0x8287cc10 [0x3c7b1f8]>{type = immutable dict, count = 4, 
entries => 
    0 : <CFString 0x8282aae0 [0x3c7b1f8]>{contents = "type"} = <CFString 0x8287a510 [0x3c7b1f8]>{contents = "OAuthException"} 
    1 : <CFString 0x8287def0 [0x3c7b1f8]>{contents = "code"} = <CFNumber 0x7a906b70 [0x3c7b1f8]>{value = +1, type = kCFNumberSInt32Type} 
    3 : <CFString 0x8287fdd0 [0x3c7b1f8]>{contents = "fbtrace_id"} = <CFString 0x8287f970 [0x3c7b1f8]>{contents = "C0APfOSCSX9"} 
    5 : <CFString 0x8287db10 [0x3c7b1f8]>{contents = "message"} = <CFString 0x8287ba00 [0x3c7b1f8]>{contents = "An unknown error has occurred."} 
} 

} 

} 
, NSLocalizedRecoveryOptions=(
    OK 
), NSLocalizedRecoverySuggestion=The server is temporarily busy, please try again.}}, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Error creating Open Graph object: Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=500, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=An unknown error has occurred., NSRecoveryAttempter=<_FBSDKTemporaryErrorRecoveryAttempter: 0x8287bb30>, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=1, com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=1, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey=<CFBasicHash 0x8287f190 [0x3c7b1f8]>{type = mutable dict, count = 2, 
entries => 
    1 : <CFString 0x82880450 [0x3c7b1f8]>{contents = "code"} = <CFNumber 0x796da9b0 [0x3c7b1f8]>{value = +500, type = kCFNumberSInt64Type} 
    2 : <CFString 0x8f55ac [0x3c7b1f8]>{contents = "body"} = <CFBasicHash 0x8287e130 [0x3c7b1f8]>{type = immutable dict, count = 1, 
entries => 
    2 : <CFString 0x8287e750 [0x3c7b1f8]>{contents = "error"} = <CFBasicHash 0x8287cc10 [0x3c7b1f8]>{type = immutable dict, count = 4, 
entries => 
    0 : <CFString 0x8282aae0 [0x3c7b1f8]>{contents = "type"} = <CFString 0x8287a510 [0x3c7b1f8]>{contents = "OAuthException"} 
    1 : <CFString 0x8287def0 [0x3c7b1f8]>{contents = "code"} = <CFNumber 0x7a906b70 [0x3c7b1f8]>{value = +1, type = kCFNumberSInt32Type} 
    3 : <CFString 0x8287fdd0 [0x3c7b1f8]>{contents = "fbtrace_id"} = <CFString 0x8287f970 [0x3c7b1f8]>{contents = "C0APfOSCSX9"} 
    5 : <CFString 0x8287db10 [0x3c7b1f8]>{contents = "message"} = <CFString 0x8287ba00 [0x3c7b1f8]>{contents = "An unknown error has occurred."} 
} 

} 

} 
, NSLocalizedRecoveryOptions=(
    OK 
), NSLocalizedRecoverySuggestion=The server is temporarily busy, please try again.}} 

에 어떤 문제가 있습니까?

비 테스트 사용자 인 관리자 계정으로 시도했지만 방금 작동하지 않습니다.

답변

0

은 내가 페이스 북 응용 프로그램 설정에서 "publish_actions"을 가능하게하고 또한 "위치"에 페이스 북 페이지 ID를 해결하기 지정하여 이러한 문제를 해결

0

"og:type": "testapp:location" 대신 "og:type": "location" ...해야 밝혀졌습니다. 현재 위치 ID를 확인할 수 있습니다

-https://findmyfbid.com/

+0

왜 당신은 API를 통해이 작업을 수행하는 방법을 설명 할 수있는 타사 사이트에 링크? API에 익숙하지는 않지만 [this] (https://stackoverflow.com/a/5502227/1863564)는 그늘진 세 번째 사이트가 없으면 좋은 방법입니다. –