问题
I try send the message using the followingcode:
//...
FacebookClient fbClient = new FacebookClient(appId, appSecret);
fbClient.AccessToken = "...";
string to = "user id";
dynamic result = fbClient.Post(String.Format("{0}/feed", to), parameters);
but how I can know if the menssage has send to user successfully? what's the returns on case success/erros? I not found some details in the documentation of facebook-sdk-api for C#.
.NET version: v4.0.30319
Facebook Assembly version: 5.2.1.0
Thanks in advance.
回答1:
by taking reference https://developers.facebook.com/docs/reference/rest/stream.publish/
you will have post_id for result
parameter for successfull call, if fail it should be some json including error message, for example:
{
"error_code": 200,
"error_msg": "The user hasn't authorized the application to perform this action",
"request_args": [
{
"key": "method",
"value": "stream.publish"
},
{
"key": "access_token",
"value": "AAAC9okD6ZA7ABABhvJOZBQvUE2OsuHLKEkqlvKKkPDNB9kHfF55DqgKF2raHmSaUSgkpvLtgWniM5CFnu5mxaGODLqvwVz9zBNd1Jd6AZDZD"
},
{
"key": "format",
"value": "json"
}
]
}
来源:https://stackoverflow.com/questions/8057517/how-do-i-check-if-post-has-send-successfully-in-facebook-c-sharp-sdk