Skip to content

Instantly share code, notes, and snippets.

@omarojo
Last active February 22, 2017 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarojo/e902fadb1d89de17333466b421bb4887 to your computer and use it in GitHub Desktop.
Save omarojo/e902fadb1d89de17333466b421bb4887 to your computer and use it in GitHub Desktop.
Facebook GraphRequest empty Alert
let userId = AccessToken.current?.userId
let path = "/"+userId!+"/live_videos"
var title = "the title"
let descript = "my description"
let request : GraphRequest = GraphRequest(graphPath: path,
parameters:["title": title!,
"description": descript,
"privacy":"{'value':'SELF'}",
"save_vod": true,
"fields": ""],
httpMethod: .POST, apiVersion: .defaultVersion)
request.start({ (httpResponse, result) in
switch result {
case .success(let response):
completion(response, nil)
case .failed(let error):
print("Graph Request Failed: \(error)")
completion(nil,error)
}
})
//THOWS An EMPTY UIALERT when failed.
//the fail error is the following:
/*
Graph Request Failed: Error Domain=com.facebook.sdk.core Code=8 "" UserInfo={com.facebook.sdk:FBSDKErrorLocalizedDescriptionKey=, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=368, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=You recently posted something that violates Facebook policies, so you're temporarily blocked from using this feature. For more information, visit the Help Center.
To keep from getting blocked again, please make sure you've read and understand Facebook's Community Standards., com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400, NSLocalizedDescription=, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 368;
"error_data" = {
"help_center_id" = 0;
"sentry_block_data" = "AegLbsXM2HJ25xpfaOONuOTjGN5uL_AC8B_dtXJDw19oMa7Zy18Qc9p98lHwbCmXbSoQDBf4_4AN3MysVIBx-DOsm5WALkCmN48Y8phuNlnUzuyEInjkcn5_QmaKEVJJyzZ9Gj5KIE0MR1ZHmURw6dGgoocasUBYRGdaeX-Ht1C3nWhczXi34kkrHn0RD0GjvmS1aeUZgXV-iuzBENz4b2WeYgrGh8ueYCYxDnc1QQhl04pLM8fN1O0lN5Xd8rb9CWJtySBjyMDZo5N-VVZm3YZqTSiPM43yPsWctUcRCl4IWSlp1u9jfgVfHhB8KLT6uENbNt-S-P5jNJ6U1iFCzdvdLCynRkjx-eZXsal-hz79F6_0wQYfwOCKP1LKg0rHaF-qbyLcmwtK4ro-yQ5XSHyhIRivOPwxwbqMdL84J0HII793mfH2cD09xHDDtrN99gaAN_TIs7awM46TKBz6BlQOwKr_ooNzTvrkQ4Tk_dG6A0c8jl5qGEP70mSQKznXdBJRsU76EMc3YVDyoMMULcBx65MjTXoJkGNtIqEjcMd2NHibnryxEypvNN9bImr1P7TbCSwGy8kQms7O79ftlX7vdJFj-VW5uAc3rpnvqaNf3Y9cG1SdUz-0I-eipcVi1yU";
};
"error_subcode" = 1404080;
"error_user_msg" = "";
"fbtrace_id" = DlvrV9mvHKI;
message = "You recently posted something that violates Facebook policies, so you're temporarily blocked from using this feature. For more information, visit the Help Center.\n\nTo keep from getting blocked again, please make sure you've read and understand Facebook's Community Standards.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorSubcode=1404080, com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment