FBSDKShareOpenGraphObject.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  2. //
  3. // You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
  4. // copy, modify, and distribute this software in source code or binary form for use
  5. // in connection with the web services and APIs provided by Facebook.
  6. //
  7. // As with any software that integrates with the Facebook platform, your use of
  8. // this software is subject to the Facebook Developer Principles and Policies
  9. // [http://developers.facebook.com/policy/]. This copyright notice shall be
  10. // included in all copies or substantial portions of the software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  14. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  15. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  16. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. #import <Foundation/Foundation.h>
  19. #import <FBSDKCoreKit/FBSDKCopying.h>
  20. #import <FBSDKShareKit/FBSDKShareOpenGraphValueContainer.h>
  21. /*!
  22. @abstract An Open Graph Object for sharing.
  23. @discussion The property keys MUST have namespaces specified on them, such as `og:image`,
  24. and `og:type` is required.
  25. See https://developers.facebook.com/docs/sharing/opengraph/object-properties for other properties.
  26. You can specify nested namespaces inline to define complex properties. For example, the following
  27. code will generate a fitness.course object with a location:
  28. FBSDKShareOpenGraphObject *course = [FBSDKShareOpenGraphObject objectWithProperties:
  29. @{
  30. @"og:type": @"fitness.course",
  31. @"og:title": @"Sample course",
  32. @"fitness:metrics:location:latitude": @"41.40338",
  33. @"fitness:metrics:location:longitude": @"2.17403",
  34. }];
  35. */
  36. @interface FBSDKShareOpenGraphObject : FBSDKShareOpenGraphValueContainer <FBSDKCopying, NSSecureCoding>
  37. /*!
  38. @abstract Convenience method to build a new action and set the object for the specified key.
  39. @param properties Properties for the Open Graph object, which will be parsed into the proper models
  40. */
  41. + (instancetype)objectWithProperties:(NSDictionary *)properties;
  42. /*!
  43. @abstract Compares the receiver to another Open Graph Object.
  44. @param object The other object
  45. @return YES if the receiver's values are equal to the other object's values; otherwise NO
  46. */
  47. - (BOOL)isEqualToShareOpenGraphObject:(FBSDKShareOpenGraphObject *)object;
  48. @end