FBSDKApplicationDelegate.h 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /**
  20. The FBSDKApplicationDelegate is designed to post process the results from Facebook Login
  21. or Facebook Dialogs (or any action that requires switching over to the native Facebook
  22. app or Safari).
  23. The methods in this class are designed to mirror those in UIApplicationDelegate, and you
  24. should call them in the respective methods in your AppDelegate implementation.
  25. */
  26. @interface FBSDKApplicationDelegate : NSObject
  27. /**
  28. Gets the singleton instance.
  29. */
  30. + (instancetype)sharedInstance;
  31. /**
  32. Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method
  33. of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction
  34. with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs.
  35. @param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
  36. @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
  37. @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
  38. @param annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:].
  39. @return YES if the url was intended for the Facebook SDK, NO if not.
  40. */
  41. - (BOOL)application:(UIApplication *)application
  42. openURL:(NSURL *)url
  43. sourceApplication:(NSString *)sourceApplication
  44. annotation:(id)annotation;
  45. #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_9_0
  46. /**
  47. Call this method from the [UIApplicationDelegate application:openURL:options:] method
  48. of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction
  49. with the native Facebook app or Safari as part of SSO authorization flow or Facebook dialogs.
  50. @param application The application as passed to [UIApplicationDelegate application:openURL:options:].
  51. @param url The URL as passed to [UIApplicationDelegate application:openURL:options:].
  52. @param options The options dictionary as passed to [UIApplicationDelegate application:openURL:options:].
  53. @return YES if the url was intended for the Facebook SDK, NO if not.
  54. */
  55. - (BOOL)application:(UIApplication *)application
  56. openURL:(NSURL *)url
  57. options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
  58. #endif
  59. /**
  60. Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method
  61. of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK.
  62. As part of SDK initialization basic auto logging of app events will occur, this can be
  63. controlled via 'FacebookAutoLogAppEventsEnabled' key in the project info plist file.
  64. @param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
  65. @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
  66. @return YES if the url was intended for the Facebook SDK, NO if not.
  67. */
  68. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
  69. @end