Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. NSMutableDictionary<FBOpenGraphObject> *object = [FBGraphObject openGraphObjectForPost];
  2.  
  3. var object = FBGraphObject.openGraphActionForPost()
  4.  
  5. // specify that this Open Graph object will be posted to Facebook
  6. object.setObject(true, forKey: "provisionedForPost")
  7.  
  8. // for og:title
  9. object.setObject(description["title"]!, forKey: "title")
  10.  
  11. // for og:type, this corresponds to the Namespace you've set for your app and the object type name
  12. object.setObject("bppridereport:ride", forKey: "type")
  13.  
  14. // for og:description
  15. object.setObject(description["description"]!, forKey: "description")
  16.  
  17. FBRequestConnection.startForPostOpenGraphObject(object, completionHandler: { (connection:FBRequestConnection!, result:AnyObject!, error:NSError!) -> Void in
  18.  
  19. if error == nil {
  20. let objectId = result["id"]
  21.  
  22. } else {
  23. NSLog("Error posting the Open Graph object to the Object API:", error);
  24. }
  25.  
  26. })
  27.  
  28. var object = FBGraphObject.openGraphActionForPost() as FBOpenGraphObject
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement