FBUnityInterface.h 2.6 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 <UIKit/UIKit.h>
  19. // Value-tested, never with defined(): Unity sets the macro to 0 under the Objective-C Xcode
  20. // project type and 1 under Swift, so defined() would take the Swift branch under both. How Unity
  21. // delivers it to third-party plugin sources is unverified here — the macro is Unity 6.5+ only and
  22. // no trampoline vendored in third-party/toolchains/unity is new enough to define it. Absence is
  23. // the safe case either way: #if reads an undefined macro as 0, i.e. the Objective-C branch.
  24. #if !UNITY_XCODE_PROJECT_TYPE_SWIFT
  25. // Trampoline-only. The Swift Xcode project type replaces UnityAppController with UnityPlayer and
  26. // publishes lifecycle through NotificationCenter, so neither this header nor the
  27. // AppDelegateListener protocol exists there.
  28. #import "AppDelegateListener.h"
  29. //if we are on a version of unity that has the version number defined use it, otherwise we have added it ourselves in the post build step
  30. #if HAS_UNITY_VERSION_DEF
  31. #include "UnityTrampolineConfigure.h"
  32. #endif
  33. #endif
  34. #if UNITY_XCODE_PROJECT_TYPE_SWIFT
  35. @interface FBUnityInterface : NSObject
  36. #else
  37. @interface FBUnityInterface : NSObject <AppDelegateListener>
  38. #endif
  39. {
  40. //If you make changes in here make the same changes in Assets/Facebook/Scripts/NativeDialogModes.cs
  41. enum ShareDialogMode
  42. {
  43. AUTOMATIC = 0,
  44. NATIVE = 1,
  45. WEB = 2,
  46. FEED = 3,
  47. };
  48. }
  49. @property (assign, nonatomic) BOOL useFrictionlessRequests;
  50. @property (nonatomic) ShareDialogMode shareDialogMode;
  51. + (FBUnityInterface *)sharedInstance;
  52. @end