FBUserSettingsViewController.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright 2010-present Facebook.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <UIKit/UIKit.h>
  17. #import "FBSession.h"
  18. #import "FBViewController.h"
  19. /*!
  20. @protocol
  21. @abstract
  22. The `FBUserSettingsDelegate` protocol defines the methods called by a <FBUserSettingsViewController>.
  23. */
  24. @protocol FBUserSettingsDelegate <FBViewControllerDelegate>
  25. @optional
  26. /*!
  27. @abstract
  28. Called when the view controller will log the user out in response to a button press.
  29. @param sender The view controller sending the message.
  30. */
  31. - (void)loginViewControllerWillLogUserOut:(id)sender;
  32. /*!
  33. @abstract
  34. Called after the view controller logged the user out in response to a button press.
  35. @param sender The view controller sending the message.
  36. */
  37. - (void)loginViewControllerDidLogUserOut:(id)sender;
  38. /*!
  39. @abstract
  40. Called when the view controller will log the user in in response to a button press.
  41. Note that logging in can fail for a number of reasons, so there is no guarantee that this
  42. will be followed by a call to loginViewControllerDidLogUserIn:. Callers wanting more granular
  43. notification of the session state changes can use KVO or the NSNotificationCenter to observe them.
  44. @param sender The view controller sending the message.
  45. */
  46. - (void)loginViewControllerWillAttemptToLogUserIn:(id)sender;
  47. /*!
  48. @abstract
  49. Called after the view controller successfully logged the user in in response to a button press.
  50. @param sender The view controller sending the message.
  51. */
  52. - (void)loginViewControllerDidLogUserIn:(id)sender;
  53. /*!
  54. @abstract
  55. Called if the view controller encounters an error while trying to log a user in.
  56. @param sender The view controller sending the message.
  57. @param error The error encountered.
  58. @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/
  59. for error handling best practices.
  60. */
  61. - (void)loginViewController:(id)sender receivedError:(NSError *)error;
  62. @end
  63. /*!
  64. @class FBUserSettingsViewController
  65. @abstract
  66. The `FBUserSettingsViewController` class provides a user interface exposing a user's
  67. Facebook-related settings. Currently, this is limited to whether they are logged in or out
  68. of Facebook.
  69. Because of the size of some graphics used in this view, its resources are packaged as a separate
  70. bundle. In order to use `FBUserSettingsViewController`, drag the `FBUserSettingsViewResources.bundle`
  71. from the SDK directory into your Xcode project.
  72. */
  73. @interface FBUserSettingsViewController : FBViewController
  74. /*!
  75. @abstract
  76. The permissions to request if the user logs in via this view.
  77. */
  78. @property (nonatomic, copy) NSArray *permissions __attribute__((deprecated));
  79. /*!
  80. @abstract
  81. The read permissions to request if the user logs in via this view.
  82. @discussion
  83. Note, that if read permissions are specified, then publish permissions should not be specified.
  84. */
  85. @property (nonatomic, copy) NSArray *readPermissions;
  86. /*!
  87. @abstract
  88. The publish permissions to request if the user logs in via this view.
  89. @discussion
  90. Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or
  91. FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish
  92. permissions are specified, then read should not be specified.
  93. */
  94. @property (nonatomic, copy) NSArray *publishPermissions;
  95. /*!
  96. @abstract
  97. The default audience to use, if publish permissions are requested at login time.
  98. */
  99. @property (nonatomic, assign) FBSessionDefaultAudience defaultAudience;
  100. @end