diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..bdf01dc --- /dev/null +++ b/.clang-format @@ -0,0 +1,71 @@ +# Copyright (c) 2015-present, Parse, LLC. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: true +AlignEscapedNewlinesLeft: true +AlignOperands: true +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakTemplateDeclarations: false +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: true +BinPackParameters: true +BinPackArguments: true +ColumnLimit: 0 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +DerivePointerAlignment: true +ExperimentalAutoDetectBinPacking: true +IndentCaseLabels: true +IndentWrappedFunctionNames: true +IndentFunctionDeclarationAfterType: true +MaxEmptyLinesToKeep: 1 +KeepEmptyLinesAtTheStartOfBlocks: true +NamespaceIndentation: None +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 140 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 120 +PointerAlignment: Right +SpacesBeforeTrailingComments: 1 +Cpp11BracedListStyle: true +Standard: Cpp11 +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +BreakBeforeBraces: Attach +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: false +SpacesInContainerLiterals: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +CommentPragmas: '^ IWYU pragma:' +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +SpaceBeforeParens: ControlStatements +DisableFormat: false +... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d1a7af --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +.DS_Store + +*.pbxuser +*.perspective +*.perspectivev3 + +*.mode1v3 +*.mode2v3 + +*.xcodeproj/xcuserdata/*.xcuserdatad + +*.xccheckout +*.xcscmblueprint +*.xcuserdatad + +Pods + +DerivedData +build + +Vendor/Parse.framework +Vendor/Bolts.framework diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9eb2d7e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +branches: + only: + - master + - master-v3 +language: objective-c +os: osx +osx_image: xcode7 +env: + global: + - LC_CTYPE=en_US.UTF-8 + - LANG=en_US.UTF-8 + matrix: + - TEST_TYPE=ios + - TEST_TYPE=podspecs +script: +- | + if [ "$TEST_TYPE" = ios ]; then + set -o pipefail + xcodebuild test -workspace ParseFacebookUtils.xcworkspace -sdk iphonesimulator -scheme ParseFacebookUtils-iOS -configuration Debug -destination "platform=iOS Simulator,name=iPhone 4s" -destination "platform=iOS Simulator,name=iPhone 6 Plus" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty + elif [ "$TEST_TYPE" = podspecs ]; then + pod lib lint --use-libraries ParseFacebookUtils.podspec --allow-warnings + fi +after_success: +- | + if [ "$TEST_TYPE" = ios ]; then + bash <(curl -s https://codecov.io/bash) + fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7a8ad54 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# Contributing to Parse Facebook Utils for iOS +We want to make contributing to this project as easy and transparent as possible. + +## Code of Conduct +Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated. + +## Our Development Process +Most of our work will be done in public directly on GitHub. There may be changes done through our internal source control, but it will be rare and only as needed. + +### `master` is unsafe +Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment. + +### Pull Requests +We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process. + +1. Fork the repo and create your branch from `master`. +4. Add unit tests for any new code you add. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +### Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## Bugs +Although we try to keep developing on Parse easy, you still may run into some issues. General questions should be asked on [Google Groups][google-group], technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we'll be using GitHub issues. + +### Known Issues +We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist. + +### Reporting New Issues +Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and [Parse API Console][parse-api-console]. If it does, you can report backend bugs [here][bug-reports]. + +To view the REST API network requests issued by the Parse SDK, please check out our [Network Debugging Tool][network-debugging-tool]. + +Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits: + +* A description. What did you expect to happen and what actually happened? Why do you think that was wrong? +* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests. See our [README](README.md#usage) for how to run unit tests. You can submit a pull request with your failing unit test so that our CI verifies that the test fails. +* What version does this reproduce on? What version did it last work on? +* [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer. +* Anything else you find relevant. + + +### Security Bugs +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. + +## Style Guide +We're still working on providing a code style for your IDE and getting a linter on GitHub, but for now try to keep the following: + +* Most importantly, match the existing code style as much as possible. +* Try to keep lines under 120 characters, if possible. + +## License +By contributing to Parse Facebook Utils for iOS, you agree that your contributions will be licensed under its license. + + [google-group]: https://groups.google.com/forum/#!forum/parse-developers + [stack-overflow]: http://stackoverflow.com/tags/parse.com + [bug-reports]: https://www.parse.com/help#report + [rest-api]: https://www.parse.com/docs/rest/guide + [parse-api-console]: http://blog.parse.com/announcements/introducing-the-parse-api-console/ + [network-debugging-tool]: https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/wiki/Network-Debug-Tool + [stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg + [tests-dir]: /Tests/Unit/ diff --git a/Configurations/ParseFacebookTestApplication.xcconfig b/Configurations/ParseFacebookTestApplication.xcconfig new file mode 100644 index 0000000..6229ab6 --- /dev/null +++ b/Configurations/ParseFacebookTestApplication.xcconfig @@ -0,0 +1,19 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "Shared/Platform/iOS.xcconfig" +#include "Shared/Product/Application.xcconfig" + +PRODUCT_NAME = ParseFacebookTestApplication + +INFOPLIST_FILE = $(SRCROOT)/Tests/TestApplication/Resources/Info.plist + +LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks + +CLANG_ENABLE_MODULES = YES diff --git a/Configurations/ParseFacebookUtils-iOS.xcconfig b/Configurations/ParseFacebookUtils-iOS.xcconfig new file mode 100644 index 0000000..9cda47d --- /dev/null +++ b/Configurations/ParseFacebookUtils-iOS.xcconfig @@ -0,0 +1,21 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "Shared/Platform/iOS.xcconfig" +#include "Shared/Product/Framework.xcconfig" + +PRODUCT_NAME = ParseFacebookUtils + +MACH_O_TYPE = staticlib + +INFOPLIST_FILE = $(SRCROOT)/Resources/Info.plist + +FRAMEWORK_SEARCH_PATHS = $(inherited) $(SRCROOT)/Vendor + +OTHER_CFLAGS[sdk=iphoneos9.0] = $(inherited) -fembed-bitcode diff --git a/Configurations/ParseFacebookUtilsV3-UnitTests.xcconfig b/Configurations/ParseFacebookUtilsV3-UnitTests.xcconfig new file mode 100644 index 0000000..840dd23 --- /dev/null +++ b/Configurations/ParseFacebookUtilsV3-UnitTests.xcconfig @@ -0,0 +1,24 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "Shared/Platform/iOS.xcconfig" +#include "Shared/Product/UnitTest.xcconfig" +#include "Pods/Target Support Files/Pods-ParseFacebookUtilsV3-UnitTests/Pods-ParseFacebookUtilsV3-UnitTests.debug.xcconfig" + +PRODUCT_NAME = ParseFacebookUtilsV3-UnitTests +TEST_HOST = $(BUILT_PRODUCTS_DIR)/ParseFacebookTestApplication.app/ParseFacebookTestApplication +BUNDLE_LOADER = $(TEST_HOST) + +INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/Info.plist + +FRAMEWORK_SEARCH_PATHS = $(inherited) $(SRCROOT)/Vendor/ +HEADER_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) +LIBRARY_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) + +CLANG_ENABLE_MODULES = YES diff --git a/Configurations/Shared/Common.xcconfig b/Configurations/Shared/Common.xcconfig new file mode 100644 index 0000000..de2de31 --- /dev/null +++ b/Configurations/Shared/Common.xcconfig @@ -0,0 +1,21 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "Warnings.xcconfig" + +// Language Settings +CLANG_ENABLE_OBJC_ARC = YES +GCC_C_LANGUAGE_STANDARD = gnu11 +CLANG_CXX_LANGUAGE_STANDARD = gnu++14 +CLANG_CXX_LIBRARY = libstdc++ + +// Search Paths +PARSE_DIR = $(PROJECT_DIR) +VENDOR_DIR = $(PARSE_DIR)/Vendor +ALWAYS_SEARCH_USER_PATHS = NO diff --git a/Configurations/Shared/Platform/OSX.xcconfig b/Configurations/Shared/Platform/OSX.xcconfig new file mode 100644 index 0000000..db20c6a --- /dev/null +++ b/Configurations/Shared/Platform/OSX.xcconfig @@ -0,0 +1,11 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +SDKROOT = macosx +MACOSX_DEPLOYMENT_TARGET = 10.9 diff --git a/Configurations/Shared/Platform/iOS.xcconfig b/Configurations/Shared/Platform/iOS.xcconfig new file mode 100644 index 0000000..5c5affb --- /dev/null +++ b/Configurations/Shared/Platform/iOS.xcconfig @@ -0,0 +1,21 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +SDKROOT = iphoneos +IPHONEOS_DEPLOYMENT_TARGET = 7.0 + +GCC_THUMB_SUPPORT = NO + +ARCHS = $(ARCHS_STANDARD) armv7s +DSTROOT = /tmp/$(PRODUCT_NAME).dst + +CODE_SIGN_IDENTITY = +CODE_SIGNING_REQUIRED = NO + +TARGETED_DEVICE_FAMILY = 1,2 diff --git a/Configurations/Shared/Platform/watchOS.xcconfig b/Configurations/Shared/Platform/watchOS.xcconfig new file mode 100644 index 0000000..7287106 --- /dev/null +++ b/Configurations/Shared/Platform/watchOS.xcconfig @@ -0,0 +1,14 @@ +// +// Copyright (c) 2014, Facebook, Inc. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +SDKROOT = watchos +WATCHOS_DEPLOYMENT_TARGET = 2.0 + +CODE_SIGN_IDENTITY = +CODE_SIGNING_REQUIRED = NO diff --git a/Configurations/Shared/Product/Application.xcconfig b/Configurations/Shared/Product/Application.xcconfig new file mode 100644 index 0000000..59b9917 --- /dev/null +++ b/Configurations/Shared/Product/Application.xcconfig @@ -0,0 +1,14 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +LD_RUNPATH_SEARCH_PATHS = @executable_path/Frameworks + +ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon +ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage +CLANG_ENABLE_MODULES = YES diff --git a/Configurations/Shared/Product/Framework.xcconfig b/Configurations/Shared/Product/Framework.xcconfig new file mode 100644 index 0000000..9d5cca2 --- /dev/null +++ b/Configurations/Shared/Product/Framework.xcconfig @@ -0,0 +1,19 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +ENABLE_NS_ASSERTIONS = NO +MTL_ENABLE_DEBUG_INFO = NO + +DYLIB_COMPATIBILITY_VERSION = 1 +DYLIB_CURRENT_VERSION = 1 + +SKIP_INSTALL = YES + +CLANG_MODULES_AUTOLINK = NO +CLANG_ENABLE_MODULES = YES diff --git a/Configurations/Shared/Product/UnitTest.xcconfig b/Configurations/Shared/Product/UnitTest.xcconfig new file mode 100644 index 0000000..a4ab7b9 --- /dev/null +++ b/Configurations/Shared/Product/UnitTest.xcconfig @@ -0,0 +1,15 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +OTHER_LDFLAGS = $(inherited) -ObjC -framework XCTest +BUNDLE_LOADER = $(TEST_HOST) + +LD_RUNPATH_SEARCH_PATHS = $(inherited) @loader_path/Frameworks @executable_path/Frameworks +USER_HEADER_SEARCH_PATHS = $(value) $(PARSE_DIR)/Tests/** +CLANG_ENABLE_MODULES = YES diff --git a/Configurations/Shared/Project/Debug.xcconfig b/Configurations/Shared/Project/Debug.xcconfig new file mode 100644 index 0000000..c5882bc --- /dev/null +++ b/Configurations/Shared/Project/Debug.xcconfig @@ -0,0 +1,22 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "../Common.xcconfig" + +GCC_OPTIMIZATION_LEVEL = 0 +SWIFT_OPTIMIZATION_LEVEL = -Onone + +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 +ONLY_ACTIVE_ARCH = YES + +ENABLE_TESTABILITY = YES + +SANITIZE_FLAGS = -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap +OTHER_CFLAGS = $(value) $(SANITIZE_FLAGS) +OTHER_LDFLAGS = $(value) $(SANITIZE_FLAGS) diff --git a/Configurations/Shared/Project/Release.xcconfig b/Configurations/Shared/Project/Release.xcconfig new file mode 100644 index 0000000..8570b87 --- /dev/null +++ b/Configurations/Shared/Project/Release.xcconfig @@ -0,0 +1,18 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#include "../Common.xcconfig" + +GCC_OPTIMIZATION_LEVEL = s +SWIFT_OPTIMIZATION_LEVEL = -O + +VALIDATE_PRODUCT = YES + +DEPLOYMENT_POSTPROCESSING = YES +STRIP_STYLE = debugging diff --git a/Configurations/Shared/Warnings.xcconfig b/Configurations/Shared/Warnings.xcconfig new file mode 100644 index 0000000..75ebeb5 --- /dev/null +++ b/Configurations/Shared/Warnings.xcconfig @@ -0,0 +1,43 @@ +// +// Copyright (c) 2015-present, Parse, LLC. +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +ENABLE_STRICT_OBJC_MSGSEND = YES + +GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES +GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +GCC_WARN_MISSING_PARENTHESES = YES +GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_LABEL = YES +GCC_WARN_UNUSED_VALUE = YES +GCC_WARN_UNUSED_VARIABLE = YES +GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES +GCC_WARN_UNDECLARED_SELECTOR = YES +GCC_WARN_64_TO_32_BIT_CONVERSION = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES + +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_DOCUMENTATION_COMMENTS = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_UNREACHABLE_CODE = YES +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES +CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES + +// Errors +GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR +CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR +CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..be60713 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'xcpretty' +gem 'cocoapods', '~> 0.39.0.rc.1' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..8a823ee --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,65 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (4.2.4) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (0.9.1) + cocoapods (0.39.0.rc.1) + activesupport (>= 4.0.2) + claide (~> 0.9.1) + cocoapods-core (= 0.39.0.rc.1) + cocoapods-downloader (~> 0.9.3) + cocoapods-plugins (~> 0.4.2) + cocoapods-search (~> 0.1.0) + cocoapods-stats (~> 0.6.2) + cocoapods-trunk (~> 0.6.4) + cocoapods-try (~> 0.5.1) + colored (~> 1.2) + escape (~> 0.0.4) + molinillo (~> 0.4.0) + nap (~> 1.0) + xcodeproj (~> 0.28.1) + cocoapods-core (0.39.0.rc.1) + activesupport (>= 4.0.2) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + cocoapods-downloader (0.9.3) + cocoapods-plugins (0.4.2) + nap + cocoapods-search (0.1.0) + cocoapods-stats (0.6.2) + cocoapods-trunk (0.6.4) + nap (>= 0.8, < 2.0) + netrc (= 0.7.8) + cocoapods-try (0.5.1) + colored (1.2) + escape (0.0.4) + fuzzy_match (2.0.4) + i18n (0.7.0) + json (1.8.3) + minitest (5.8.1) + molinillo (0.4.0) + nap (1.0.0) + netrc (0.7.8) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (0.28.1) + activesupport (>= 3) + claide (~> 0.9.1) + colored (~> 1.2) + xcpretty (0.1.12) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods (~> 0.39.0.rc.1) + xcpretty + +BUNDLED WITH + 1.10.6 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c6af918 --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ +BSD License + +For Parse Facebook Utils for iOS software + +Copyright (c) 2015-present, Parse, LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Parse nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PATENTS b/PATENTS new file mode 100644 index 0000000..8b9d511 --- /dev/null +++ b/PATENTS @@ -0,0 +1,33 @@ +Additional Grant of Patent Rights Version 2 + +"Software" means the Parse Facebook Utils for iOS software distributed by Parse, LLC. + +Parse, LLC. ("Parse") hereby grants to each recipient of the Software +("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable +(subject to the termination provision below) license under any Necessary +Claims, to make, have made, use, sell, offer to sell, import, and otherwise +transfer the Software. For avoidance of doubt, no license is granted under +Parse’s rights in any patent claims that are infringed by (i) modifications +to the Software made by you or any third party or (ii) the Software in +combination with any software or other technology. + +The license granted hereunder will terminate, automatically and without notice, +if you (or any of your subsidiaries, corporate affiliates or agents) initiate +directly or indirectly, or take a direct financial interest in, any Patent +Assertion: (i) against Parse or any of its subsidiaries or corporate +affiliates, (ii) against any party if such Patent Assertion arises in whole or +in part from any software, technology, product or service of Parse or any of +its subsidiaries or corporate affiliates, or (iii) against any party relating +to the Software. Notwithstanding the foregoing, if Parse or any of its +subsidiaries or corporate affiliates files a lawsuit alleging patent +infringement against you in the first instance, and you respond by filing a +patent infringement counterclaim in that lawsuit against that party that is +unrelated to the Software, the license granted hereunder will not terminate +under section (i) of this paragraph due to such counterclaim. + +A "Necessary Claim" is a claim of a patent owned by Parse that is +necessarily infringed by the Software standing alone. + +A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, +or contributory infringement or inducement to infringe any patent, including a +cross-claim or counterclaim. diff --git a/ParseFacebookUtils.podspec b/ParseFacebookUtils.podspec new file mode 100644 index 0000000..9f33121 --- /dev/null +++ b/ParseFacebookUtils.podspec @@ -0,0 +1,33 @@ +Pod::Spec.new do |s| + s.name = 'ParseFacebookUtils' + s.version = '1.9.0' + s.license = { :type => 'Commercial', :text => "See https://www.parse.com/about/terms" } + s.homepage = 'https://www.parse.com/' + s.summary = 'Parse is a complete technology stack to power your app\'s backend.' + s.authors = 'Parse' + + s.source = { :git => "https://github.com/ParsePlatform/ParseFacebookUtils-iOS.git", :tag => "v3-#{s.version.to_s}" } + + s.platform = :ios + s.ios.deployment_target = '7.0' + s.requires_arc = true + + s.public_header_files = 'ParseFacebookUtils/*.h' + s.source_files = 'ParseFacebookUtils/**/*.{h,m}' + + s.frameworks = 'AudioToolbox', + 'CFNetwork', + 'CoreGraphics', + 'CoreLocation', + 'QuartzCore', + 'Security', + 'StoreKit', + 'SystemConfiguration' + s.weak_frameworks = 'Accounts', + 'Social' + s.libraries = 'z', 'sqlite3' + + s.dependency 'Bolts/Tasks', '>= 1.3.0' + s.dependency 'Parse', '~> 1.9' + s.dependency 'Facebook-iOS-SDK', '~> 3.24' +end diff --git a/ParseFacebookUtils.xcodeproj/project.pbxproj b/ParseFacebookUtils.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8af62b6 --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/project.pbxproj @@ -0,0 +1,738 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0AB0D828E83D9F068028E5B9 /* libPods-ParseFacebookUtilsV3-UnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 850C9674A903DFCDD92629DB /* libPods-ParseFacebookUtilsV3-UnitTests.a */; }; + 813A255D1AC0F3E2007F54F3 /* ParseFacebookUtils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC07E0554694100DB518D /* ParseFacebookUtils.framework */; }; + 813A25851AC0F5D5007F54F3 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC941AB251F700F25A08 /* Parse.framework */; }; + 813A25861AC0F5D5007F54F3 /* Bolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC921AB2515A00F25A08 /* Bolts.framework */; }; + 813A25871AC0F5D5007F54F3 /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC901AB2514C00F25A08 /* FacebookSDK.framework */; }; + 813A25891AC0F625007F54F3 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813A25881AC0F625007F54F3 /* AudioToolbox.framework */; }; + 813A258D1AC0F62E007F54F3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813A258C1AC0F62E007F54F3 /* SystemConfiguration.framework */; }; + 813A25911AC0F64A007F54F3 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 813A25901AC0F64A007F54F3 /* libsqlite3.dylib */; }; + 813DFC911AB2514C00F25A08 /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC901AB2514C00F25A08 /* FacebookSDK.framework */; }; + 813DFC931AB2515A00F25A08 /* Bolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC921AB2515A00F25A08 /* Bolts.framework */; }; + 813DFC951AB251F700F25A08 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC941AB251F700F25A08 /* Parse.framework */; }; + 81411E1A1BC494FA0004BE84 /* PFFacebookTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 81411E151BC494FA0004BE84 /* PFFacebookTestCase.m */; settings = {ASSET_TAGS = (); }; }; + 81411E1B1BC494FA0004BE84 /* FacebookAuthenticationProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 81411E171BC494FA0004BE84 /* FacebookAuthenticationProviderTests.m */; settings = {ASSET_TAGS = (); }; }; + 81411E1C1BC494FA0004BE84 /* ReceptionistTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 81411E181BC494FA0004BE84 /* ReceptionistTests.m */; settings = {ASSET_TAGS = (); }; }; + 81411E1D1BC494FA0004BE84 /* TokenCachingStrategyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 81411E191BC494FA0004BE84 /* TokenCachingStrategyTests.m */; settings = {ASSET_TAGS = (); }; }; + 81B3F2281AC9C9A700A92677 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 81B3F2271AC9C9A700A92677 /* Localizable.strings */; }; + 81F8BCD61BC4A2FF00256269 /* PFFacebookAuthenticationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCCA1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCD71BC4A2FF00256269 /* PFFacebookAuthenticationProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCCB1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.m */; settings = {ASSET_TAGS = (); }; }; + 81F8BCD81BC4A2FF00256269 /* PFFacebookAuthenticationProvider_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCCC1BC4A2FF00256269 /* PFFacebookAuthenticationProvider_Private.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCD91BC4A2FF00256269 /* PFFacebookPrivateUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCCD1BC4A2FF00256269 /* PFFacebookPrivateUtilities.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDA1BC4A2FF00256269 /* PFFacebookPrivateUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCCE1BC4A2FF00256269 /* PFFacebookPrivateUtilities.m */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDB1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCCF1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDC1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCD01BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.m */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDD1BC4A2FF00256269 /* PFFacebookUtils_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCD11BC4A2FF00256269 /* PFFacebookUtils_Private.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDE1BC4A2FF00256269 /* PFReceptionist.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCD21BC4A2FF00256269 /* PFReceptionist.h */; settings = {ASSET_TAGS = (); }; }; + 81F8BCDF1BC4A2FF00256269 /* PFReceptionist.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCD31BC4A2FF00256269 /* PFReceptionist.m */; settings = {ASSET_TAGS = (); }; }; + 81F8BCE01BC4A2FF00256269 /* PFFacebookUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F8BCD41BC4A2FF00256269 /* PFFacebookUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 81F8BCE11BC4A2FF00256269 /* PFFacebookUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCD51BC4A2FF00256269 /* PFFacebookUtils.m */; settings = {ASSET_TAGS = (); }; }; + 81F8BCE91BC4A33A00256269 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F8BCE61BC4A32E00256269 /* main.m */; settings = {ASSET_TAGS = (); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 813A255E1AC0F3E2007F54F3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = "ParseFacebookUtils-iOS"; + }; + F5FCA46C1B5438E30071E3AE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F5FCA4441B5438A10071E3AE; + remoteInfo = ParseFacebookTestApplication; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 813A25571AC0F3E2007F54F3 /* ParseFacebookUtilsV3-UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ParseFacebookUtilsV3-UnitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 813A25641AC0F4A1007F54F3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 813A25881AC0F625007F54F3 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; }; + 813A258C1AC0F62E007F54F3 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + 813A25901AC0F64A007F54F3 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/usr/lib/libsqlite3.dylib; sourceTree = DEVELOPER_DIR; }; + 813DFC901AB2514C00F25A08 /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = Vendor/FacebookSDK.framework; sourceTree = ""; }; + 813DFC921AB2515A00F25A08 /* Bolts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Bolts.framework; path = Vendor/Bolts.framework; sourceTree = ""; }; + 813DFC941AB251F700F25A08 /* Parse.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Parse.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 81411E141BC494FA0004BE84 /* PFFacebookTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookTestCase.h; sourceTree = ""; }; + 81411E151BC494FA0004BE84 /* PFFacebookTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookTestCase.m; sourceTree = ""; }; + 81411E171BC494FA0004BE84 /* FacebookAuthenticationProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthenticationProviderTests.m; sourceTree = ""; }; + 81411E181BC494FA0004BE84 /* ReceptionistTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReceptionistTests.m; sourceTree = ""; }; + 81411E191BC494FA0004BE84 /* TokenCachingStrategyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TokenCachingStrategyTests.m; sourceTree = ""; }; + 81B3F2271AC9C9A700A92677 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Localizable.strings; path = Resources/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 81F8BCCA1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookAuthenticationProvider.h; sourceTree = ""; }; + 81F8BCCB1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookAuthenticationProvider.m; sourceTree = ""; }; + 81F8BCCC1BC4A2FF00256269 /* PFFacebookAuthenticationProvider_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookAuthenticationProvider_Private.h; sourceTree = ""; }; + 81F8BCCD1BC4A2FF00256269 /* PFFacebookPrivateUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookPrivateUtilities.h; sourceTree = ""; }; + 81F8BCCE1BC4A2FF00256269 /* PFFacebookPrivateUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookPrivateUtilities.m; sourceTree = ""; }; + 81F8BCCF1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookTokenCachingStrategy.h; sourceTree = ""; }; + 81F8BCD01BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookTokenCachingStrategy.m; sourceTree = ""; }; + 81F8BCD11BC4A2FF00256269 /* PFFacebookUtils_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookUtils_Private.h; sourceTree = ""; }; + 81F8BCD21BC4A2FF00256269 /* PFReceptionist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFReceptionist.h; sourceTree = ""; }; + 81F8BCD31BC4A2FF00256269 /* PFReceptionist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFReceptionist.m; sourceTree = ""; }; + 81F8BCD41BC4A2FF00256269 /* PFFacebookUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookUtils.h; sourceTree = ""; }; + 81F8BCD51BC4A2FF00256269 /* PFFacebookUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookUtils.m; sourceTree = ""; }; + 81F8BCE61BC4A32E00256269 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 81F8BCE81BC4A32E00256269 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 850C9674A903DFCDD92629DB /* libPods-ParseFacebookUtilsV3-UnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ParseFacebookUtilsV3-UnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D2AAC07E0554694100DB518D /* ParseFacebookUtils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ParseFacebookUtils.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F5B066241B74184100AD8C95 /* ParseFacebookUtils-iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ParseFacebookUtils-iOS.xcconfig"; sourceTree = ""; }; + F5B066261B74184100AD8C95 /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; + F5B066281B74184100AD8C95 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = ""; }; + F5B066291B74184100AD8C95 /* OSX.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = OSX.xcconfig; sourceTree = ""; }; + F5B0662B1B74184100AD8C95 /* Application.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Application.xcconfig; sourceTree = ""; }; + F5B0662C1B74184100AD8C95 /* Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Framework.xcconfig; sourceTree = ""; }; + F5B0662D1B74184100AD8C95 /* UnitTest.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = UnitTest.xcconfig; sourceTree = ""; }; + F5B0662F1B74184100AD8C95 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + F5B066301B74184100AD8C95 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + F5B066321B74184100AD8C95 /* Warnings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + F5B066401B74196B00AD8C95 /* ParseFacebookUtilsV3-UnitTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ParseFacebookUtilsV3-UnitTests.xcconfig"; sourceTree = ""; }; + F5B066411B741AA400AD8C95 /* ParseFacebookTestApplication.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ParseFacebookTestApplication.xcconfig; sourceTree = ""; }; + F5FCA4451B5438A10071E3AE /* ParseFacebookTestApplication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ParseFacebookTestApplication.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 813A25541AC0F3E2007F54F3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 813A25911AC0F64A007F54F3 /* libsqlite3.dylib in Frameworks */, + 813A258D1AC0F62E007F54F3 /* SystemConfiguration.framework in Frameworks */, + 813A25891AC0F625007F54F3 /* AudioToolbox.framework in Frameworks */, + 813A255D1AC0F3E2007F54F3 /* ParseFacebookUtils.framework in Frameworks */, + 813A25851AC0F5D5007F54F3 /* Parse.framework in Frameworks */, + 813A25861AC0F5D5007F54F3 /* Bolts.framework in Frameworks */, + 813A25871AC0F5D5007F54F3 /* FacebookSDK.framework in Frameworks */, + 0AB0D828E83D9F068028E5B9 /* libPods-ParseFacebookUtilsV3-UnitTests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 813DFC951AB251F700F25A08 /* Parse.framework in Frameworks */, + 813DFC931AB2515A00F25A08 /* Bolts.framework in Frameworks */, + 813DFC911AB2514C00F25A08 /* FacebookSDK.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F5FCA4421B5438A10071E3AE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* ParseFacebookUtils.framework */, + 813A25571AC0F3E2007F54F3 /* ParseFacebookUtilsV3-UnitTests.xctest */, + F5FCA4451B5438A10071E3AE /* ParseFacebookTestApplication.app */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* Breakpad */ = { + isa = PBXGroup; + children = ( + F5B066211B74184100AD8C95 /* Configurations */, + 81F8BCC81BC4A2FF00256269 /* ParseFacebookUtils */, + 813DFC961AB2524C00F25A08 /* Resources */, + 813A25661AC0F4A5007F54F3 /* Tests */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + ); + indentWidth = 4; + name = Breakpad; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 813DFC8F1AB2513D00F25A08 /* User Frameworks */, + 813DFC8E1AB2513300F25A08 /* System Frameworks */, + 850C9674A903DFCDD92629DB /* libPods-ParseFacebookUtilsV3-UnitTests.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 813A25631AC0F4A1007F54F3 /* Resources */ = { + isa = PBXGroup; + children = ( + 813A25641AC0F4A1007F54F3 /* Info.plist */, + ); + name = Resources; + path = Tests/Resources; + sourceTree = ""; + }; + 813A25661AC0F4A5007F54F3 /* Tests */ = { + isa = PBXGroup; + children = ( + 81411E161BC494FA0004BE84 /* Unit */, + 81411E121BC494FA0004BE84 /* Other */, + 813A25631AC0F4A1007F54F3 /* Resources */, + 81F8BCE41BC4A32E00256269 /* TestApplication */, + ); + name = Tests; + sourceTree = ""; + }; + 813DFC8E1AB2513300F25A08 /* System Frameworks */ = { + isa = PBXGroup; + children = ( + 813A258C1AC0F62E007F54F3 /* SystemConfiguration.framework */, + 813A25881AC0F625007F54F3 /* AudioToolbox.framework */, + 813A25901AC0F64A007F54F3 /* libsqlite3.dylib */, + ); + name = "System Frameworks"; + sourceTree = ""; + }; + 813DFC8F1AB2513D00F25A08 /* User Frameworks */ = { + isa = PBXGroup; + children = ( + 813DFC941AB251F700F25A08 /* Parse.framework */, + 813DFC921AB2515A00F25A08 /* Bolts.framework */, + 813DFC901AB2514C00F25A08 /* FacebookSDK.framework */, + ); + name = "User Frameworks"; + sourceTree = ""; + }; + 813DFC961AB2524C00F25A08 /* Resources */ = { + isa = PBXGroup; + children = ( + 81B3F2271AC9C9A700A92677 /* Localizable.strings */, + ); + name = Resources; + path = Classes; + sourceTree = ""; + }; + 81411E121BC494FA0004BE84 /* Other */ = { + isa = PBXGroup; + children = ( + 81411E131BC494FA0004BE84 /* TestCase */, + ); + name = Other; + path = Tests/Other; + sourceTree = ""; + }; + 81411E131BC494FA0004BE84 /* TestCase */ = { + isa = PBXGroup; + children = ( + 81411E141BC494FA0004BE84 /* PFFacebookTestCase.h */, + 81411E151BC494FA0004BE84 /* PFFacebookTestCase.m */, + ); + path = TestCase; + sourceTree = ""; + }; + 81411E161BC494FA0004BE84 /* Unit */ = { + isa = PBXGroup; + children = ( + 81411E171BC494FA0004BE84 /* FacebookAuthenticationProviderTests.m */, + 81411E181BC494FA0004BE84 /* ReceptionistTests.m */, + 81411E191BC494FA0004BE84 /* TokenCachingStrategyTests.m */, + ); + name = Unit; + path = Tests/Unit; + sourceTree = ""; + }; + 81F8BCC81BC4A2FF00256269 /* ParseFacebookUtils */ = { + isa = PBXGroup; + children = ( + 81F8BCC91BC4A2FF00256269 /* Internal */, + 81F8BCD41BC4A2FF00256269 /* PFFacebookUtils.h */, + 81F8BCD51BC4A2FF00256269 /* PFFacebookUtils.m */, + ); + path = ParseFacebookUtils; + sourceTree = ""; + }; + 81F8BCC91BC4A2FF00256269 /* Internal */ = { + isa = PBXGroup; + children = ( + 81F8BCCA1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.h */, + 81F8BCCB1BC4A2FF00256269 /* PFFacebookAuthenticationProvider.m */, + 81F8BCCC1BC4A2FF00256269 /* PFFacebookAuthenticationProvider_Private.h */, + 81F8BCCD1BC4A2FF00256269 /* PFFacebookPrivateUtilities.h */, + 81F8BCCE1BC4A2FF00256269 /* PFFacebookPrivateUtilities.m */, + 81F8BCCF1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.h */, + 81F8BCD01BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.m */, + 81F8BCD11BC4A2FF00256269 /* PFFacebookUtils_Private.h */, + 81F8BCD21BC4A2FF00256269 /* PFReceptionist.h */, + 81F8BCD31BC4A2FF00256269 /* PFReceptionist.m */, + ); + path = Internal; + sourceTree = ""; + }; + 81F8BCE41BC4A32E00256269 /* TestApplication */ = { + isa = PBXGroup; + children = ( + 81F8BCE51BC4A32E00256269 /* Classes */, + 81F8BCE71BC4A32E00256269 /* Resources */, + ); + name = TestApplication; + path = Tests/TestApplication; + sourceTree = ""; + }; + 81F8BCE51BC4A32E00256269 /* Classes */ = { + isa = PBXGroup; + children = ( + 81F8BCE61BC4A32E00256269 /* main.m */, + ); + path = Classes; + sourceTree = ""; + }; + 81F8BCE71BC4A32E00256269 /* Resources */ = { + isa = PBXGroup; + children = ( + 81F8BCE81BC4A32E00256269 /* Info.plist */, + ); + path = Resources; + sourceTree = ""; + }; + F5B066211B74184100AD8C95 /* Configurations */ = { + isa = PBXGroup; + children = ( + F5B066241B74184100AD8C95 /* ParseFacebookUtils-iOS.xcconfig */, + F5B066401B74196B00AD8C95 /* ParseFacebookUtilsV3-UnitTests.xcconfig */, + F5B066411B741AA400AD8C95 /* ParseFacebookTestApplication.xcconfig */, + F5B066251B74184100AD8C95 /* Shared */, + ); + path = Configurations; + sourceTree = ""; + }; + F5B066251B74184100AD8C95 /* Shared */ = { + isa = PBXGroup; + children = ( + F5B066261B74184100AD8C95 /* Common.xcconfig */, + F5B066271B74184100AD8C95 /* Platform */, + F5B0662A1B74184100AD8C95 /* Product */, + F5B0662E1B74184100AD8C95 /* Project */, + F5B066321B74184100AD8C95 /* Warnings.xcconfig */, + ); + path = Shared; + sourceTree = ""; + }; + F5B066271B74184100AD8C95 /* Platform */ = { + isa = PBXGroup; + children = ( + F5B066281B74184100AD8C95 /* iOS.xcconfig */, + F5B066291B74184100AD8C95 /* OSX.xcconfig */, + ); + path = Platform; + sourceTree = ""; + }; + F5B0662A1B74184100AD8C95 /* Product */ = { + isa = PBXGroup; + children = ( + F5B0662B1B74184100AD8C95 /* Application.xcconfig */, + F5B0662C1B74184100AD8C95 /* Framework.xcconfig */, + F5B0662D1B74184100AD8C95 /* UnitTest.xcconfig */, + ); + path = Product; + sourceTree = ""; + }; + F5B0662E1B74184100AD8C95 /* Project */ = { + isa = PBXGroup; + children = ( + F5B0662F1B74184100AD8C95 /* Debug.xcconfig */, + F5B066301B74184100AD8C95 /* Release.xcconfig */, + ); + path = Project; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 81F8BCD61BC4A2FF00256269 /* PFFacebookAuthenticationProvider.h in Headers */, + 81F8BCE01BC4A2FF00256269 /* PFFacebookUtils.h in Headers */, + 81F8BCD81BC4A2FF00256269 /* PFFacebookAuthenticationProvider_Private.h in Headers */, + 81F8BCDB1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.h in Headers */, + 81F8BCD91BC4A2FF00256269 /* PFFacebookPrivateUtilities.h in Headers */, + 81F8BCDD1BC4A2FF00256269 /* PFFacebookUtils_Private.h in Headers */, + 81F8BCDE1BC4A2FF00256269 /* PFReceptionist.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 813A25561AC0F3E2007F54F3 /* ParseFacebookUtilsV3-UnitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 813A25621AC0F3E2007F54F3 /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV3-UnitTests" */; + buildPhases = ( + A5A32EB1A5CEDEBF2FA4508C /* Check Pods Manifest.lock */, + 813A25531AC0F3E2007F54F3 /* Sources */, + 813A25541AC0F3E2007F54F3 /* Frameworks */, + 813A25551AC0F3E2007F54F3 /* Resources */, + C6C6BB663BE974007E6AFBC3 /* Embed Pods Frameworks */, + 75DDE068FD0866B77B492CD9 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 813A255F1AC0F3E2007F54F3 /* PBXTargetDependency */, + F5FCA46D1B5438E30071E3AE /* PBXTargetDependency */, + ); + name = "ParseFacebookUtilsV3-UnitTests"; + productName = "ParseFacebookUtilsV3 Tests"; + productReference = 813A25571AC0F3E2007F54F3 /* ParseFacebookUtilsV3-UnitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D2AAC07D0554694100DB518D /* ParseFacebookUtils-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "ParseFacebookUtils-iOS" */; + buildPhases = ( + 81F8BCEA1BC4A36F00256269 /* Fetch latest Parse.framework */, + 81B3F2261AC9C87600A92677 /* Generate Localizable Strings */, + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + 8139B1341A7BF6B5002BEF84 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ParseFacebookUtils-iOS"; + productName = Breakpad; + productReference = D2AAC07E0554694100DB518D /* ParseFacebookUtils.framework */; + productType = "com.apple.product-type.framework"; + }; + F5FCA4441B5438A10071E3AE /* ParseFacebookTestApplication */ = { + isa = PBXNativeTarget; + buildConfigurationList = F5FCA4651B5438A10071E3AE /* Build configuration list for PBXNativeTarget "ParseFacebookTestApplication" */; + buildPhases = ( + F5FCA4411B5438A10071E3AE /* Sources */, + F5FCA4421B5438A10071E3AE /* Frameworks */, + F5FCA4431B5438A10071E3AE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ParseFacebookTestApplication; + productName = PFFacebookTestApplication; + productReference = F5FCA4451B5438A10071E3AE /* ParseFacebookTestApplication.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = PF; + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = "Parse, LLC"; + TargetAttributes = { + 813A25561AC0F3E2007F54F3 = { + CreatedOnToolsVersion = 6.2; + TestTargetID = F5FCA4441B5438A10071E3AE; + }; + F5FCA4441B5438A10071E3AE = { + CreatedOnToolsVersion = 6.4; + }; + }; + }; + buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "ParseFacebookUtils" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + da, + de, + es, + fr, + it, + ja, + nl, + no, + sl, + sv, + tr, + en, + Base, + ); + mainGroup = 0867D691FE84028FC02AAC07 /* Breakpad */; + productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC07D0554694100DB518D /* ParseFacebookUtils-iOS */, + 813A25561AC0F3E2007F54F3 /* ParseFacebookUtilsV3-UnitTests */, + F5FCA4441B5438A10071E3AE /* ParseFacebookTestApplication */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8139B1341A7BF6B5002BEF84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81B3F2281AC9C9A700A92677 /* Localizable.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 813A25551AC0F3E2007F54F3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F5FCA4431B5438A10071E3AE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 75DDE068FD0866B77B492CD9 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ParseFacebookUtilsV3-UnitTests/Pods-ParseFacebookUtilsV3-UnitTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 81B3F2261AC9C87600A92677 /* Generate Localizable Strings */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate Localizable Strings"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Generate localizable strings\nfind $PROJECT_DIR -name '*.m' -print0 | xargs -0 genstrings -q -o $PROJECT_DIR/Resources\necho \"Finished converting images\""; + }; + 81F8BCEA1BC4A36F00256269 /* Fetch latest Parse.framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Fetch latest Parse.framework"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ ! -d $SRCROOT/Vendor ]; then\n mkdir $SRCROOT/Vendor\nfi\n\ncd $SRCROOT/Vendor\n\nif [[ ! -d \"Parse.framework\" || ! -d \"Bolts.framework\" ]]; then\n ARCHIVE_NAME=Parse-iOS.zip\n\n LATEST_TAG=$(bash -l -c \"bundle exec pod spec cat Parse\" | grep version | head -n 1 | cut -d '\"' -f 4)\n ARCHIVE_URL=\"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/releases/download/${LATEST_TAG}/${ARCHIVE_NAME}\"\n curl -O -L $ARCHIVE_URL\n\n unzip $ARCHIVE_NAME\n rm $ARCHIVE_NAME\nfi\n"; + }; + A5A32EB1A5CEDEBF2FA4508C /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + C6C6BB663BE974007E6AFBC3 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ParseFacebookUtilsV3-UnitTests/Pods-ParseFacebookUtilsV3-UnitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 813A25531AC0F3E2007F54F3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81411E1D1BC494FA0004BE84 /* TokenCachingStrategyTests.m in Sources */, + 81411E1A1BC494FA0004BE84 /* PFFacebookTestCase.m in Sources */, + 81411E1C1BC494FA0004BE84 /* ReceptionistTests.m in Sources */, + 81411E1B1BC494FA0004BE84 /* FacebookAuthenticationProviderTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81F8BCE11BC4A2FF00256269 /* PFFacebookUtils.m in Sources */, + 81F8BCDA1BC4A2FF00256269 /* PFFacebookPrivateUtilities.m in Sources */, + 81F8BCDC1BC4A2FF00256269 /* PFFacebookTokenCachingStrategy.m in Sources */, + 81F8BCDF1BC4A2FF00256269 /* PFReceptionist.m in Sources */, + 81F8BCD71BC4A2FF00256269 /* PFFacebookAuthenticationProvider.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F5FCA4411B5438A10071E3AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81F8BCE91BC4A33A00256269 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 813A255F1AC0F3E2007F54F3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* ParseFacebookUtils-iOS */; + targetProxy = 813A255E1AC0F3E2007F54F3 /* PBXContainerItemProxy */; + }; + F5FCA46D1B5438E30071E3AE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F5FCA4441B5438A10071E3AE /* ParseFacebookTestApplication */; + targetProxy = F5FCA46C1B5438E30071E3AE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066241B74184100AD8C95 /* ParseFacebookUtils-iOS.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066241B74184100AD8C95 /* ParseFacebookUtils-iOS.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B0662F1B74184100AD8C95 /* Debug.xcconfig */; + buildSettings = { + PARSE_DIR = "$(PROJECT_DIR)/.."; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066301B74184100AD8C95 /* Release.xcconfig */; + buildSettings = { + PARSE_DIR = "$(PROJECT_DIR)/.."; + }; + name = Release; + }; + 813A25601AC0F3E2007F54F3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066401B74196B00AD8C95 /* ParseFacebookUtilsV3-UnitTests.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 813A25611AC0F3E2007F54F3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066401B74196B00AD8C95 /* ParseFacebookUtilsV3-UnitTests.xcconfig */; + buildSettings = { + }; + name = Release; + }; + F5FCA4661B5438A10071E3AE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066411B741AA400AD8C95 /* ParseFacebookTestApplication.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + F5FCA4671B5438A10071E3AE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F5B066411B741AA400AD8C95 /* ParseFacebookTestApplication.xcconfig */; + buildSettings = { + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "ParseFacebookUtils-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB921F08733DC00010E9CD /* Debug */, + 1DEB922008733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "ParseFacebookUtils" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB922308733DC00010E9CD /* Debug */, + 1DEB922408733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 813A25621AC0F3E2007F54F3 /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV3-UnitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 813A25601AC0F3E2007F54F3 /* Debug */, + 813A25611AC0F3E2007F54F3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F5FCA4651B5438A10071E3AE /* Build configuration list for PBXNativeTarget "ParseFacebookTestApplication" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F5FCA4661B5438A10071E3AE /* Debug */, + F5FCA4671B5438A10071E3AE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/ParseFacebookUtils.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ParseFacebookUtils.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0435b7b --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtils-iOS.xcscheme b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtils-iOS.xcscheme new file mode 100644 index 0000000..acfba17 --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtils-iOS.xcscheme @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParseFacebookUtils.xcworkspace/contents.xcworkspacedata b/ParseFacebookUtils.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..10a329b --- /dev/null +++ b/ParseFacebookUtils.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.h b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.h new file mode 100644 index 0000000..192c090 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.h @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +#import "PFFacebookTokenCachingStrategy.h" + +extern NSString *const PFFacebookUserAuthenticationType; + +@protocol PFFacebookSessionProvider + +- (FBSession *)sessionWithAppID:(NSString *)appId + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)strategy; + +@end + +@class BFTask; + +@interface PFFacebookAuthenticationProvider : NSObject + +- (BFTask *)authenticateAsync; +- (BFTask *)reauthorizeInBackground; + +// Allows an existing session to be reauthorized with new permissions +- (NSDictionary *)authDataWithFacebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expiration:(NSDate *)expiration; +- (void)initializeSession; +- (BOOL)handleOpenURL:(NSURL *)url; + +@property (nonatomic, weak) id sessionProvider; + +// Facebook and Session objects to be passed back to users +@property (nonatomic, strong, readonly) FBSession *session; +@property (nonatomic, assign) FBSessionLoginBehavior loginBehavior; + +// Facebook SDK configuration options -- these are passed directly to Facebook and we +// don't do any further processing on them. +@property (nonatomic, copy) NSString *appId; +@property (nonatomic, copy) NSArray *permissions; +@property (nonatomic, copy) NSString *urlSchemeSuffix; +@property (nonatomic, assign) FBSessionDefaultAudience audience; + +// A callback that occurs whenever a token extension occurs. For now, we won't handle +// token extensions, but we may in the future. +@property (nonatomic, copy) void (^tokenExtensionCallback)(NSDictionary *authData); + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m new file mode 100644 index 0000000..11434a6 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m @@ -0,0 +1,327 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookAuthenticationProvider_Private.h" + +#import +#import +#import + +#import +#import + +#import + +#import "PFFacebookPrivateUtilities.h" +#import "PFReceptionist.h" + +NSString *const PFFacebookUserAuthenticationType = @"facebook"; + +@interface PFFacebookAuthenticationProvider () + +@property (nonatomic, strong) FBSession *session; + +@property (atomic, assign) int32_t currentOperationId; +@property (nonatomic, assign) BOOL useCustomLoginBehavior; + +@end + +@interface FBSession () + +/*! + Internal only method on FBSession that clears the thread affinity information. + We need this to be able to use FBSession from multiple threads. + */ +- (void)clearAffinitizedThread; + + +@end + +@implementation PFFacebookAuthenticationProvider + +///-------------------------------------- +#pragma mark - Init +///-------------------------------------- + +- (instancetype)init { + self = [super init]; + if (!self) return nil; + + self.sessionProvider = self; + self.tokenCache = [[PFFacebookTokenCachingStrategy alloc] init]; + + return self; +} + +- (FBSession *)_rawSession { + return [(PFReceptionist *)self.session rawReceiver]; +} + ++ (NSString *)authType { + return @"facebook"; +} + +- (NSDictionary *)authDataWithFacebookId:(NSString *)facebookIdString + accessToken:(NSString *)accessToken + expiration:(NSDate *)expiration { + return @{ + @"id" : facebookIdString, + @"access_token" : accessToken, + @"expiration_date" : [[NSDateFormatter pffb_preciseDateFormatter] stringFromDate:expiration] + }; +} + +- (BOOL)containsPublishPermission { + for (NSString *permission in _permissions) { + NSRange publishRange = [permission rangeOfString:@"publish"]; + if (publishRange.location != NSNotFound) { + return YES; + } + } + return NO; +} + +- (BFTask *)authenticateAsync { + BFTaskCompletionSource *source = [BFTaskCompletionSource taskCompletionSource]; + + // Hold onto the tokenCache and associate it with this callback. + PFFacebookTokenCachingStrategy *scopedCache = self.tokenCache; + + int32_t scopedOperationId = OSAtomicIncrement32(&_currentOperationId); + __block BOOL called = NO; + id sessionProxy = [[PFReceptionist alloc] initWithFactory:^id{ + return [self.sessionProvider sessionWithAppID:self.appId + permissions:self.permissions + urlSchemeSuffix:self.urlSchemeSuffix + tokenCacheStrategy:scopedCache]; + } thread:[NSThread mainThread]]; + + self.session = sessionProxy; + + FBSessionLoginBehavior behavior = 0; + if (self.useCustomLoginBehavior) { + behavior = self.loginBehavior; + } else { + behavior = FBSessionLoginBehaviorUseSystemAccountIfPresent; + if ([self containsPublishPermission]) { + behavior = FBSessionLoginBehaviorWithFallbackToWebView; + } + } + [self.session openWithBehavior:behavior + completionHandler:^(FBSession *callingSession, FBSessionState status, NSError *openError) { + if (called) { + if ((status & FBSessionStateOpenTokenExtended) == FBSessionStateOpenTokenExtended && + _tokenExtensionCallback) { + _tokenExtensionCallback([self authDataWithFacebookId:scopedCache.facebookId + accessToken:scopedCache.accessToken + expiration:scopedCache.expirationDate]); + } + return; + } + called = YES; + if (scopedOperationId != self.currentOperationId) { + [source trySetCancelled]; + return; + } + if (callingSession.isOpen) { + // Success! Now we need to get the FBID for the current user. + FBRequest *meRequest = [FBRequest requestWithGraphPath:@"me" + parameters:@{ @"fields" : @"id" } + HTTPMethod:@"GET"]; + meRequest.session = callingSession; + [meRequest startWithCompletionHandler:^(FBRequestConnection *connection, + id result, + NSError *meError) { + if (scopedOperationId != self.currentOperationId) { + [source trySetCancelled]; + return; + } + scopedCache.facebookId = result[@"id"]; + if (meError) { + [source trySetError:meError]; + } else { + NSDictionary *authData = [self authDataWithFacebookId:scopedCache.facebookId + accessToken:scopedCache.accessToken + expiration:scopedCache.expirationDate]; + + // Check if this session has userID cached, if not - recreate the full + // session from the authData we got. + // This is done to make sure FBSession has `userID` cached and won't strip it away. + if (!self.session.accessTokenData.userID) { + [self restoreAuthenticationWithAuthData:nil]; + [self restoreAuthenticationWithAuthData:authData]; + } else { + [FBSession setActiveSession:sessionProxy]; + } + [source trySetResult:authData]; + } + }]; + } else if (openError) { + // An error occurred + [source trySetError:openError]; + } else { + // Cancellation + [source trySetCancelled]; + } + }]; + + return source.task; +} + +- (void)initializeSession { + id sessionProxy = [[PFReceptionist alloc] initWithFactory:^id{ + FBSession.activeSession = nil; + return [self.sessionProvider sessionWithAppID:self.appId + permissions:self.permissions + urlSchemeSuffix:self.urlSchemeSuffix + tokenCacheStrategy:self.tokenCache]; + } thread:[NSThread mainThread]]; + self.session = FBSession.activeSession = sessionProxy; +} + +- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary *)authData { + if (!authData) { + OSAtomicIncrement32(&_currentOperationId); + self.tokenCache.facebookId = nil; + self.tokenCache.expirationDate = nil; + self.tokenCache.accessToken = nil; + self.session = nil; + return YES; + } + + NSString *accessToken = authData[@"access_token"]; + NSString *expirationDateString = authData[@"expiration_date"]; + if (accessToken && expirationDateString) { + PFFacebookTokenCachingStrategy *newTokenCache; + if (![accessToken isEqualToString:self.tokenCache.accessToken]) { + // Only swap out the token cache if the access token changed (so that permissions, etc. are still cached). + newTokenCache = [[PFFacebookTokenCachingStrategy alloc] init]; + newTokenCache.facebookId = authData[@"id"]; + newTokenCache.accessToken = accessToken; + newTokenCache.expirationDate = [[NSDateFormatter pffb_preciseDateFormatter] dateFromString:expirationDateString]; + self.tokenCache = newTokenCache; + } else { + newTokenCache = self.tokenCache; + } + FBSession *rawSession = self._rawSession; + if (!rawSession.isOpen || + !([rawSession.accessTokenData.accessToken isEqualToString:self.tokenCache.accessToken] && + [rawSession.accessTokenData.expirationDate isEqualToDate:self.tokenCache.expirationDate])) { + rawSession = [self.sessionProvider sessionWithAppID:self.appId + permissions:nil // We don't pass the permissions here because + // we don't actually know the permissions for + // this access token at this point. + urlSchemeSuffix:self.urlSchemeSuffix + tokenCacheStrategy:self.tokenCache]; + if ([rawSession respondsToSelector:@selector(clearAffinitizedThread)]) { + [rawSession performSelector:@selector(clearAffinitizedThread)]; + } + + id sessionProxy = [[PFReceptionist alloc] initWithTarget:rawSession thread:[NSThread mainThread]]; + self.session = sessionProxy; + + // The session has changed altogether. Open a new one if the token hasn't already expired. + if (NSOrderedAscending == [self.tokenCache.expirationDate compare:[NSDate date]]) { + return YES; + } + + int32_t scopedOperationId = OSAtomicIncrement32(&_currentOperationId); + __block BOOL called = NO; + + if (rawSession.state == FBSessionStateCreatedTokenLoaded) { + [rawSession openWithBehavior:FBSessionLoginBehaviorWithNoFallbackToWebView + completionHandler:^(FBSession *callingSession, FBSessionState status, NSError *error) { + if (!called) { + if (callingSession.isOpen && self.currentOperationId == scopedOperationId) { + if ([rawSession respondsToSelector:@selector(clearAffinitizedThread)]) { + [rawSession performSelector:@selector(clearAffinitizedThread)]; + } + self.tokenCache = newTokenCache; + + if ([NSThread isMainThread]) { + [FBSession setActiveSession:sessionProxy]; + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + [FBSession setActiveSession:sessionProxy]; + }); + } + } + } + called = YES; + if ((status & FBSessionStateOpenTokenExtended) == FBSessionStateOpenTokenExtended && + _tokenExtensionCallback) { + _tokenExtensionCallback([self authDataWithFacebookId:newTokenCache.facebookId + accessToken:newTokenCache.accessToken + expiration:newTokenCache.expirationDate]); + } + }]; + } + } + return YES; + } + return NO; +} + +- (BFTask *)reauthorizeInBackground { + if (!self.session.isOpen) { + [NSException raise:NSInternalInconsistencyException + format:@"The user must already have a valid, open Facebook session to reauthorize."]; + } + + BFTaskCompletionSource *source = [BFTaskCompletionSource taskCompletionSource]; + + NSString *originalFacebookId = self.tokenCache.facebookId; + [self.session requestNewPublishPermissions:self.permissions + defaultAudience:_audience + completionHandler:^(FBSession *session, NSError *error) { + if (error) { + [source trySetError:error]; + } else { + self.tokenCache.facebookId = originalFacebookId; + NSDictionary *authData = [self authDataWithFacebookId:self.tokenCache.facebookId + accessToken:self.tokenCache.accessToken + expiration:self.tokenCache.expirationDate]; + [source trySetResult:authData]; + } + }]; + return source.task; +} + +- (BOOL)handleOpenURL:(NSURL *)url { + return [FBAppCall handleOpenURL:url + sourceApplication:@"com.facebook.ParseProxy" + withSession:self.session]; +} + +///-------------------------------------- +#pragma mark - Accessors +///-------------------------------------- + +- (void)setLoginBehavior:(FBSessionLoginBehavior)loginBehavior { + if (self.loginBehavior != loginBehavior) { + _loginBehavior = loginBehavior; + } + self.useCustomLoginBehavior = YES; +} + +///-------------------------------------- +#pragma mark - PFFacebookSessionProvider +///-------------------------------------- + +- (FBSession *)sessionWithAppID:(NSString *)appId + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)strategy { + return [[FBSession alloc] initWithAppID:appId + permissions:permissions + urlSchemeSuffix:urlSchemeSuffix + tokenCacheStrategy:strategy]; +} + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h new file mode 100644 index 0000000..a4e8549 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookAuthenticationProvider.h" + +@class PFFacebookTokenCachingStrategy; + +@interface PFFacebookAuthenticationProvider () + +@property (nonatomic, strong) PFFacebookTokenCachingStrategy *tokenCache; + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h new file mode 100644 index 0000000..2bb8217 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +#import + +@interface PFFacebookPrivateUtilities : NSObject + ++ (void)safePerformSelector:(SEL)selector + onTarget:(id)target + withObject:(id)object + object:(id)anotherObject; + +@end + +@interface BFTask (ParseFacebookUtils) + +- (id)pffb_waitForResult:(NSError **)error; +- (instancetype)pffb_continueWithMainThreadUserBlock:(PFUserResultBlock)block; +- (instancetype)pffb_continueWithMainThreadBooleanBlock:(PFBooleanResultBlock)block; +- (instancetype)pffb_continueWithMainThreadBlock:(BFContinuationBlock)block; + +@end + +@interface NSDateFormatter (ParseFacebookUtils) + ++ (instancetype)pffb_preciseDateFormatter; + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m new file mode 100644 index 0000000..a7164e3 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookPrivateUtilities.h" + +#import + +@implementation PFFacebookPrivateUtilities + ++ (void)safePerformSelector:(SEL)selector + onTarget:(id)target + withObject:(id)object + object:(id)anotherObject { + if (target == nil || selector == nil || ![target respondsToSelector:selector]) { + return; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [target performSelector:selector withObject:object withObject:anotherObject]; +#pragma clang diagnostic pop +} + +@end + +@implementation BFTask (ParseFacebookUtils) + +- (id)pffb_waitForResult:(NSError **)error { + [self waitUntilFinished]; + + if (self.cancelled) { + return nil; + } else if (self.exception) { + @throw self.exception; + } + if (self.error && error) { + *error = self.error; + } + return self.result; +} + +- (instancetype)pffb_continueWithMainThreadUserBlock:(PFUserResultBlock)block { + return [self pffb_continueWithMainThreadBlock:^id(BFTask *task) { + if (block) { + block(task.result, task.error); + } + return nil; + }]; +} + +- (instancetype)pffb_continueWithMainThreadBooleanBlock:(PFBooleanResultBlock)block { + return [self pffb_continueWithMainThreadBlock:^id(BFTask *task) { + if (block) { + block([task.result boolValue], task.error); + } + return nil; + }]; +} + +- (instancetype)pffb_continueWithMainThreadBlock:(BFContinuationBlock)block { + return [self continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:block]; +} + +@end + +@implementation NSDateFormatter (ParseFacebookUtils) + ++ (instancetype)pffb_preciseDateFormatter { + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; + formatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; + formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; + return formatter; +} + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.h b/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.h new file mode 100644 index 0000000..deb6f6d --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/*! + A token caching strategy that allows us to easily access and modify + the cached access token, facebook ID, and expiration date. + */ +@interface PFFacebookTokenCachingStrategy : FBSessionTokenCachingStrategy + +@property (nonatomic, copy) NSString *accessToken; +@property (nonatomic, copy) NSString *facebookId; +@property (nonatomic, copy) NSDate *expirationDate; + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.m b/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.m new file mode 100644 index 0000000..1cf8849 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookTokenCachingStrategy.m @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookTokenCachingStrategy.h" + +@interface PFFacebookTokenCachingStrategy () + +@property (nonatomic, strong) NSMutableDictionary *tokenInfo; + +@end + +@implementation PFFacebookTokenCachingStrategy + +@synthesize tokenInfo; + +- (void)prepareTokenInfo { + if (!self.tokenInfo) { + // fetchTokenInformation will cache the token data in tokenInfo. + [super fetchTokenInformation]; + if (!self.tokenInfo) { + self.tokenInfo = [NSMutableDictionary dictionaryWithCapacity:3]; + } + } +} + +- (NSDictionary *)fetchTokenInformation { + NSDictionary *fetched = [super fetchTokenInformation]; + self.tokenInfo = [NSMutableDictionary dictionaryWithDictionary:fetched]; + return fetched; +} + +- (void)clearToken { + [super clearToken]; + self.tokenInfo = nil; +} + +- (void)cacheTokenInformation:(NSDictionary *)tokenInformation { + if ([[NSDate distantFuture] isEqualToDate:tokenInformation[FBTokenInformationExpirationDateKey]]) { + // iOS 6 has real trouble with parsing serialized dates that are equal to distantFuture. + // Facebook's SDK currently has a known bug that causes access tokens that are retrieved from iOS to + // have expirations that are in the distantFuture. + // + // This is a hack to turn them into "really long expirations" (i.e. 2 years) to get around that until + // Facebook and Apple get their act together. + NSMutableDictionary *newTokenInfo = [NSMutableDictionary dictionaryWithDictionary:tokenInformation]; + newTokenInfo[FBTokenInformationExpirationDateKey] = [NSDate dateWithTimeInterval:60 * 60 * 24 * 365 * 2 sinceDate:[NSDate date]]; + tokenInformation = newTokenInfo; + } + [super cacheTokenInformation:tokenInformation]; + self.tokenInfo = [NSMutableDictionary dictionaryWithDictionary:tokenInformation]; +} + +- (NSString *)accessToken { + [self prepareTokenInfo]; + return [self.tokenInfo objectForKey:FBTokenInformationTokenKey]; +} + +- (void)setAccessToken:(NSString *)accessToken { + [self prepareTokenInfo]; + if (!accessToken) { + [self.tokenInfo removeObjectForKey:FBTokenInformationTokenKey]; + } else { + [self.tokenInfo setObject:accessToken forKey:FBTokenInformationTokenKey]; + } + [self cacheTokenInformation:self.tokenInfo]; +} + +- (NSDate *)expirationDate { + [self prepareTokenInfo]; + return [self.tokenInfo objectForKey:FBTokenInformationExpirationDateKey]; +} + +- (void)setExpirationDate:(NSDate *)expirationDate { + [self prepareTokenInfo]; + if (!expirationDate) { + [self.tokenInfo removeObjectForKey:FBTokenInformationExpirationDateKey]; + } else { + [self.tokenInfo setObject:expirationDate forKey:FBTokenInformationExpirationDateKey]; + } + [self cacheTokenInformation:self.tokenInfo]; +} + +- (NSString *)facebookId { + [self prepareTokenInfo]; + return [self.tokenInfo objectForKey:FBTokenInformationUserFBIDKey]; +} + +- (void)setFacebookId:(NSString *)facebookId { + [self prepareTokenInfo]; + if (!facebookId) { + [self.tokenInfo removeObjectForKey:FBTokenInformationUserFBIDKey]; + } else { + [self.tokenInfo setObject:facebookId forKey:FBTokenInformationUserFBIDKey]; + } + [self cacheTokenInformation:self.tokenInfo]; +} + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookUtils_Private.h b/ParseFacebookUtils/Internal/PFFacebookUtils_Private.h new file mode 100644 index 0000000..455f9c4 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookUtils_Private.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "PFFacebookAuthenticationProvider.h" + +@interface PFFacebookUtils () + ++ (PFFacebookAuthenticationProvider *)_authenticationProvider; ++ (void)_setAuthenticationProvider:(PFFacebookAuthenticationProvider *)provider; + +@end diff --git a/ParseFacebookUtils/Internal/PFReceptionist.h b/ParseFacebookUtils/Internal/PFReceptionist.h new file mode 100644 index 0000000..9614ee8 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFReceptionist.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/*! + Provides a proxy that will make all calls synchronously on the affinitized thread. + */ +@interface PFReceptionist : NSProxy + +@property (nonatomic, strong, readonly) id rawReceiver; + +- (instancetype)initWithTarget:(id)target thread:(NSThread *)thread; +- (instancetype)initWithFactory:(id (^)())factory thread:(NSThread *)thread; + +@end diff --git a/ParseFacebookUtils/Internal/PFReceptionist.m b/ParseFacebookUtils/Internal/PFReceptionist.m new file mode 100644 index 0000000..3568fba --- /dev/null +++ b/ParseFacebookUtils/Internal/PFReceptionist.m @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFReceptionist.h" + +/*! + Allows a factory block to be run on some other thread. + */ +@interface PFThreadFactoryBlockRunner : NSObject + +@property (nonatomic, strong) id result; + +@end + +@implementation PFThreadFactoryBlockRunner + +- (void)invokeFactory:(id (^)())factory { + self.result = factory(); +} + +@end + +@implementation PFReceptionist { + id _target; + NSThread *_affinitizedThread; +} + +- (instancetype)initWithTarget:(NSObject *)newTarget thread:(NSThread *)thread { + if (!newTarget) { + return nil; + } + + _target = newTarget; + _affinitizedThread = thread; + + return self; +} + +- (instancetype)initWithFactory:(id (^)())factory thread:(NSThread *)thread { + // If you pass a stack block into performSelector:... it will copy it and leak. + // If you copy the block to the heap here, it will autorelease. + // So adding this random copy actually removes a memory leak. + factory = [factory copy]; + + _affinitizedThread = thread; + PFThreadFactoryBlockRunner *runner = [[PFThreadFactoryBlockRunner alloc] init]; + [runner performSelector:@selector(invokeFactory:) + onThread:_affinitizedThread + withObject:factory + waitUntilDone:YES]; + _target = runner.result; + if (!_target) { + return nil; + } + return self; +} + +- (id)rawReceiver { + return _target; +} + +- (void)forwardInvocation:(NSInvocation *)invocation { + [invocation performSelector:@selector(invokeWithTarget:) + onThread:_affinitizedThread + withObject:_target + waitUntilDone:YES]; +} + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { + return [_target methodSignatureForSelector:sel]; +} + +@end diff --git a/ParseFacebookUtils/PFFacebookUtils.h b/ParseFacebookUtils/PFFacebookUtils.h new file mode 100644 index 0000000..4df0cb6 --- /dev/null +++ b/ParseFacebookUtils/PFFacebookUtils.h @@ -0,0 +1,475 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class BFTask; + +/*! + The `PFFacebookUtils` class provides utility functions for working with Facebook in a Parse application. + + This class is currently for iOS only. + */ +@interface PFFacebookUtils : NSObject + +///-------------------------------------- +/// @name Interacting With Facebook +///-------------------------------------- + +/*! + @abstract Gets the Facebook session for the current user. + */ ++ (nullable FBSession *)session; + +/*! + @abstract Initializes the Facebook singleton. + + @warning You must invoke this in order to use the Facebook functionality in Parse. + + @param appId The Facebook application id that you are using with your Parse application. + + @deprecated Please use `[PFFacebookUtils initializeFacebook]` instead. + */ ++ (void)initializeWithApplicationId:(nullable NSString *)appId PARSE_DEPRECATED("Use [PFFacebookUtils initializeFacebook] instead."); + +/*! + @abstract Initializes the Facebook singleton. + + @warning You must invoke this in order to use the Facebook functionality in Parse. + + @param appId The Facebook application id that you are using with your Parse application. + @param urlSchemeSuffix The URL suffix for this application - used when multiple applications with the same + + @deprecated Please use `[PFFacebookUtils initializeFacebookWithUrlShemeSuffix:]` instead. + */ ++ (void)initializeWithApplicationId:(nullable NSString *)appId + urlSchemeSuffix:(nullable NSString *)urlSchemeSuffix PARSE_DEPRECATED("Use [PFFacebookUtils initializeFacebookWithUrlShemeSuffix:] instead."); + +/*! + @abstract Initializes the Facebook singleton. + + @discussion You must provide your Facebook application ID as the value for FacebookAppID in your bundle's plist file + as described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ + + @warning You must invoke this in order to use the Facebook functionality in Parse. + */ ++ (void)initializeFacebook; + +/*! + @abstract Initializes the Facebook singleton. + + @discussion You must provide your Facebook application ID as the value for FacebookAppID in your bundle's plist file + as described here: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/ + + @warning You must invoke this in order to use the Facebook functionality in Parse. + + @param urlSchemeSuffix The URL suffix for this application - used when multiple applications with the same + Facebook application ID may be on the same device. + */ ++ (void)initializeFacebookWithUrlShemeSuffix:(nullable NSString *)urlSchemeSuffix; + +/*! + @abstract Whether the user has their account linked to Facebook. + + @param user User to check for a facebook link. The user must be logged in on this device. + + @returns `YES` if the user has their account linked to Facebook, otherwise `NO`. + */ ++ (BOOL)isLinkedWithUser:(PFUser *)user; + +///-------------------------------------- +/// @name Customizing Login Behavior +///-------------------------------------- + +/*! + @abstract Sets the default login behavior to be used when logging in or linking users with Facebook. + + @discussion Default is to allow Facebook Login, with fallback to Inline Facebook Login. + + @param behavior The behavior to set. + */ ++ (void)setFacebookLoginBehavior:(FBSessionLoginBehavior)behavior; + +/*! + @abstract Login behavior controls whether to allow, force or prohibit Facebook Login or Inline Facebook Login. + + @discussion Default is to allow Facebook Login, with fallback to Inline Facebook Login. + + @returns The login behavior currently set. + */ ++ (FBSessionLoginBehavior)facebookLoginBehavior; + +///-------------------------------------- +/// @name Logging In & Creating Facebook-Linked Users +///-------------------------------------- + +/*! + @abstract Logs in a user using Facebook *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate the user, + and then automatically logs in (or creates, in the case where it is a new user) a . + + @param permissions The permissions required for Facebook log in. This passed to the authorize method on + the Facebook instance. + + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(PFUser *)*)logInWithPermissionsInBackground:(nullable NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract Logs in a user using Facebook. + + @discussion This method delegates to the Facebook SDK to authenticate the user, + and then automatically logs in (or creates, in the case where it is a new user) a . + `user` is going to be non-nil if the authentication was succesful. + `error` is set if there was an error. + `user` and `error` are both nil - if the user cancelled authentication by switching back to the application. + + @param permissions The permissions required for Facebook log in. This passed to the authorize method on + the Facebook instance. + @param block The block to execute. + It should have the following argument signature: `^(PFUser *user, NSError *error)`. + */ ++ (void)logInWithPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block; + +/* + @abstract Logs in a user using Facebook *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate the user, + and then automatically logs in (or creates, in the case where it is a new user) a . + `user` is going to be non-nil if the authentication was succesful. + `error` is set if there was an error. + `user` and `error` are both nil - if the user cancelled authentication by switching back to the application. + + @param permissions The permissions required for Facebook log in. This passed to the authorize method on + the Facebook instance. + @param target Target object for the selector + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`. + */ ++ (void)logInWithPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + target:(nullable id)target + selector:(nullable SEL)selector; + +/*! + @abstract Logs in a user using Facebook *asynchronously*. + + @discussion Allows you to handle user login to Facebook, then provide authentication + data to log in (or create, in the case where it is a new user) the . + + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(PFUser *)*)logInWithFacebookIdInBackground:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate; + +/*! + @abstract Logs in a user using Facebook *asynchronously*. + + @discussion Allows you to handle user login to Facebook, then provide authentication + data to log in (or create, in the case where it is a new user) the . + + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + @param block The block to execute. + It should have the following argument signature: `^(PFUser *user, NSError *error)`. + */ ++ (void)logInWithFacebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + block:(nullable PFUserResultBlock)block; + +/* + @abstract Logs in a user using Facebook *asynchronously*. + + @discussion Allows you to handle user login to Facebook, then provide authentication + data to log in (or create, in the case where it is a new user) the . + + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + @param target Target object for the selector + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`. + */ ++ (void)logInWithFacebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + target:(nullable id)target + selector:(nullable SEL)selector; + +///-------------------------------------- +/// @name Linking Users with Facebook +///-------------------------------------- + +/*! + @abstract Links Facebook to an existing *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + + @param user User to link to Facebook. + @param permissions The permissions required for Facebook log in. + This passed to the authorize method on the Facebook instance. + + @deprecated Please use `[PFFacebookUtils linkUserInBackground:permissions:]` instead. + */ ++ (void)linkUser:(PFUser *)user permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions PARSE_DEPRECATED("Please use `[PFFacebookUtils linkUserInBackground:permissions:]` instead."); + +/*! + @abstract Links Facebook to an existing *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + + @param user User to link to Facebook. + @param permissions The permissions required for Facebook log in. + This passed to the authorize method on the Facebook instance. + + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract Links Facebook to an existing *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + + @param user User to link to Facebook. + @param permissions The permissions required for Facebook log in. + This passed to the authorize method on the Facebook instance. + @param block The block to execute. + It should have the following argument signature: `^(BOOL *success, NSError *error)`. + */ ++ (void)linkUser:(PFUser *)user + permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block; + +/* + @abstract Links Facebook to an existing *asynchronously*. + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + + @param user User to link to Facebook. + @param permissions The permissions required for Facebook log in. This passed to the authorize method on + the Facebook instance. + @param target Target object for the selector + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`. + */ ++ (void)linkUser:(PFUser *)user + permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + target:(nullable id)target + selector:(nullable SEL)selector; + +/*! + @abstract Links Facebook to an existing *asynchronously*. + + @discussion Allows you to handle user login to Facebook, + then provide authentication data to link the account to the . + + @param user User to link to Facebook. + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate; + +/*! + @abstract Links Facebook to an existing *asynchronously*. + + @discussion Allows you to handle user login to Facebook, + then provide authentication data to link the account to the . + + @param user User to link to Facebook. + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + @param block The block to execute. + It should have the following argument signature: `^(BOOL success, NSError *error)`. + */ ++ (void)linkUser:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + block:(nullable PFBooleanResultBlock)block; + +/* + @abstract Links Facebook to an existing *asynchronously*. + + @discussion Allows you to handle user login to Facebook, + then provide authentication data to link the account to the . + + @param user User to link to Facebook. + @param facebookId The id of the Facebook user being linked + @param accessToken The access token for the user's session + @param expirationDate The expiration date for the access token + @param target Target object for the selector + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`. + */ ++ (void)linkUser:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + target:(nullable id)target + selector:(nullable SEL)selector; + +///-------------------------------------- +/// @name Unlinking Users from Facebook +///-------------------------------------- + +/*! + @abstract Unlinks the from a Facebook account *synchronously*. + + @param user User to unlink from Facebook. + + @returns Returns `YES` if the unlink was successful, otherwise `NO`. + */ ++ (BOOL)unlinkUser:(PFUser *)user; + +/*! + @abstract Unlinks the from a Facebook account *synchronously*. + + @param user User to unlink from Facebook. + @param error Error object to set on error. + + @returns Returns `YES` if the unlink was successful, otherwise `NO`. + */ ++ (BOOL)unlinkUser:(PFUser *)user error:(NSError **)error; + +/*! + @abstract Unlinks the from a Facebook account *asynchronously*. + + @param user User to unlink from Facebook. + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)unlinkUserInBackground:(PFUser *)user; + +/*! + @abstract Unlinks the from a Facebook account *asynchronously*. + + @param user User to unlink from Facebook. + @param block The block to execute. + It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. + */ ++ (void)unlinkUserInBackground:(PFUser *)user block:(nullable PFBooleanResultBlock)block; + +/* + @abstract Unlinks the from a Facebook account *asynchronously*. + + @param user User to unlink from Facebook + @param target Target object for the selector + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`. + */ ++ (void)unlinkUserInBackground:(PFUser *)user target:(nullable id)target selector:(nullable SEL)selector; + +///-------------------------------------- +/// @name Obtaining New Permissions +///-------------------------------------- + +/*! + @abstract Requests new Facebook publish permissions for the given user *asynchronously*. + + @discussion The user will be saved as part of this operation. + + @warning This may prompt the user to reauthorize the application. + + @param user User to request new permissions for. The user must be linked to Facebook. + @param permissions The new publishing permissions to request. + @param audience The default audience for publishing permissions to request. + + @returns The task, that encapsulates the work being done. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)reauthorizeUserInBackground:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience; + +/*! + @abstract Requests new Facebook publish permissions for the given user *asynchronously*. + + @discussion The user will be saved as part of this operation. + + @warning This may prompt the user to reauthorize the application. + + @param user User to request new permissions for. The user must be linked to Facebook. + @param permissions The new publishing permissions to request. + @param audience The default audience for publishing permissions to request. + @param block The block to execute. + It should have the following argument signature: `^(BOOL succeeded, NSError *error)`. + */ ++ (void)reauthorizeUser:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience + block:(nullable PFBooleanResultBlock)block; + +/* + @abstract Requests new Facebook publish permissions for the given user *asynchronously*. + + @discussion The user will be saved as part of this operation. + + @warning This may prompt the user to reauthorize the application. + + @param user User to request new permissions for. The user must be linked to Facebook. + @param permissions The new publishing permissions to request. + @param audience The default audience for publishing permissions to request. + @param target Target object for the selector. + @param selector The selector that will be called when the asynchronous request is complete. + It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`. + */ ++ (void)reauthorizeUser:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience + target:(nullable id)target + selector:(nullable SEL)selector; + +///-------------------------------------- +/// @name Delegating URL Actions +///-------------------------------------- + +/*! + @abstract Handles URLs being opened by your AppDelegate. Invoke and return this from application:handleOpenURL: + or application:openURL:sourceApplication:annotation in your AppDelegate. + + @param url URL being opened by your application. + @returns `YES` if Facebook will handle this URL, otherwise `NO`. + + @deprecated Please use + `[FBAppCall handleOpenURL:url + sourceApplication:sourceApplication + withSession:[PFFacebookUtils session]];` instead. + */ ++ (BOOL)handleOpenURL:(nullable NSURL *)url PARSE_DEPRECATED("Use [FBAppCall handleOpenURL:sourceApplication:withSession:] instead."); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ParseFacebookUtils/PFFacebookUtils.m b/ParseFacebookUtils/PFFacebookUtils.m new file mode 100644 index 0000000..eae766f --- /dev/null +++ b/ParseFacebookUtils/PFFacebookUtils.m @@ -0,0 +1,316 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookUtils.h" + +#import + +#import "PFFacebookAuthenticationProvider.h" +#import "PFFacebookPrivateUtilities.h" + +@implementation PFFacebookUtils + +static PFFacebookAuthenticationProvider *provider; + +///-------------------------------------- +#pragma mark - Authentication Provider +///-------------------------------------- + ++ (void)checkInitialization { + if (!provider) { + [NSException raise:NSInternalInconsistencyException + format:@"You must call PFFacebookUtils initializeFacebook to use PFFacebookUtils."]; + } +} + ++ (PFFacebookAuthenticationProvider *)_authenticationProvider { + return provider; +} + ++ (void)_setAuthenticationProvider:(PFFacebookAuthenticationProvider *)authProvider { + provider = authProvider; +} + +///-------------------------------------- +#pragma mark - Initialize +///-------------------------------------- + ++ (void)initializeWithApplicationId:(nullable NSString *)appId { + [NSException raise:NSInternalInconsistencyException + format:@"You must initialize PFFacebookUtils with a call to +initializeFacebook."]; +} + ++ (void)initializeWithApplicationId:(nullable NSString *)appId + urlSchemeSuffix:(nullable NSString *)urlSchemeSuffix { + [NSException raise:NSInternalInconsistencyException + format:@"You must initialize PFFacebookUtils with a call to +initializeFacebookWithUrlSchemeSuffix."]; +} + ++ (void)initializeFacebook { + [self initializeFacebookWithUrlShemeSuffix:nil]; +} + ++ (void)initializeFacebookWithUrlShemeSuffix:(nullable NSString *)urlSchemeSuffix { + if (!provider) { + provider = [[PFFacebookAuthenticationProvider alloc] init]; + provider.urlSchemeSuffix = urlSchemeSuffix; + + [PFUser registerAuthenticationDelegate:provider forAuthType:PFFacebookUserAuthenticationType]; + } + + if (!provider.session) { + [provider initializeSession]; + } +} + ++ (FBSession *)session { + return provider.session; +} + +///-------------------------------------- +#pragma mark - Customizing Login Behavior +///-------------------------------------- + ++ (void)setFacebookLoginBehavior:(FBSessionLoginBehavior)behavior { + [self checkInitialization]; + provider.loginBehavior = behavior; +} + ++ (FBSessionLoginBehavior)facebookLoginBehavior { + [self checkInitialization]; + return provider.loginBehavior; +} + +///-------------------------------------- +#pragma mark - Log In +///-------------------------------------- + ++ (BFTask PF_GENERIC(PFUser *)*)logInWithPermissionsInBackground:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + [self checkInitialization]; + provider.permissions = permissions; + + return [[[self _authenticationProvider] authenticateAsync] continueWithSuccessBlock:^id(BFTask *task) { + return [PFUser logInWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:task.result]; + }]; +} + ++ (void)logInWithPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block { + [[self logInWithPermissionsInBackground:permissions] pffb_continueWithMainThreadUserBlock:block]; +} + ++ (void)logInWithPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + target:(nullable id)target + selector:(nullable SEL)selector { + [self logInWithPermissions:permissions block:^(PFUser *user, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector onTarget:target withObject:user object:error]; + }]; +} + ++ (BFTask PF_GENERIC(PFUser *)*)logInWithFacebookIdInBackground:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate { + [self checkInitialization]; + + NSDictionary *authData = [provider authDataWithFacebookId:facebookId + accessToken:accessToken + expiration:expirationDate]; + + return [PFUser logInWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:authData]; +} + ++ (void)logInWithFacebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + block:(nullable PFUserResultBlock)block { + [[self logInWithFacebookIdInBackground:facebookId + accessToken:accessToken + expirationDate:expirationDate] pffb_continueWithMainThreadUserBlock:block]; +} + ++ (void)logInWithFacebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + target:(nullable id)target + selector:(nullable SEL)selector { + [self logInWithFacebookId:facebookId + accessToken:accessToken + expirationDate:expirationDate + block:^(PFUser *user, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector + onTarget:target + withObject:user + object:error]; + }]; +} + +///-------------------------------------- +#pragma mark - Link +///-------------------------------------- + ++ (void)linkUser:(PFUser *)user permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + // This is misnamed `*InBackground` method. Left as is for backward compatability. + [self linkUserInBackground:user permissions:permissions]; +} + ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + [self checkInitialization]; + provider.permissions = permissions; + + return [[[self _authenticationProvider] authenticateAsync] continueWithSuccessBlock:^id(BFTask *task) { + return [user linkWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:task.result]; + }]; +} + ++ (void)linkUser:(PFUser *)user + permissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block { + [[self linkUserInBackground:user permissions:permissions] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (void)linkUser:(PFUser *)user + permissions:(nullable NSArray *)permissions + target:(nullable id)target + selector:(nullable SEL)selector { + [self linkUser:user permissions:permissions block:^(BOOL succeeded, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector onTarget:target withObject:@(succeeded) object:error]; + }]; +} + ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate { + [self checkInitialization]; + + NSDictionary *authData = [provider authDataWithFacebookId:facebookId + accessToken:accessToken + expiration:expirationDate]; + return [user linkWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:authData]; +} + ++ (void)linkUser:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + block:(nullable PFBooleanResultBlock)block { + [[self linkUserInBackground:user + facebookId:facebookId + accessToken:accessToken + expirationDate:expirationDate] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (void)linkUser:(PFUser *)user + facebookId:(NSString *)facebookId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate + target:(nullable id)target + selector:(nullable SEL)selector { + [self linkUser:user + facebookId:facebookId + accessToken:accessToken + expirationDate:expirationDate + block:^(BOOL succeeded, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector + onTarget:target + withObject:@(succeeded) + object:error]; + }]; +} + +///-------------------------------------- +#pragma mark - Unlink +///-------------------------------------- + ++ (BOOL)unlinkUser:(PFUser *)user { + return [self unlinkUser:user error:nil]; +} + ++ (BOOL)unlinkUser:(PFUser *)user error:(NSError **)error { + return [[[self unlinkUserInBackground:user] pffb_waitForResult:error] boolValue]; +} + ++ (BFTask PF_GENERIC(NSNumber *)*)unlinkUserInBackground:(PFUser *)user { + [self checkInitialization]; + return [user unlinkWithAuthTypeInBackground:PFFacebookUserAuthenticationType]; +} + ++ (void)unlinkUserInBackground:(PFUser *)user block:(nullable PFBooleanResultBlock)block { + [[self unlinkUserInBackground:user] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (void)unlinkUserInBackground:(PFUser *)user target:(nullable id)target selector:(nullable SEL)selector { + [self unlinkUserInBackground:user block:^(BOOL succeeded, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector onTarget:target withObject:@(succeeded) object:error]; + }]; +} + +///-------------------------------------- +#pragma mark - Reauthorize +///-------------------------------------- + ++ (BFTask PF_GENERIC(NSNumber *)*)reauthorizeUserInBackground:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience { + [self checkInitialization]; + if (![self isLinkedWithUser:user]) { + [NSException raise:NSInternalInconsistencyException + format:@"The user must already be linked with Facebook in order to reauthorize."]; + } + provider.permissions = permissions; + provider.audience = audience; + + return [[provider reauthorizeInBackground] continueWithSuccessBlock:^id(BFTask *task) { + return [user linkWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:task.result]; + }]; +} + ++ (void)reauthorizeUser:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience + block:(nullable PFBooleanResultBlock)block { + [[self reauthorizeUserInBackground:user + withPublishPermissions:permissions + audience:audience] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (void)reauthorizeUser:(PFUser *)user + withPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + audience:(FBSessionDefaultAudience)audience + target:(nullable id)target + selector:(nullable SEL)selector { + [self reauthorizeUser:user + withPublishPermissions:permissions + audience:audience + block:^(BOOL succeeded, NSError *error) { + [PFFacebookPrivateUtilities safePerformSelector:selector + onTarget:target + withObject:@(succeeded) + object:error]; + }]; +} + +///-------------------------------------- +#pragma mark - Getting Linked State +///-------------------------------------- + ++ (BOOL)isLinkedWithUser:(PFUser *)user { + return [user isLinkedWithAuthType:PFFacebookUserAuthenticationType]; +} + +///-------------------------------------- +#pragma mark - Deprecated +///-------------------------------------- + ++ (BOOL)handleOpenURL:(nullable NSURL *)url { + return [provider handleOpenURL:url]; +} + +@end diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..5055e9c --- /dev/null +++ b/Podfile @@ -0,0 +1,8 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' + +workspace 'ParseFacebookUtils' + +target 'ParseFacebookUtilsV3-UnitTests', :exclusive => true do + pod 'OCMock' +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..129ba49 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,10 @@ +PODS: + - OCMock (3.2) + +DEPENDENCIES: + - OCMock + +SPEC CHECKSUMS: + OCMock: 28def049ef47f996b515a8eeea958be7ccab2dbb + +COCOAPODS: 0.39.0.rc.1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..45673aa --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ +# Parse Facebook Utils for iOS + +[![Build Status][build-status-svg]][build-status-link] +[![Coverage Status][coverage-status-svg]][coverage-status-link] +[![Podspec][podspec-svg]][podspec-link] +[![License][license-svg]][license-link] +![Platforms][platforms-svg] + +A utility library to authenticate Parse `PFUser`s with Facebook SDK. For more information see our [guide][guide]. + +## Getting Started + +To use Parse Facebook Utils, head on over to the [releases][releases] page, and download the latest build. +And you're off! Take a look at the public [documentation][docs] and start building. + +**Other Installation Options** + + 1. **CocoaPods** + + Add the following line to your podfile: + + pod 'ParseFacebookUtils' + + Run pod install, and you should now have the latest parse release. + + 2. **Using ParseFacebookUtils as a sub-project** + + You can also include parse as a subproject inside of your application if you'd prefer, although we do not recommend this, as it will increase your indexing time significantly. To do so, just drag and drop the `ParseFacebookUtils.xcodeproj` file into your workspace. + +## How Do I Contribute? + +We want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines][contributing]. + +## Other Parse Projects + + - [Parse for iOS/OS X][parse-iosx-link] + - [ParseUI for iOS][parseui-ios-link] + - [ParseTwitterUtils for iOS][parsetwitterutils-ios-link] + - [Parse SDK for Android][android-sdk-link] + +## Dependencies + +We use the following libraries as dependencies inside of ParseFacebookUtils: + + - [Parse SDK][parse-iosx-link] + - [Facebook SDK][facebook-sdk] + - [Bolts][bolts-framework], for task management. + - [OCMock][ocmock-framework], for unit testing. + +## License + +``` +Copyright (c) 2015-present, Parse, LLC. +All rights reserved. + +This source code is licensed under the BSD-style license found in the +LICENSE file in the root directory of this source tree. An additional grant +of patent rights can be found in the PATENTS file in the same directory. +``` + + [parse.com]: https://www.parse.com/products/ios + [docs]: https://www.parse.com/docs/ios/guide + [guide]: https://parse.com/docs/ios/guide#users-facebook-users + [blog]: https://blog.parse.com/ + + [parse-iosx-link]: https://github.com/ParsePlatform/Parse-SDK-iOS-OSX + [parseui-ios-link]: https://github.com/ParsePlatform/ParseUI-iOS + [parsetwitterutils-ios-link]: https://github.com/ParsePlatform/ParseTwitterUtils-iOS + [android-sdk-link]: https://github.com/ParsePlatform/Parse-SDK-Android + + [releases]: https://github.com/ParsePlatform/ParseFacebookUtils-iOS/releases + [contributing]: https://github.com/ParsePlatform/ParseFacebookUtils-iOS/blob/master-v3/CONTRIBUTING.md + + [facebook-sdk]: https://developers.facebook.com/docs/ios + [bolts-framework]: https://github.com/BoltsFramework/Bolts-iOS + [ocmock-framework]: http://ocmock.org + + [build-status-svg]: https://img.shields.io/travis/ParsePlatform/ParseFacebookUtils-iOS/master-v3.svg + [build-status-link]: https://travis-ci.org/ParsePlatform/ParseFacebookUtils-iOS/branches + + [coverage-status-svg]: https://codecov.io/github/ParsePlatform/ParseFacebookUtils-iOS/coverage.svg?branch=master-v3 + [coverage-status-link]: https://codecov.io/github/ParsePlatform/ParseFacebookUtils-iOS?branch=master-v3 + + [license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg + [license-link]: https://github.com/ParsePlatform/ParseFacebookUtils-iOS/blob/master-v3/LICENSE + + [podspec-svg]: https://img.shields.io/cocoapods/v/ParseFacebookUtils.svg + [podspec-link]: https://cocoapods.org/pods/ParseFacebookUtils + + [platforms-svg]: https://img.shields.io/badge/platform-ios-lightgrey.svg diff --git a/Resources/Info.plist b/Resources/Info.plist new file mode 100644 index 0000000..f210228 --- /dev/null +++ b/Resources/Info.plist @@ -0,0 +1,29 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ParseFacebookUtils + CFBundleIdentifier + com.parse.ParseFacebookUtils + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.9.0 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneSimulator + iPhoneOS + + CFBundleVersion + 1.9.0 + MinimumOSVersion + 6.0 + + diff --git a/Resources/Localizable.strings b/Resources/Localizable.strings new file mode 100644 index 0000000..ed60b89 Binary files /dev/null and b/Resources/Localizable.strings differ diff --git a/Tests/Other/TestCase/PFFacebookTestCase.h b/Tests/Other/TestCase/PFFacebookTestCase.h new file mode 100644 index 0000000..cea5935 --- /dev/null +++ b/Tests/Other/TestCase/PFFacebookTestCase.h @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@import XCTest; + +@interface PFFacebookTestCase : XCTestCase + +///-------------------------------------- +/// @name XCTestCase +///-------------------------------------- + +- (void)setUp NS_REQUIRES_SUPER; +- (void)tearDown NS_REQUIRES_SUPER; + +///-------------------------------------- +/// @name Expectations +///-------------------------------------- + +- (XCTestExpectation *)currentSelectorTestExpectation; +- (void)waitForTestExpectations; + +///-------------------------------------- +/// @name Mocks +///-------------------------------------- + +- (void)registerMockObject:(id)mockObject; + +@end + +#define _PFRegisterMock(mockObject) [self registerMockObject:mockObject] +#define _PFMockShim(method, args...) ({ id mock = method(args); _PFRegisterMock(mock); mock; }) +#define _PFOCMockWarning _Pragma("GCC warning \"Please use PF mocking methods instead of OCMock ones.\"") + +#define _PFStrictClassMock(kls) [OCMockObject mockForClass:kls] +#define _PFClassMock(kls) [OCMockObject niceMockForClass:kls] +#define _PFStrictProtocolMock(proto) [OCMockObject mockForProtocol:proto] +#define _PFProtocolMock(proto) [OCMockObject niceMockForProtocol:proto] +#define _PFPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define PFStrictClassMock(...) _PFMockShim(_PFStrictClassMock, __VA_ARGS__) +#define PFClassMock(...) _PFMockShim(_PFClassMock, __VA_ARGS__) +#define PFStrictProtocolMock(...) _PFMockShim(_PFStrictProtocolMock, __VA_ARGS__) +#define PFProtocolMock(...) _PFMockShim(_PFProtocolMock, __VA_ARGS__) +#define PFPartialMock(...) _PFMockShim(_PFPartialMock, __VA_ARGS__) + +#undef OCMStrictClassMock +#undef OCMClassMock +#undef OCMStrictProtocolMock +#undef OCMProtocolMock +#undef OCMPartialMock + +#define OCMStrictClassMock _PFOCMockWarning _PFStrictClassMock +#define OCMClassMock _PFOCMockWarning _PFClassMock +#define OCMStrictProtocolMock _PFOCMockWarning _PFStrictProtocolMock +#define OCMProtocolMock _PFOCMockWarning _PFProtocolMock +#define OCMPartialMock _PFOCMockWarning _PFPartialMock + +#define PFAssertIsKindOfClass(a1, a2, description...) \ +XCTAssertTrue([a1 isKindOfClass:[a2 class]], ## description) + +#define PFAssertNotKindOfClass(a1, a2, description...) \ +XCTAssertFalse([a1 isKindOfClass:[a2 class]], ## description) + +#define PFAssertThrowsInconsistencyException(expression, ...) \ +XCTAssertThrowsSpecificNamed(expression, NSException, NSInternalInconsistencyException, __VA_ARGS__) + +#define PFAssertThrowsInvalidArgumentException(expression, ...) \ +XCTAssertThrowsSpecificNamed(expression, NSException, NSInvalidArgumentException, __VA_ARGS__) + +#define PFAssertStringContains(a, b) XCTAssertTrue([(a) rangeOfString:(b)].location != NSNotFound) + +/*! + To prevent retain cycles by OCMock, this macro allows us to capture a weak reference to return from a stubbed method. + */ +#define andReturnWeak(variable) _andDo( \ + ({ \ + __weak typeof(variable) variable ## _weak = (variable); \ + ^(NSInvocation *invocation) { \ + __autoreleasing typeof(variable) variable ## _block = variable ## _weak; \ + [invocation setReturnValue:&(variable ## _block)]; \ + }; \ + }) \ +) diff --git a/Tests/Other/TestCase/PFFacebookTestCase.m b/Tests/Other/TestCase/PFFacebookTestCase.m new file mode 100644 index 0000000..a5414a1 --- /dev/null +++ b/Tests/Other/TestCase/PFFacebookTestCase.m @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "PFFacebookTestCase.h" + +@implementation PFFacebookTestCase { + NSMutableArray *_mocks; + dispatch_queue_t _mockQueue; +} + +///-------------------------------------- +#pragma mark - XCTestCase +///-------------------------------------- + +- (void)setUp { + [super setUp]; + + _mocks = [[NSMutableArray alloc] init]; + _mockQueue = dispatch_queue_create("com.parse.tests.mock.queue", DISPATCH_QUEUE_SERIAL); +} + +- (void)tearDown { + dispatch_sync(_mockQueue, ^{ + [_mocks makeObjectsPerformSelector:@selector(stopMocking)]; + }); + + _mocks = nil; + _mockQueue = nil; + + [super tearDown]; +} + +///-------------------------------------- +#pragma mark - Helpers +///-------------------------------------- + +- (XCTestExpectation *)currentSelectorTestExpectation { + NSInvocation *invocation = self.invocation; + NSString *selectorName = invocation ? NSStringFromSelector(invocation.selector) : @"testExpectation"; + return [self expectationWithDescription:selectorName]; +} + +- (void)waitForTestExpectations { + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +///-------------------------------------- +#pragma mark - Mock Registration +///-------------------------------------- + +- (void)registerMockObject:(id)mockObject { + dispatch_sync(_mockQueue, ^{ + [_mocks addObject:mockObject]; + }); +} + +@end diff --git a/Tests/Resources/Info.plist b/Tests/Resources/Info.plist new file mode 100644 index 0000000..53d9932 --- /dev/null +++ b/Tests/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.parse.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Tests/TestApplication/Classes/main.m b/Tests/TestApplication/Classes/main.m new file mode 100644 index 0000000..453fc12 --- /dev/null +++ b/Tests/TestApplication/Classes/main.m @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@interface AppDelegate : NSObject + +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; + window.rootViewController = [[UIViewController alloc] init]; + [window makeKeyAndVisible]; + return YES; +} + +@end + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Tests/TestApplication/Resources/Info.plist b/Tests/TestApplication/Resources/Info.plist new file mode 100644 index 0000000..0fd90b8 --- /dev/null +++ b/Tests/TestApplication/Resources/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIcons + + CFBundleIcons~ipad + + CFBundleIdentifier + com.parse.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Tests/Unit/FacebookAuthenticationProviderTests.m b/Tests/Unit/FacebookAuthenticationProviderTests.m new file mode 100644 index 0000000..208cbc0 --- /dev/null +++ b/Tests/Unit/FacebookAuthenticationProviderTests.m @@ -0,0 +1,367 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import +#import + +#import + +#import "PFFacebookAuthenticationProvider_Private.h" +#import "PFFacebookTestCase.h" +#import "PFFacebookTokenCachingStrategy.h" + +@interface FBSession () + +/*! + Internal only method on FBSession that clears the thread affinity information. + We need this to be able to use FBSession from multiple threads. + */ +- (void)clearAffinitizedThread; + + +@end + +@interface FacebookAuthenticationProviderTests : PFFacebookTestCase + +@end + +@implementation FacebookAuthenticationProviderTests + +///-------------------------------------- +#pragma mark - Helpers +///-------------------------------------- + +- (id)mockedSessionProvider { + return PFStrictProtocolMock(@protocol(PFFacebookSessionProvider)); +} + +///-------------------------------------- +#pragma mark - Tests +///-------------------------------------- + +- (void)testProperties { + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + provider.appId = @"appId"; + provider.permissions = @[ @1, @2 ]; + provider.urlSchemeSuffix = @"suffix"; + provider.audience = FBSessionDefaultAudienceEveryone; + provider.loginBehavior = FBSessionLoginBehaviorForcingSafari; + + XCTAssertEqualObjects(provider.appId, @"appId"); + XCTAssertEqualObjects(provider.permissions, (@[ @1, @2 ])); + XCTAssertEqualObjects(provider.urlSchemeSuffix, @"suffix"); + XCTAssertEqual(provider.audience, FBSessionDefaultAudienceEveryone); + XCTAssertEqual(provider.loginBehavior, FBSessionLoginBehaviorForcingSafari); +} + +- (void)testAuthType { + XCTAssertEqualObjects(PFFacebookUserAuthenticationType, @"facebook"); +} + +- (void)testAuthData { + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + + XCTAssertEqualObjects([provider authDataWithFacebookId:@"fbId" + accessToken:@"token" + expiration:[NSDate dateWithTimeIntervalSince1970:1337]], (@{ + @"id": @"fbId", + @"access_token": @"token", + @"expiration_date": @"1970-01-01T00:22:17.000Z" + })); +} + +- (void)testAuthenticateSuccess { + NSDictionary *expectedAuthData = @{ + @"id": @"fbId", + @"access_token": @"token", + @"expiration_date": @"1970-01-01T00:22:17.000Z" + }; + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + + id mockedSession = PFStrictClassMock([FBSession class]); + id mockedTokenData = PFStrictClassMock([FBAccessTokenData class]); + id mockedRequest = PFStrictClassMock([FBRequest class]); + id mockedSessionProvider = [self mockedSessionProvider]; + + OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession); + OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0 + completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSession *theSession = nil; + __unsafe_unretained FBSessionStateHandler handler = nil; + + [invocation getArgument:&theSession atIndex:0]; + [invocation getArgument:&handler atIndex:3]; + + [provider.tokenCache setAccessToken:@"token"]; + [provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + + handler(theSession, FBSessionStateOpen, nil); + }); + + OCMStub([mockedSession isOpen]).andReturn(YES); + OCMStub([mockedSession appID]).andReturn(@"appId"); + OCMStub([mockedSession accessTokenData]).andReturn(mockedTokenData); + OCMStub([mockedSession close]); + + OCMStub([mockedTokenData accessToken]).andReturn(@"token"); + OCMStub([mockedTokenData loginType]).andReturn(FBSessionLoginTypeFacebookApplication); + OCMStub([mockedTokenData userID]).andReturn(@"fbId"); + + OCMStub(ClassMethod([mockedRequest requestWithGraphPath:@"me" + parameters:@{ @"fields": @"id" } + HTTPMethod:@"GET"])).andReturnWeak(mockedRequest); + + OCMStub([mockedRequest setSession:mockedSession]); + OCMStub([mockedRequest startWithCompletionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBRequestHandler handler = nil; + [invocation getArgument:&handler atIndex:2]; + + handler(nil, @{ @"id": @"fbId" }, nil); + }); + + OCMStub([mockedSessionProvider sessionWithAppID:@"appId" + permissions:@[ @"permission" ] + urlSchemeSuffix:nil + tokenCacheStrategy:OCMOCK_ANY]).andReturn(mockedSession); + + provider.sessionProvider = mockedSessionProvider; + provider.appId = @"appId"; + provider.permissions = @[ @"permission" ]; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsync] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + [expectation fulfill]; + return nil; + }]; + + [self waitForTestExpectations]; +} + +- (void)testAuthenticateIncompleteCachedSession { + NSDictionary *expectedAuthData = @{ + @"id": @"fbId", + @"access_token": @"token", + @"expiration_date": @"1970-01-01T00:22:17.000Z" + }; + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + + id mockedSession = PFStrictClassMock([FBSession class]); + id mockedTokenData = PFStrictClassMock([FBAccessTokenData class]); + id mockedRequest = PFStrictClassMock([FBRequest class]); + id mockedSessionProvider = [self mockedSessionProvider]; + + OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession); + OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0 + completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSession *theSession = nil; + __unsafe_unretained FBSessionStateHandler handler = nil; + + [invocation getArgument:&theSession atIndex:0]; + [invocation getArgument:&handler atIndex:3]; + + [provider.tokenCache setAccessToken:@"token"]; + [provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + + handler(theSession, FBSessionStateOpen, nil); + }); + + OCMStub([mockedSession isOpen]).andReturn(YES); + OCMStub([mockedSession appID]).andReturn(@"appId"); + OCMStub([mockedSession accessTokenData]).andReturn(mockedTokenData); + OCMStub([mockedSession close]); + + OCMStub([mockedTokenData accessToken]).andReturn(@"token"); + OCMStub([mockedTokenData loginType]).andReturn(FBSessionLoginTypeFacebookApplication); + OCMStub([mockedTokenData userID]).andReturn(nil); + + OCMStub(ClassMethod([mockedRequest requestWithGraphPath:@"me" + parameters:@{ @"fields": @"id" } + HTTPMethod:@"GET"])).andReturnWeak(mockedRequest); + + OCMStub([mockedRequest setSession:mockedSession]); + OCMStub([mockedRequest startWithCompletionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBRequestHandler handler = nil; + [invocation getArgument:&handler atIndex:2]; + + handler(nil, @{ @"id": @"fbId" }, nil); + }); + + OCMStub([mockedSessionProvider sessionWithAppID:@"appId" + permissions:@[ @"permission" ] + urlSchemeSuffix:nil + tokenCacheStrategy:OCMOCK_ANY]).andReturn(mockedSession); + + OCMStub([mockedSessionProvider sessionWithAppID:@"appId" + permissions:nil + urlSchemeSuffix:nil + tokenCacheStrategy:OCMOCK_ANY]).andReturn(mockedSession); + + OCMStub([mockedSession clearAffinitizedThread]); + + provider.sessionProvider = mockedSessionProvider; + provider.appId = @"appId"; + provider.permissions = @[ @"permission" ]; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsync] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + [expectation fulfill]; + return nil; + }]; + + [self waitForTestExpectations]; +} + +- (void)testTokenExtension { + NSDictionary *expectedAuthData = @{ + @"id": @"fbId", + @"access_token": @"token", + @"expiration_date": @"1970-01-01T00:22:17.000Z" + }; + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + + id mockedSession = PFStrictClassMock([FBSession class]); + id mockedTokenData = PFStrictClassMock([FBAccessTokenData class]); + id mockedRequest = PFStrictClassMock([FBRequest class]); + id mockedSessionProvider = [self mockedSessionProvider]; + + OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession); + OCMStub([[mockedSession ignoringNonObjectArgs] openWithBehavior:0 + completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSession *theSession = nil; + __unsafe_unretained FBSessionStateHandler handler = nil; + + [invocation getArgument:&theSession atIndex:0]; + [invocation getArgument:&handler atIndex:3]; + + [provider.tokenCache setAccessToken:@"token"]; + [provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + + handler(theSession, FBSessionStateOpen, nil); + handler(theSession, FBSessionStateOpenTokenExtended, nil); + }); + + OCMStub([mockedSession isOpen]).andReturn(YES); + OCMStub([mockedSession appID]).andReturn(@"appId"); + OCMStub([mockedSession accessTokenData]).andReturn(mockedTokenData); + OCMStub([mockedSession close]); + + OCMStub([mockedTokenData accessToken]).andReturn(@"token"); + OCMStub([mockedTokenData loginType]).andReturn(FBSessionLoginTypeFacebookApplication); + OCMStub([mockedTokenData userID]).andReturn(@"fbId"); + + OCMStub(ClassMethod([mockedRequest requestWithGraphPath:@"me" + parameters:@{ @"fields": @"id" } + HTTPMethod:@"GET"])).andReturnWeak(mockedRequest); + + OCMStub([mockedRequest setSession:mockedSession]); + OCMStub([mockedRequest startWithCompletionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBRequestHandler handler = nil; + [invocation getArgument:&handler atIndex:2]; + + handler(nil, @{ @"id": @"fbId" }, nil); + }); + + OCMStub([mockedSessionProvider sessionWithAppID:@"appId" + permissions:@[ @"permission" ] + urlSchemeSuffix:nil + tokenCacheStrategy:OCMOCK_ANY]).andReturn(mockedSession); + + provider.sessionProvider = mockedSessionProvider; + provider.appId = @"appId"; + provider.permissions = @[ @"permission" ]; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + provider.tokenExtensionCallback = ^(NSDictionary *authData) { + XCTAssertEqualObjects(expectedAuthData, authData); + [expectation fulfill]; + }; + [[provider authenticateAsync] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + return nil; + }]; + + [self waitForTestExpectations]; +} + +- (void)testReauthorize { + NSDictionary *expectedAuthData = @{ + @"id": @"fbId", + @"access_token": @"token", + @"expiration_date": @"1970-01-01T00:22:17.000Z" + }; + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + + id mockedSession = PFStrictClassMock([FBSession class]); + id mockedSessionProvider = [self mockedSessionProvider]; + + OCMStub([mockedSession valueForKey:@"self"]).andReturnWeak(mockedSession); + OCMStub([[mockedSession ignoringNonObjectArgs] requestNewPublishPermissions:OCMOCK_ANY + defaultAudience:0 + completionHandler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSession *theSession = nil; + __unsafe_unretained FBSessionRequestPermissionResultHandler handler = nil; + + [invocation getArgument:&theSession atIndex:0]; + [invocation getArgument:&handler atIndex:4]; + + [provider.tokenCache setAccessToken:@"token"]; + [provider.tokenCache setExpirationDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + + handler(theSession, nil); + }); + + OCMStub([mockedSession isOpen]).andReturn(YES); + OCMStub([mockedSession appID]).andReturn(@"appId"); + OCMStub([mockedSession close]); + + OCMStub([mockedSessionProvider sessionWithAppID:@"appId" + permissions:@[ @"permission" ] + urlSchemeSuffix:nil + tokenCacheStrategy:OCMOCK_ANY]).andReturn(mockedSession); + + provider.sessionProvider = mockedSessionProvider; + provider.appId = @"appId"; + provider.permissions = @[ @"permission" ]; + [provider initializeSession]; + + provider.tokenCache.facebookId = @"fbId"; + provider.tokenCache.accessToken = @"token"; + provider.tokenCache.expirationDate = [NSDate dateWithTimeIntervalSince1970:1337]; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider reauthorizeInBackground] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + [expectation fulfill]; + return nil; + }]; + + [self waitForTestExpectations]; +} + +- (void)testInitialize { + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] init]; + provider.appId = @"appId"; + provider.permissions = @[ @"permission" ]; + provider.urlSchemeSuffix = @"suffix"; + + [provider initializeSession]; + + XCTAssertEqualObjects(FBSession.activeSession.appID, @"appId"); + XCTAssertEqualObjects(FBSession.activeSession.permissions, @[ @"permission" ]); + XCTAssertEqualObjects(FBSession.activeSession.urlSchemeSuffix, @"suffix"); +} + +@end diff --git a/Tests/Unit/ReceptionistTests.m b/Tests/Unit/ReceptionistTests.m new file mode 100644 index 0000000..c5f92bf --- /dev/null +++ b/Tests/Unit/ReceptionistTests.m @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "PFFacebookTestCase.h" +#import "PFReceptionist.h" + +@interface TestObject : NSObject + +- (void)someMethod; +- (void)someMethodWithArg:(id)argument; +- (id)someMethodReturningValue; + +@end + +@implementation TestObject + +- (void)someMethod { +} + +- (void)someMethodWithArg:(id)argument { +} + +- (id)someMethodReturningValue { + return nil; +} + +@end + +@interface ReceptionistTests : PFFacebookTestCase + +@end + +@implementation ReceptionistTests + +- (void)testConstructors { + NSObject *theObject = [NSObject new]; + PFReceptionist *receptionist = [[PFReceptionist alloc] initWithFactory:^NSObject *{ + return theObject; + } thread:[NSThread currentThread]]; + XCTAssertNotNil(receptionist); + XCTAssertEqualObjects([(id)receptionist valueForKey:@"self"], theObject); + + receptionist = [[PFReceptionist alloc] initWithTarget:theObject thread:[NSThread currentThread]]; + XCTAssertEqualObjects([(id)receptionist valueForKey:@"self"], theObject); + + XCTAssertNil([[PFReceptionist alloc] initWithTarget:nil thread:nil]); + XCTAssertNil([[PFReceptionist alloc] initWithFactory:^NSObject *{ + return nil; + } thread:[NSThread currentThread]]); +} + +- (void)testForwardFromTargetThread { + id mockTarget = PFStrictClassMock([TestObject class]); + TestObject *receptionist = (TestObject *) [[PFReceptionist alloc] initWithTarget:mockTarget + thread:[NSThread currentThread]]; + + OCMExpect([mockTarget someMethod]); + OCMExpect([mockTarget someMethodWithArg:@"foo"]); + OCMExpect([mockTarget someMethodReturningValue]).andReturn(@"foo"); + + [receptionist someMethod]; + [receptionist someMethodWithArg:@"foo"]; + + XCTAssertEqualObjects([receptionist someMethodReturningValue], @"foo"); + + OCMVerifyAll(mockTarget); +} + +- (void)testForwardFromDifferentThread { + // Spawn a background thread which just runs a run-loop. + __block NSThread *backgroundThread = nil; + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [NSThread detachNewThreadSelector:@selector(invoke) toTarget:[^{ + backgroundThread = [NSThread currentThread]; + [expectation performSelector:@selector(fulfill) withObject:0 afterDelay:0]; + while (![backgroundThread isCancelled]) { + [[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantFuture]]; + } + } copy] withObject:nil]; + [self waitForTestExpectations]; + + id mockTarget = PFStrictClassMock([TestObject class]); + TestObject *receptionist = (TestObject *) [[PFReceptionist alloc] initWithFactory:^NSObject *{ + XCTAssertEqualObjects([NSThread currentThread], backgroundThread); + return mockTarget; + } thread:backgroundThread]; + + OCMExpect([mockTarget someMethod]).andDo(^(NSInvocation *invocation) { + XCTAssertEqualObjects([NSThread currentThread], backgroundThread); + }); + + OCMExpect([mockTarget someMethodWithArg:@"foo"]).andDo(^(NSInvocation *invocation) { + XCTAssertEqualObjects([NSThread currentThread], backgroundThread); + }); + + OCMExpect([mockTarget someMethodReturningValue]).andDo(^(NSInvocation *invocation) { + XCTAssertEqualObjects([NSThread currentThread], backgroundThread); + }).andReturn(@"foo"); + + [receptionist someMethod]; + [receptionist someMethodWithArg:@"foo"]; + + XCTAssertEqualObjects([receptionist someMethodReturningValue], @"foo"); + + OCMVerifyAll(mockTarget); + [backgroundThread cancel]; +} + +@end diff --git a/Tests/Unit/TokenCachingStrategyTests.m b/Tests/Unit/TokenCachingStrategyTests.m new file mode 100644 index 0000000..1378b16 --- /dev/null +++ b/Tests/Unit/TokenCachingStrategyTests.m @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2015-present, Parse, LLC. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +@import XCTest; + +#import "PFFacebookTokenCachingStrategy.h" + +@interface TokenCachingStrategyTests : XCTestCase + +@end + +@implementation TokenCachingStrategyTests + +- (void)testProperties { + NSDate *expectedDate = [NSDate dateWithTimeIntervalSince1970:1337]; + PFFacebookTokenCachingStrategy *strategy = [[PFFacebookTokenCachingStrategy alloc] init]; + strategy.accessToken = @"token"; + strategy.facebookId = @"fbid"; + strategy.expirationDate = expectedDate; + + XCTAssertEqualObjects(strategy.accessToken, @"token"); + XCTAssertEqualObjects(strategy.facebookId, @"fbid"); + XCTAssertEqualObjects(strategy.expirationDate, expectedDate); + + XCTAssertEqualObjects([strategy fetchTokenInformation][FBTokenInformationTokenKey], @"token"); + XCTAssertEqualObjects([strategy fetchTokenInformation][FBTokenInformationUserFBIDKey], @"fbid"); + XCTAssertEqualObjects([strategy fetchTokenInformation][FBTokenInformationExpirationDateKey], expectedDate); +} + +- (void)testSimpleCaching { + PFFacebookTokenCachingStrategy *strategy = [[PFFacebookTokenCachingStrategy alloc] init]; + NSDictionary *tokenInfo = @{ @"custom1": @"value1", FBTokenInformationTokenKey: @"token" }; + + [strategy cacheTokenInformation:tokenInfo]; + XCTAssertEqualObjects(tokenInfo, [strategy fetchTokenInformation]); + XCTAssertEqualObjects(@"token", strategy.accessToken); +} + +- (void)testFutureCaching { + PFFacebookTokenCachingStrategy *strategy = [[PFFacebookTokenCachingStrategy alloc] init]; + NSDictionary *tokenInfo = @{ + FBTokenInformationTokenKey: @"token", + FBTokenInformationExpirationDateKey: [NSDate distantFuture] + }; + + [strategy cacheTokenInformation:tokenInfo]; + XCTAssertEqualObjects(strategy.accessToken, @"token"); + + NSDate *actual = [strategy fetchTokenInformation][FBTokenInformationExpirationDateKey]; + + // Give an epsilon of 10 seconds, in case this test some how ends up running super slow. + NSTimeInterval twoYears = 63072000; + XCTAssertLessThan(fabs([actual timeIntervalSinceNow] - twoYears), 10); +} + +- (void)testClear { + PFFacebookTokenCachingStrategy *strategy = [[PFFacebookTokenCachingStrategy alloc] init]; + strategy.accessToken = @"token"; + [strategy clearToken]; + + XCTAssertNil(strategy.accessToken); + XCTAssertNil([strategy fetchTokenInformation]); + + NSDate *date = [NSDate dateWithTimeIntervalSince1970:1337]; + strategy.accessToken = @"token"; + strategy.expirationDate = date; + strategy.facebookId = @"fbId"; + + XCTAssertNotNil([strategy fetchTokenInformation]); + + strategy.accessToken = nil; + XCTAssertNil(strategy.accessToken); + XCTAssertNotNil([strategy fetchTokenInformation]); + XCTAssertNil([strategy fetchTokenInformation][FBTokenInformationTokenKey]); + + strategy.expirationDate = nil; + + XCTAssertNil(strategy.expirationDate); + XCTAssertNotNil([strategy fetchTokenInformation]); + XCTAssertNil([strategy fetchTokenInformation][FBTokenInformationExpirationDateKey]); + + strategy.facebookId = nil; + + XCTAssertNil(strategy.facebookId); + XCTAssertNotNil([strategy fetchTokenInformation]); + XCTAssertNil([strategy fetchTokenInformation][FBTokenInformationUserFBIDKey]); +} + +@end diff --git a/Vendor/FacebookSDK.framework/FacebookSDK b/Vendor/FacebookSDK.framework/FacebookSDK new file mode 120000 index 0000000..77d5d31 --- /dev/null +++ b/Vendor/FacebookSDK.framework/FacebookSDK @@ -0,0 +1 @@ +./Versions/A/FacebookSDK \ No newline at end of file diff --git a/Vendor/FacebookSDK.framework/Headers b/Vendor/FacebookSDK.framework/Headers new file mode 120000 index 0000000..b0cc393 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Headers @@ -0,0 +1 @@ +./Versions/A/Headers \ No newline at end of file diff --git a/Vendor/FacebookSDK.framework/Resources b/Vendor/FacebookSDK.framework/Resources new file mode 120000 index 0000000..3afb717 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Resources @@ -0,0 +1 @@ +./Versions/A/Resources \ No newline at end of file diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h new file mode 100644 index 0000000..2c6c98a --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAccessTokenData.h @@ -0,0 +1,203 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class FBAccessTokenData + + @abstract Represents an access token used for the Facebook login flow + and includes associated metadata such as expiration date and permissions. + You should use factory methods (createToken...) to construct instances + and should be treated as immutable. + + @discussion For more information, see + https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/. + */ +@interface FBAccessTokenData : NSObject + +/*! + @method + + @abstract Creates an FBAccessTokenData from an App Link provided by the Facebook application + or nil if the url is not valid. + + @param url The url provided. + @param appID needed in order to verify URL format. + @param urlSchemeSuffix needed in order to verify URL format. + + */ ++ (FBAccessTokenData *)createTokenFromFacebookURL:(NSURL *)url appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Creates an FBAccessTokenData from a dictionary or returns nil if required data is missing. + @param dictionary the dictionary with FBSessionTokenCachingStrategy keys. + */ ++ (FBAccessTokenData *)createTokenFromDictionary:(NSDictionary *)dictionary; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + @param appID The ID string of the calling app. A value of nil defaults to `[FBSettings defaultAppID]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate + appID:(NSString *)appID; + +/*! + @method + + @abstract Designated factory method. + Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param declinedPermissions The declined permissions set. A value of nil indicates empty array. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + @param appID The ID string of the calling app. A value of nil defaults to `[FBSettings defaultAppID]`. + @param userID The user ID associated with the token. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + declinedPermissions:(NSArray *)declinedPermissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate + appID:(NSString *)appID + userID:(NSString *)userID; + +/*! + @method + + @abstract Returns a dictionary representation of this instance. + + @discussion This is provided for backwards compatibility with previous + access token related APIs that used a NSDictionary (see `FBSessionTokenCachingStrategy`). + */ +- (NSMutableDictionary *)dictionary; + +/*! + @method + + @abstract Returns a Boolean value that indicates whether a given object is an FBAccessTokenData object and exactly equal the receiver. + + @param accessTokenData the data to compare to the receiver. + */ +- (BOOL)isEqualToAccessTokenData:(FBAccessTokenData *)accessTokenData; + +/*! + @abstract returns the access token NSString. + */ +@property (readonly, nonatomic, copy) NSString *accessToken; + +/*! + @abstract returns the app ID NSString. + */ +@property (readonly, nonatomic, copy) NSString *appID; + +/*! + @abstract returns the user ID NSString that is associated with the token,if available. + @discussion This may not be populated for login behaviours such as the iOS system account. + */ +@property (readonly, nonatomic, copy) NSString *userID; + +/*! + @abstract returns the permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *permissions; + +/*! + @abstract returns the declined permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *declinedPermissions; + +/*! + @abstract returns the expiration date of the access token. + */ +@property (readonly, nonatomic, copy) NSDate *expirationDate; + +/*! + @abstract returns the login type associated with the token. + */ +@property (readonly, nonatomic) FBSessionLoginType loginType; + +/*! + @abstract returns the date the token was last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *refreshDate; + +/*! + @abstract returns the date the permissions were last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *permissionsRefreshDate; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h new file mode 100644 index 0000000..4a74fb9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppCall.h @@ -0,0 +1,232 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAccessTokenData.h" +#import "FBAppLinkData.h" +#import "FBDialogsData.h" +#import "FBSession.h" + +@class FBAppCall; + +/*! + @typedef FBAppCallHandler + + @abstract + A block that is passed to performAppCall to register for a callback with the results + of that AppCall + + @discussion + Pass a block of this type when calling performAppCall. This will be called on the UI + thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + */ +typedef void (^FBAppCallHandler)(FBAppCall *call); + +/*! + @typedef FBAppLinkFallbackHandler + + @abstract + See `+openDeferredAppLink`. + */ +typedef void (^FBAppLinkFallbackHandler)(NSError *error); + +/*! + @class FBAppCall + + @abstract + The FBAppCall object is used to encapsulate state when the app performs an + action that requires switching over to the native Facebook app, or when the app + receives an App Link. + + @discussion + - Each FBAppCall instance will have a unique ID + - This object is passed into an FBAppCallHandler for context + - dialogData will be present if this AppCall is for a Native Dialog + - appLinkData will be present if this AppCall is for an App Link + - accessTokenData will be present if this AppCall contains an access token. + */ +@interface FBAppCall : NSObject + +/*! @abstract The ID of this FBAppCall instance */ +@property (nonatomic, readonly) NSString *ID; + +/*! @abstract Error that occurred in processing this AppCall */ +@property (nonatomic, readonly) NSError *error; + +/*! @abstract Data related to a Dialog AppCall */ +@property (nonatomic, readonly) FBDialogsData *dialogData; + +/*! @abstract Data for native app link */ +@property (nonatomic, readonly) FBAppLinkData *appLinkData; + +/*! @abstract Access Token that was returned in this AppCall */ +@property (nonatomic, readonly) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns an FBAppCall instance from a url, if applicable. Otherwise, returns nil. + + @param url The url. + + @return an FBAppCall instance if the url is valid; nil otherwise. + + @discussion This is typically used for App Link URLs. + */ ++ (FBAppCall *)appCallFromURL:(NSURL *)url; + +/*! + @abstract + Compares the receiving FBAppCall to the passed in FBAppCall + + @param appCall the other FBAppCall to compare to. + + @return YES if the AppCalls can be considered to be the same; NO if otherwise. + */ +- (BOOL)isEqualToAppCall:(FBAppCall *)appCall; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or pending login flow for the + FBSession.activeSession. If any pending FBAppCalls are found, their registered callbacks + will be invoked with appropriate state + */ ++ (void)handleDidBecomeActive; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or a pending open for the + passed in FBSession. If any pending FBAppCalls are found, their registered callbacks will + be invoked with appropriate state + + @param session Session that is currently being used. Any pending calls to open will be cancelled. + If no session is provided, then the activeSession (if present) is used. + */ ++ (void)handleDidBecomeActiveWithSession:(FBSession *)session; + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data. This may require + a network round trip. If successful, [+UIApplication openURL:] is invoked with the link + data. Otherwise, the fallbackHandler will be dispatched to the main thread. + + @param fallbackHandler the handler to be invoked if applink data could not be opened. + + @discussion the fallbackHandler may contain an NSError instance to capture any errors. In the + common case where there simply was no app link data, the NSError instance will be nil. + + This method should only be called from a location that occurs after any launching URL has + been processed (e.g., you should call this method from your application delegate's applicationDidBecomeActive:) + to avoid duplicate invocations of openURL:. + + If you must call this from the delegate's didFinishLaunchingWithOptions: you should + only do so if the application is not being launched by a URL. For example, + + if (launchOptions[UIApplicationLaunchOptionsURLKey] == nil) { + [FBAppCall openDeferredAppLink:^(NSError *error) { + // .... + } + } + */ ++ (void)openDeferredAppLink:(FBAppLinkFallbackHandler)fallbackHandler; +@end + + + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h new file mode 100644 index 0000000..90d67db --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppEvents.h @@ -0,0 +1,492 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + + @typedef NS_ENUM (NSUInteger, FBAppEventsFlushBehavior) + + @abstract Specifies when `FBAppEvents` sends log events to the server. + + */ +typedef NS_ENUM(NSUInteger, FBAppEventsFlushBehavior) { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto = 0, + + /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the + events are persisted and re-established at activation, but they will only be written with an + explicit call to `flush`. */ + FBAppEventsFlushBehaviorExplicitOnly, + +}; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +FBSDK_EXTERN NSString *const FBAppEventsLoggingResultNotification; + + +// Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBAppEvents`. +// Common event parameters are provided in the `FBAppEventsParameterNames*` constants. + +// General purpose + +/*! Deprecated: use [FBAppEvents activateApp] instead. */ +FBSDK_EXTERN NSString *const FBAppEventNameActivatedApp __attribute__ ((deprecated("use [FBAppEvents activateApp] instead"))); + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameSearched; + +/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ +FBSDK_EXTERN NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedTutorial; + +// Ecommerce related + +/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToCart; + +/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToWishlist; + +/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ +FBSDK_EXTERN NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedPaymentInfo; + +/*! Deprecated: use [FBAppEvents logPurchase:currency:] or [FBAppEvents logPurchase:currency:parameters:] instead */ +FBSDK_EXTERN NSString *const FBAppEventNamePurchased __attribute__ ((deprecated("use [FBAppEvents logPurchase:currency:] or [FBAppEvents logPurchase:currency:parameters:] instead"))); + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameUnlockedAchievement; + +/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ +FBSDK_EXTERN NSString *const FBAppEventNameSpentCredits; + + + +// Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + +/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is . */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentType; + +/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameLevel; + +/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameDescription; + + + +// Predefined values to assign to event parameters that accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event parameters are provided in the `FBAppEventParameterName*` constants. + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueNo; + + +/*! + + @class FBAppEvents + + @abstract + Client-side event logging for specialized application analytics available through Facebook App Insights + and for use with Facebook Ads conversion tracking and optimization. + + @discussion + The `FBAppEvents` static class has a few related roles: + + + Logging predefined and application-defined events to Facebook App Insights with a + numeric value to sum across a large number of events, and an optional set of key/value + parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or + 'gamerLevel' : 'intermediate') + + + Logging events to later be used for ads optimization around lifetime value. + + + Methods that control the way in which events are flushed out to the Facebook servers. + + Here are some important characteristics of the logging mechanism provided by `FBAppEvents`: + + + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers + in a number of situations: + - when an event count threshold is passed (currently 100 logged events). + - when a time threshold is passed (currently 15 seconds). + - when an app has gone to background and is then brought back to the foreground. + + + Events will be accumulated when the app is in a disconnected state, and sent when the connection is + restored and one of the above 'flush' conditions are met. + + + The `FBAppEvents` class in thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBAppEvents` to force the flushing of events to only + occur on an explicit call to the `flush` method. + + + The developer can turn on console debug output for event logging and flushing to the server by using + the `FBLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. + + Some things to note when logging events: + + + There is a limit on the number of unique event names an app can use, on the order of 300. + + There is a limit to the number of unique parameter names in the provided parameters that can + be used per event, on the order of 25. This is not just for an individual call, but for all + invocations for that eventName. + + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and + must consist of alphanumeric characters, _, -, or spaces. + + The length of each parameter value can be no more than on the order of 100 characters. + + */ +@interface FBAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @method + + @abstract + Log an event with just an eventName. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @method + + @abstract + Log an event with an eventName and a numeric value to be aggregated with other events of this name. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum; + + +/*! + + @method + + @abstract + Log an event with an eventName and a set of key/value pairs in the parameters dictionary. + Parameter limitations are described above. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. Providing session lets the developer + target a particular . If nil is provided, then `[FBSession activeSession]` will be used. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes + that this event doesn't have a value associated with it for summation. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + + +/* + * Purchase logging + */ + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase, as well as an to log to. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . A value of `nil` will use `[FBSession activeSession]`. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + +/*! + @method + + @abstract This method has been replaced by [FBSettings limitEventAndDataUsage] */ ++ (BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings limitEventAndDataUsage] instead"))); + +/*! + @method + + @abstract This method has been replaced by [FBSettings setLimitEventUsage] + @param limitEventUsage deprecated +*/ ++ (void)setLimitEventUsage:(BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings setLimitEventAndDataUsage] instead"))); + +/*! + + @method + + @abstract + Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the + app delegates' `applicationDidBecomeActive:` method. + + This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to + track user acquisition and app install ads conversions. + + @discussion + `activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. + "activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app" + event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much + time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data + is all visible in your app's App Events Insights. + */ ++ (void)activateApp; + +/* + * Control over event batching/flushing + */ + +/*! + + @method + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBAppEventsFlushBehavior)flushBehavior; + +/*! + + @method + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBAppEventsFlushBehavior)flushBehavior; + +/*! + @method + + @abstract + Set the 'override' App ID for App Event logging. + + @discussion + In some cases, apps want to use one Facebook App ID for login and social presence and another + for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but + want distinct logging.) By default, this value is `nil`, and defers to the `FacebookLoggingOverrideAppID` + plist value. If that's not set, the default App ID set via [FBSettings setDefaultAppID] + or in the `FacebookAppID` plist entry. + + This should be set before any other calls are made to `FBAppEvents`. Thus, you should set it in your application + delegate's `application:didFinishLaunchingWithOptions:` delegate. + + @param appID The Facebook App ID to be used for App Event logging. + */ ++ (void)setLoggingOverrideAppID:(NSString *)appID; + +/*! + @method + + @abstract + Get the 'override' App ID for App Event logging. + + @see setLoggingOverrideAppID: + + */ ++ (NSString *)loggingOverrideAppID; + + +/*! + + @method + + @abstract + Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate + kick off. Server failures will be reported through the NotificationCenter with notification ID `FBAppEventsLoggingResultNotification`. + */ ++ (void)flush; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h new file mode 100644 index 0000000..dfdcd2e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkData.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract This class contains information that represents an App Link from Facebook. + */ +@interface FBAppLinkData : NSObject + +/*! @abstract The target */ +@property (readonly) NSURL *targetURL; + +/*! @abstract List of the types of actions for this target */ +@property (readonly) NSArray *actionTypes; + +/*! @abstract List of the ids of the actions for this target */ +@property (readonly) NSArray *actionIDs; + +/*! @abstract Reference breadcrumb provided during creation of story */ +@property (readonly) NSString *ref; + +/*! @abstract User Agent string set by the referer */ +@property (readonly) NSString *userAgent; + +/*! @abstract Referer data is a JSON object set by the referer with referer-specific content */ +@property (readonly) NSDictionary *refererData; + +/*! @abstract Full set of query parameters for this app link */ +@property (readonly) NSDictionary *originalQueryParameters; + +/*! @abstract Original url from which applinkData was extracted */ +@property (readonly) NSURL *originalURL; + +/*! @abstract Addtional arguments supplied with the App Link data. */ +@property (readonly) NSDictionary *arguments; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h new file mode 100644 index 0000000..e1be2ea --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBAppLinkResolver.h @@ -0,0 +1,52 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import + +/*! + @class FBAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook app link + index to resolve App Links given a URL. It also provides an additional helper method that can resolve + multiple App Links in a single call. + + @discussion + Usage of this type requires a client token and linking + Bolts.framework. See `[FBSettings setClientToken:]`. + */ +@interface FBAppLinkResolver : NSObject + +/*! + @abstract Asynchronously resolves App Link data for multiple URLs. + + @param urls An array of NSURLs to resolve into App Links. + @returns A BFTask that will return dictionary mapping input NSURLs to their + corresponding BFAppLink. + + @discussion + You should set the client token before making this call. See `[FBSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h new file mode 100644 index 0000000..2cea86e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBCacheDescriptor.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class + + @abstract + Base class from which CacheDescriptors derive, provides a method to fetch data for later use + + @discussion + Cache descriptors allow your application to specify the arguments that will be + later used with another object, such as the FBFriendPickerViewController. By using a cache descriptor + instance, an application can choose to fetch data ahead of the point in time where the data is needed. + */ +@interface FBCacheDescriptor : NSObject + +/*! + @method + @abstract + Fetches and caches the data described by the cache descriptor instance, for the given session. + + @param session the to use for fetching data + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h new file mode 100644 index 0000000..2c461f1 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBColor.h @@ -0,0 +1,20 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +UIColor *FBUIColorWithRGBA(uint8_t r, uint8_t g, uint8_t b, CGFloat a); +UIColor *FBUIColorWithRGB(uint8_t r, uint8_t g, uint8_t b); diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h new file mode 100644 index 0000000..2d688e9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBConnect.h @@ -0,0 +1,21 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "FBDialog.h" +#include "FBLoginDialog.h" +#include "FBRequest.h" +#include "Facebook.h" diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h new file mode 100644 index 0000000..d44a138 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialog.h @@ -0,0 +1,165 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +@protocol FBDialogDelegate; +@class FBFrictionlessRequestSettings; + +/** + * Do not use this interface directly, instead, use dialog in Facebook.h + * + * Facebook dialog interface for start the facebook webView UIServer Dialog. + */ + +@interface FBDialog : UIView { + id _delegate; + NSMutableDictionary *_params; + NSString *_serverURL; + NSURL *_loadingURL; + UIWebView *_webView; + UIActivityIndicatorView *_spinner; + UIButton *_closeButton; + UIInterfaceOrientation _orientation; + BOOL _showingKeyboard; + BOOL _isViewInvisible; + FBFrictionlessRequestSettings *_frictionlessSettings; + + // Ensures that UI elements behind the dialog are disabled. + UIView *_modalBackgroundView; +} + +/** + * The delegate. + */ +@property (nonatomic, assign) id delegate; + +/** + * The parameters. + */ +@property (nonatomic, retain) NSMutableDictionary *params; + +- (NSString *)getStringFromUrl:(NSString *)url needle:(NSString *)needle; + +- (id) initWithURL:(NSString *)loadingURL + params:(NSMutableDictionary *)params + isViewInvisible:(BOOL)isViewInvisible + frictionlessSettings:(FBFrictionlessRequestSettings *)frictionlessSettings + delegate:(id)delegate; + +/** + * Displays the view with an animation. + * + * The view will be added to the top of the current key window. + */ +- (void)show; + +/** + * Displays the first page of the dialog. + * + * Do not ever call this directly. It is intended to be overriden by subclasses. + */ +- (void)load; + +/** + * Displays a URL in the dialog. + */ +- (void)loadURL:(NSString *)url + get:(NSDictionary *)getParams; + +/** + * Hides the view and notifies delegates of success or cancellation. + */ +- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated; + +/** + * Hides the view and notifies delegates of an error. + */ +- (void)dismissWithError:(NSError *)error animated:(BOOL)animated; + +/** + * Subclasses may override to perform actions just prior to showing the dialog. + */ +- (void)dialogWillAppear; + +/** + * Subclasses may override to perform actions just after the dialog is hidden. + */ +- (void)dialogWillDisappear; + +/** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ +- (void)dialogDidSucceed:(NSURL *)url; + +/** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ +- (void)dialogDidCancel:(NSURL *)url; +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/* + *Your application should implement this delegate + */ +@protocol FBDialogDelegate + +@optional + +/** + * Called when the dialog succeeds and is about to be dismissed. + */ +- (void)dialogDidComplete:(FBDialog *)dialog; + +/** + * Called when the dialog succeeds with a returning url. + */ +- (void)dialogCompleteWithUrl:(NSURL *)url; + +/** + * Called when the dialog get canceled by the user. + */ +- (void)dialogDidNotCompleteWithUrl:(NSURL *)url; + +/** + * Called when the dialog is cancelled and is about to be dismissed. + */ +- (void)dialogDidNotComplete:(FBDialog *)dialog; + +/** + * Called when dialog failed to load due to an error. + */ +- (void)dialog:(FBDialog *)dialog didFailWithError:(NSError *)error; + +/** + * Asks if a link touched by a user should be opened in an external browser. + * + * If a user touches a link, the default behavior is to open the link in the Safari browser, + * which will cause your app to quit. You may want to prevent this from happening, open the link + * in your own internal browser, or perhaps warn the user that they are about to leave your app. + * If so, implement this method on your delegate and return NO. If you warn the user, you + * should hold onto the URL and once you have received their acknowledgement open the URL yourself + * using [[UIApplication sharedApplication] openURL:]. + */ +- (BOOL)dialog:(FBDialog *)dialog shouldOpenURLInExternalBrowser:(NSURL *)url; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h new file mode 100644 index 0000000..01d3450 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogs.h @@ -0,0 +1,1029 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBLinkShareParams.h" +#import "FBOpenGraphActionParams.h" +#import "FBPhotoParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + */ +typedef NS_ENUM(NSUInteger, FBOSIntegratedShareDialogResult) { + /*! Indicates that the dialog action completed successfully. */ + FBOSIntegratedShareDialogResultSucceeded = 0, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBOSIntegratedShareDialogResultCancelled = 1, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBOSIntegratedShareDialogResultError = 2 +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the native share dialog + being displayed. + */ +typedef void (^FBOSIntegratedShareDialogHandler)(FBOSIntegratedShareDialogResult result, NSError *error); + +/*! + @typedef FBDialogAppCallCompletionHandler + + @abstract + A block that when passed to a method in FBDialogs is called back + with the results of the AppCall for that dialog. + + @discussion + This will be called on the UI thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + @param results The results of the AppCall for the dialog. This parameters is present + purely for convenience, and is the exact same value as call.dialogData.results. + + @param error The `NSError` representing any error that occurred. This parameters is + present purely for convenience, and is the exact same value as call.error. + + */ +typedef void (^FBDialogAppCallCompletionHandler)( + FBAppCall *call, + NSDictionary *results, + NSError *error); + +/*! + @class FBDialogs + + @abstract + Provides methods to display native (i.e., non-Web-based) dialogs to the user. + + @discussion + If you are building an app with a urlSchemeSuffix, you should also set the appropriate + plist entry. See `[FBSettings defaultUrlSchemeSuffix]`. + */ +@interface FBDialogs : NSObject + +#pragma mark - OSIntegratedShareDialog + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. The + current active session returned by [FBSession activeSession] will be used to determine + whether the dialog will be displayed. If a session is active, it must be open and the + login method used to authenticate the user must be native iOS 6.0 authentication. + If no session active, then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param image A UIImage that will be attached to the status update. May be nil. + + @param url An NSURL that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. The + current active session returned by [FBSession activeSession] will be used to determine + whether the dialog will be displayed. If a session is active, it must be open and the + login method used to authenticate the user must be native iOS 6.0 authentication. + If no session active, then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param images An array of UIImages that will be attached to the status update. May + be nil. + + @param urls An array of NSURLs that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. An + may be specified, or nil may be passed to indicate that the current + active session should be used. If a session is specified (whether explicitly or by + virtue of being the active session), it must be open and the login method used to + authenticate the user must be native iOS 6.0 authentication. If no session is specified + (and there is no active session), then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param session The to use to determine whether or not the user has been + authenticated with iOS native authentication. If nil, then [FBSession activeSession] + will be checked. See discussion above for the implications of nil or non-nil session. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param images An array of UIImages that will be attached to the status update. May + be nil. + + @param urls An array of NSURLs that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract Determines if the device is capable of presenting the OS integrated share dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentOSIntegratedShareDialogWithSession: + */ ++ (BOOL)canPresentOSIntegratedShareDialog; + +/*! + @abstract + Determines whether a call to presentShareDialogModallyFrom: will successfully present + a dialog. This is useful for applications that need to modify the available UI controls + depending on whether the dialog is available on the current platform and for the current + user. + + @param session The to use to determine whether or not the user has been + authenticated with iOS native authentication. If nil, then [FBSession activeSession] + will be checked. See discussion above for the implications of nil or non-nil session. + + @return YES if the dialog would be presented for the session, and NO if not + */ ++ (BOOL)canPresentOSIntegratedShareDialogWithSession:(FBSession *)session; + +#pragma mark - Native Share Dialog + +/*! + @abstract Determines if the device is capable of presenting the share dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentShareDialogWithOpenGraphActionParams: + @see canPresentShareDialogWithParams: + @see canPresentShareDialogWithPhotos + */ ++ (BOOL)canPresentShareDialog; + +/*! + @abstract + Determines whether a call to presentShareDialogWithOpenGraphActionParams:clientState:handler: + will successfully present a dialog in the Facebook application. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for + the same params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithTarget: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithParams method will return a non-nil FBAppCall for the same + params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithPhotoParams: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithPhotoParams method will return a non-nil FBAppCall. +*/ ++ (BOOL)canPresentShareDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +#pragma mark - Message Dialog + +/*! + @abstract Determines if the device is capable of presenting the message dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentMessageDialogWithOpenGraphActionParams: + @see canPresentMessageDialogWithParams: + @see canPresentMessageDialogWithPhotos + */ ++ (BOOL)canPresentMessageDialog; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithOpenGraphActionParams:...` will + successfully present a dialog in the Facebook Messenger app. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithParams:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithPhotos:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithOpenGraphActionParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. The "friends" and "place" properties + will be ignored as the Facebook Messenger app does not support tagging. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. +*/ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. The "friends" and "place" properties + will be ignored as the Facebook Messenger app does not support tagging. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h new file mode 100644 index 0000000..bffbc46 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsData.h @@ -0,0 +1,35 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract + This class encapsulates state and data related to the presentation and completion + of a dialog. + */ +@interface FBDialogsData : NSObject + +/*! @abstract The method being performed */ +@property (nonatomic, readonly) NSString *method; +/*! @abstract The arguments being passed to the entity that will show the dialog */ +@property (nonatomic, readonly) NSDictionary *arguments; +/*! @abstract Client JSON state that is passed through to the completion handler for context */ +@property (nonatomic, readonly) NSDictionary *clientState; +/*! @abstract Results of this FBAppCall that are only set before calling an FBAppCallHandler */ +@property (nonatomic, readonly) NSDictionary *results; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h new file mode 100644 index 0000000..6fb76d6 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBDialogsParams.h @@ -0,0 +1,33 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @class FBDialogsParams + + @abstract + This object is used as a base class for parameters passed to native dialogs that + open in the Facebook app. + */ +@interface FBDialogsParams : NSObject + +/*! + @abstract Validates the receiver to ensure that it is configured properly. + */ +- (NSError *)validate; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h new file mode 100644 index 0000000..1d2f628 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBError.h @@ -0,0 +1,385 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + The NSError domain of all errors returned by the Facebook SDK. +*/ +FBSDK_EXTERN NSString *const FacebookSDKDomain; + +/*! + The NSError domain of all errors surfaced by the Facebook SDK that + were returned by the Facebook Application + */ +FBSDK_EXTERN NSString *const FacebookNativeApplicationDomain; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError for the parsed JSON response + from the server. In case of a batch, includes the JSON for a single FBRequest. +*/ +FBSDK_EXTERN NSString *const FBErrorParsedJSONResponseKey; + +/*! + The key in the userInfo NSDictionary of NSError indicating + the HTTP status code of the response (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorHTTPStatusCodeKey; + +/*! + @typedef NS_ENUM (NSUInteger, FBErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookSDKDomain. + */ +typedef NS_ENUM(NSInteger, FBErrorCode) { + /*! + Like nil for FBErrorCode values, represents an error code that + has not been initialized yet. + */ + FBErrorInvalid = 0, + + /*! The operation failed because it was cancelled. */ + FBErrorOperationCancelled, + + /*! A login attempt failed */ + FBErrorLoginFailedOrCancelled, + + /*! The graph API returned an error for this operation. */ + FBErrorRequestConnectionApi, + + /*! + The operation failed because the server returned an unexpected + response. You can get this error if you are not using the most + recent SDK, or if you set your application's migration settings + incorrectly for the version of the SDK you are using. + + If this occurs on the current SDK with proper app migration + settings, you may need to try changing to one request per batch. + */ + FBErrorProtocolMismatch, + + /*! Non-success HTTP status code was returned from the operation. */ + FBErrorHTTPError, + + /*! An endpoint that returns a binary response was used with FBRequestConnection. + Endpoints that return image/jpg, etc. should be accessed using NSURLRequest */ + FBErrorNonTextMimeTypeReturned, + + /*! An error occurred while trying to display a native dialog */ + FBErrorDialog, + + /*! An error occurred using the FBAppEvents class */ + FBErrorAppEvents, + + /*! An error occurred related to an iOS API call */ + FBErrorSystemAPI, + + /*! + The application had its applicationDidBecomeActive: method called while waiting + on a response from the native Facebook app for a pending FBAppCall. + */ + FBErrorAppActivatedWhilePendingAppCall, + + /*! + The application had its openURL: method called from a source that was not a + Facebook app and with a URL that was intended for the AppBridge + */ + FBErrorUntrustedURL, + + /*! + The URL passed to FBAppCall, was not able to be parsed + */ + FBErrorMalformedURL, + + /*! + The operation failed because the session is currently busy reconnecting. + */ + FBErrorSessionReconnectInProgess, + + /*! + Reserved for future use. + */ + FBErrorOperationDisallowedForRestrictedTreatment, + + /*! + The server returned a response that the SDK could not decode. + */ + FBErrorUnexpectedResponse, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBNativeApplicationErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookNativeApplicationDomain. + */ +typedef NS_ENUM(NSUInteger, FBNativeApplicationErrorCode) { + /*! A general error in processing an FBAppCall, without a known cause. Unhandled exceptions are a good example */ + FBAppCallErrorUnknown = 1, + + /*! The FBAppCall cannot be processed for some reason */ + FBAppCallErrorUnsupported = 2, + + /*! The FBAppCall is for a method that does not exist (or is turned off) */ + FBAppCallErrorUnknownMethod = 3, + + /*! The FBAppCall cannot be processed at the moment, but can be retried at a later time. */ + FBAppCallErrorServiceBusy = 4, + + /*! Share was called in the native Facebook app with incomplete or incorrect arguments */ + FBShareErrorInvalidParam = 100, + + /*! A server error occurred while calling Share in the native Facebook app. */ + FBShareErrorServer = 102, + + /*! An unknown error occurred while calling Share in the native Facebook app. */ + FBShareErrorUnknown = 103, + + /*! Disallowed from calling Share in the native Facebook app. */ + FBShareErrorDenied = 104, +}; + +/*! + @typedef NS_ENUM (NSInteger, FBErrorCategory) + + @abstract Indicates the Facebook SDK classification for the error + + @discussion See `[FBErrorUtility errorCategoryForError:]`. + */ +typedef NS_ENUM(NSInteger, FBErrorCategory) { + /*! Indicates that the error category is invalid and likely represents an error that + is unrelated to Facebook or the Facebook SDK */ + FBErrorCategoryInvalid = 0, + /*! Indicates that the error may be authentication related but the application should retry the operation. + This case may involve user action that must be taken, and so the application should also test + the fberrorShouldNotifyUser property and if YES display fberrorUserMessage to the user before retrying.*/ + FBErrorCategoryRetry = 1, + /*! Indicates that the error is authentication related and the application should reopen the session */ + FBErrorCategoryAuthenticationReopenSession = 2, + /*! Indicates that the error is permission related */ + FBErrorCategoryPermissions = 3, + /*! Indicates that the error implies that the server had an unexpected failure or may be temporarily down */ + FBErrorCategoryServer = 4, + /*! Indicates that the error results from the server throttling the client */ + FBErrorCategoryThrottling = 5, + /*! Indicates the user cancelled the operation */ + FBErrorCategoryUserCancelled = 6, + /*! Indicates that the error is Facebook-related but is uncategorizable, and likely newer than the + current version of the SDK */ + FBErrorCategoryFacebookOther = -1, + /*! Indicates that the error is an application error resulting in a bad or malformed request to the server. */ + FBErrorCategoryBadRequest = -2, +}; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the session associated with the error (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorSessionKey; + +/*! + The key in the userInfo NSDictionary of NSError that points to the URL + that caused an error, in its processing by FBAppCall. + */ +FBSDK_EXTERN NSString *const FBErrorUnprocessedURLKey; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value will be one of the constants prefixed by FBErrorLoginFailedReason*. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReason; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value indicates an original login error code wrapped by this error. + This is only used in the web dialog login flow. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedOriginalErrorCode; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a web dialog auth. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + did not cancel a web dialog auth. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineNotCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a non-iOS 6 SSO (either Safari or Facebook App) login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled an iOS system login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledSystemValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + condition. You may inspect the rest of userInfo for other data. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonOtherError; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the app's + slider in iOS 6 (device Settings -> Privacy -> Facebook {app}) has + been disabled. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + has occurred when requesting Facebook account acccess in iOS 6 that was + not `FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue` nor + a user cancellation. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemError; +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUnitTestResponseUnrecognized; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the session was closed. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonSessionClosed; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelled; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails on + iOS 6 with the Facebook account. Indicates the request for new permissions has + failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelledSystem; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the request was + for a different user than the original permission set. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonWrongUser; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBDialogs` operations. (error.code equals FBErrorDialog). + If present, the value will be one of the constants prefixed by FBErrorDialog *. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogReasonKey; + +/*! + A value that may appear in the NSError userInfo dictionary under the +`FBErrorDialogReasonKey` key. Indicates that a native dialog is not supported + in the current OS. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogNotSupported; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because it is not appropriate for the current session. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidForSession; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed for some other reason. + */ +FBSDK_EXTERN NSString *const FBErrorDialogCantBeDisplayed; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because an Open Graph object that was passed was not configured + correctly. The object must either (a) exist by having an 'id' or 'url' value; + or, (b) configured for creation (by setting the 'type' value and + provisionedForPost property) +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphObject; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing an Open Graph action were + not configured. The parameters must include an 'action', 'actionType', and + 'previewPropertyName'. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphActionParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing a status update, link, or photo were + not configured. The parameters must not include both 'photos' and a 'link'. */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidShareParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a like dialog cannot be + displayed because the objectID parameter value is invalid. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidLikeObjectID; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). +*/ +FBSDK_EXTERN NSString *const FBErrorAppEventsReasonKey; + +// Exception strings raised by the Facebook SDK + +/*! + This exception is raised by methods in the Facebook SDK to indicate + that an attempted operation is invalid + */ +FBSDK_EXTERN NSString *const FBInvalidOperationException; + +// Facebook SDK also raises exceptions the following common exceptions: +// NSInvalidArgumentException + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h new file mode 100644 index 0000000..ab075cb --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBErrorUtility.h @@ -0,0 +1,103 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @class FBErrorUtility + + @abstract A utility class with methods to provide more information for Facebook + related errors if you do not want to use the NSError(FBError) category. + + */ +@interface FBErrorUtility : NSObject + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error The error to be categorized. + */ ++ (FBErrorCategory)errorCategoryForError:(NSError *)error; + +/*! + @abstract + Retrieves the underlying error code from an FBError that is wrapped within an NSError. + Returns NSNotFound if no error code was found. + + @param error The error whose error code should be retrieved. + */ ++ (NSUInteger)errorCodeForError:(NSError *)error; + +/*! + @abstract + Retrieves the underlying error subcode from an FBError that is wrapped within an NSError. + Returns NSNotFound if no error subcode was found. + + @param error The error whose error subcode should be retrieved. + */ ++ (NSUInteger)errorSubcodeForError:(NSError *)error; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if this returns NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error The error to inspect. + */ ++ (BOOL)shouldNotifyUserForError:(NSError *)error; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + +shouldNotifyUserForError: returns YES, this method returns a localizable message suitable for display. + + @param error The error to inspect. + */ ++ (NSString *)userMessageForError:(NSError *)error; + +/*! + @abstract + A short summary of the error suitable for display to the user. + Not all Facebook errors yield a localized message/title suitable for user display; however in all cases when title is + available, user should be notified. + + @param error The error to inspect. + */ ++ (NSString *)userTitleForError:(NSError *)error; + +/*! + @abstract + YES if given error is transient and may succeed if the initial action is retried as-is. + Application may use this information to display a "Retry" button, if user should be notified about this error. + + @param error The error to inspect. + */ ++ (BOOL)isTransientError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h new file mode 100644 index 0000000..cfca124 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRecipientCache.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +#import "FBCacheDescriptor.h" +#import "FBRequest.h" +#import "FBWebDialogs.h" + +/*! + @class FBFrictionlessRecipientCache + + @abstract + Maintains a cache of friends that can recieve application requests from the user in + using the frictionless feature of the requests web dialog. + + This class follows the `FBCacheDescriptor` pattern used elsewhere in the SDK, and applications may call + one of the prefetchAndCacheForSession methods to fetch a friend list prior to the + point where a dialog is presented. The cache is also updated with each presentation of the request + dialog using the cache instance. + */ +@interface FBFrictionlessRecipientCache : FBCacheDescriptor + +/*! @abstract An array containing the list of known FBIDs for recipients enabled for frictionless requests */ +@property (nonatomic, readwrite, copy) NSArray *recipientIDs; + +/*! + @abstract + Checks to see if a given user or FBID for a user is known to be enabled for + frictionless requestests + + @param user An NSString, NSNumber of `FBGraphUser` representing a user to check + */ +- (BOOL)isFrictionlessRecipient:(id)user; + +/*! + @abstract + Checks to see if a collection of users or FBIDs for users are known to be enabled for + frictionless requestests + + @param users An NSArray of NSString, NSNumber of `FBGraphUser` objects + representing users to check + */ +- (BOOL)areFrictionlessRecipients:(NSArray *)users; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + + @param handler An optional completion handler, called when the request for cached users has + completed. It can be useful to use the handler to enable UI or perform other request-related + operations, after the cache is populated. + */ +- (void)prefetchAndCacheForSession:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h new file mode 100644 index 0000000..17ee8ec --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFrictionlessRequestSettings.h @@ -0,0 +1,80 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBRequest; +@class Facebook; + +/** + * Do not use this interface directly, instead, use methods in Facebook.h + * + * Handles frictionless interaction and recipient-caching by the SDK, + * see https://developers.facebook.com/docs/reference/dialogs/requests/ + */ +@interface FBFrictionlessRequestSettings : NSObject { +@private + NSArray *_allowedRecipients; + FBRequest *_activeRequest; + BOOL _enabled; +} + +/** + * BOOL indicating whether frictionless request sending has been enabled + */ +@property (nonatomic, readonly) BOOL enabled; + +/** + * NSArray of recipients + */ +@property (nonatomic, readonly) NSArray *recipientIDs; + +/** + * Enable frictionless request sending by the sdk; this means: + * 1. query and cache the current set of frictionless recipients + * 2. flag other facets of the sdk to behave in a frictionless way + */ +- (void)enableWithFacebook:(Facebook *)facebook; + +/** + * Reload recipient cache; called by the sdk to keep the cache fresh; + * method makes graph request: me/apprequestformerrecipients + */ +- (void)reloadRecipientCacheWithFacebook:(Facebook *)facebook; + +/** + * Update the recipient cache; called by the sdk to keep the cache fresh; + */ +- (void)updateRecipientCacheWithRecipients:(NSArray *)ids; + +/** + * Update the recipient cache, using a request result + */ +- (void)updateRecipientCacheWithRequestResult:(id)result; + +/** + * Given an fbID for a user, indicates whether user is enabled for + * frictionless calls + */ +- (BOOL)isFrictionlessEnabledForRecipient:(id)fbid; + +/** + * Given an array of user fbIDs, indicates whether they are enabled for + * frictionless calls + */ +- (BOOL)isFrictionlessEnabledForRecipients:(NSArray *)fbids; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h new file mode 100644 index 0000000..b3e2704 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBFriendPickerViewController.h @@ -0,0 +1,170 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphUser.h" +#import "FBPeoplePickerViewController.h" + +@protocol FBFriendPickerDelegate; + + +/*! + @class + + @abstract + The `FBFriendPickerViewController` class creates a controller object that manages + the user interface for displaying and selecting Facebook friends. + + @discussion + When the `FBFriendPickerViewController` view loads it creates a `UITableView` object + where the friends will be displayed. You can access this view through the `tableView` + property. The friend display can be sorted by first name or last name. Friends' + names can be displayed with the first name first or the last name first. + + The friend data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any friend data requests will first check the cache and use that data. + If the friend picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to friend selection and + data changes. The delegate can also be used to filter the friends to display in the + picker. + */ +@interface FBFriendPickerViewController : FBPeoplePickerViewController + +/*! + @abstract + The list of friends that are currently selected in the view. + The items in the array are objects. + + @discussion + You can set this this array to pre-select items in the picker. The objects in the array + must be complete id objects (i.e., fetched from a Graph query or from a + previous picker's selection, with id and appropriate name fields). + */ +@property (nonatomic, copy, readwrite) NSArray *selection; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor based on default settings of the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + */ ++ (FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + + @param userID The profile ID of the user whose friends will be displayed. A nil value implies a "me" alias. + @param fieldsForRequest The set of additional fields to include in the request for friend data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithUserID:(NSString *)userID fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBFriendPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + + The methods of correspond to . + If a pair of corresponding methods are implemented, the + method is called first. + */ +@protocol FBFriendPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param friendPicker The friend picker view controller whose data changed. + */ +- (void)friendPickerViewControllerDataDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param friendPicker The friend picker view controller whose selection changed. + */ +- (void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Asks the delegate whether to include a friend in the list. + + @discussion + This can be used to implement a search bar that filters the friend list. + + If -[ graphObjectPickerViewController:shouldIncludeGraphObject:] + is implemented and returns NO, this method is not called. + + @param friendPicker The friend picker view controller that is requesting this information. + @param user An object representing the friend. + */ +- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + shouldIncludeUser:(id)user; + +/*! + @abstract + Tells the delegate that there is a communication error. + + @param friendPicker The friend picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h new file mode 100644 index 0000000..7f71ce6 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphLocation.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphLocation` protocol enables typed access to the `location` property + of a Facebook place object. + + + @discussion + The `FBGraphLocation` protocol represents the most commonly used properties of a + location object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphLocation + +/*! + @property + @abstract Typed access to a location's street. + */ +@property (retain, nonatomic) NSString *street; + +/*! + @property + @abstract Typed access to a location's city. + */ +@property (retain, nonatomic) NSString *city; + +/*! + @property + @abstract Typed access to a location's state. + */ +@property (retain, nonatomic) NSString *state; + +/*! + @property + @abstract Typed access to a location's country. + */ +@property (retain, nonatomic) NSString *country; + +/*! + @property + @abstract Typed access to a location's zip code. + */ +@property (retain, nonatomic) NSString *zip; + +/*! + @property + @abstract Typed access to a location's latitude. + */ +@property (retain, nonatomic) NSNumber *latitude; + +/*! + @property + @abstract Typed access to a location's longitude. + */ +@property (retain, nonatomic) NSNumber *longitude; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h new file mode 100644 index 0000000..dfdff1c --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObject.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@protocol FBOpenGraphObject; +@protocol FBOpenGraphAction; + +/*! + @protocol + + @abstract + The `FBGraphObject` protocol is the base protocol which enables typed access to graph objects and + open graph objects. Inherit from this protocol or a sub-protocol in order to introduce custom types + for typed access to Facebook objects. + + @discussion + The `FBGraphObject` protocol is the core type used by the Facebook SDK for iOS to + represent objects in the Facebook Social Graph and the Facebook Open Graph (OG). + The `FBGraphObject` class implements useful default functionality, but is rarely + used directly by applications. The `FBGraphObject` protocol, in contrast is the + base protocol for all graph object access via the SDK. + + Goals of the FBGraphObject types: +
    +
  • Lightweight/maintainable/robust
  • +
  • Extensible and resilient to change, both by Facebook and third party (OG)
  • +
  • Simple and natural extension to Objective-C
  • +
+ + The FBGraphObject at its core is a duck typed (if it walks/swims/quacks... + its a duck) model which supports an optional static facade. Duck-typing achieves + the flexibility necessary for Social Graph and OG uses, and the static facade + increases discoverability, maintainability, robustness and simplicity. + The following excerpt from the PlacePickerSample shows a simple use of the + a facade protocol `FBGraphPlace` by an application: + +
+ ‐ (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker
+ {
+ id<FBGraphPlace> place = placePicker.selection;
+
+ // we'll use logging to show the simple typed property access to place and location info
+ NSLog(@"place=%@, city=%@, state=%@, lat long=%@ %@",
+ place.name,
+ place.location.city,
+ place.location.state,
+ place.location.latitude,
+ place.location.longitude);
+ }
+ 
+ + Note that in this example, access to common place information is available through typed property + syntax. But if at some point places in the Social Graph supported additional fields "foo" and "bar", not + reflected in the `FBGraphPlace` protocol, the application could still access the values like so: + +
+ NSString *foo = [place objectForKey:@"foo"]; // perhaps located at the ... in the preceding example
+ NSNumber *bar = [place objectForKey:@"bar"]; // extensibility applies to Social and Open graph uses
+ 
+ + In addition to untyped access, applications and future revisions of the SDK may add facade protocols by + declaring a protocol inheriting the `FBGraphObject` protocol, like so: + +
+ @protocol MyGraphThing<FBGraphObject>
+ @property (copy, nonatomic) NSString *objectID;
+ @property (copy, nonatomic) NSString *name;
+ @end
+ 
+ + Important: facade implementations are inferred by graph objects returned by the methods of the SDK. This + means that no explicit implementation is required by application or SDK code. Any `FBGraphObject` instance + may be cast to any `FBGraphObject` facade protocol, and accessed via properties. If a field is not present + for a given facade property, the property will return nil. + + The following layer diagram depicts some of the concepts discussed thus far: + +
+                        *-------------* *------------* *-------------**--------------------------*
+ Facade -->             | FBGraphUser | |FBGraphPlace| | MyGraphThing|| MyGraphPersonExtentension| ...
+                        *-------------* *------------* *-------------**--------------------------*
+                        *------------------------------------* *--------------------------------------*
+ Transparent impl -->   |     FBGraphObject (instances)      | |      CustomClass<FBGraphObject>      |
+                        *------------------------------------* *--------------------------------------*
+                        *-------------------**------------------------* *-----------------------------*
+ Apparent impl -->      |NSMutableDictionary||FBGraphObject (protocol)| |FBGraphObject (class methods)|
+                        *-------------------**------------------------* *-----------------------------*
+ 
+ + The *Facade* layer is meant for typed access to graph objects. The *Transparent impl* layer (more + specifically, the instance capabilities of `FBGraphObject`) are used by the SDK and app logic + internally, but are not part of the public interface between application and SDK. The *Apparent impl* + layer represents the lower-level "duck-typed" use of graph objects. + + Implementation note: the SDK returns `NSMutableDictionary` derived instances with types declared like + one of the following: + +
+ NSMutableDictionary<FBGraphObject> *obj;     // no facade specified (still castable by app)
+ NSMutableDictionary<FBGraphPlace> *person;   // facade specified when possible
+ 
+ + However, when passing a graph object to the SDK, `NSMutableDictionary` is not assumed; only the + FBGraphObject protocol is assumed, like so: + +
+ id<FBGraphObject> anyGraphObj;
+ 
+ + As such, the methods declared on the `FBGraphObject` protocol represent the methods used by the SDK to + consume graph objects. While the `FBGraphObject` class implements the full `NSMutableDictionary` and KVC + interfaces, these are not consumed directly by the SDK, and are optional for custom implementations. + */ +@protocol FBGraphObject + +/*! + @method + @abstract + Returns the number of properties on this `FBGraphObject`. + */ +- (NSUInteger)count; +/*! + @method + @abstract + Returns a property on this `FBGraphObject`. + + @param aKey name of the property to return + */ +- (id)objectForKey:(id)aKey; +/*! + @method + @abstract + Returns an enumerator of the property names on this `FBGraphObject`. + */ +- (NSEnumerator *)keyEnumerator; +/*! + @method + @abstract + Removes a property on this `FBGraphObject`. + + @param aKey name of the property to remove + */ +- (void)removeObjectForKey:(id)aKey; +/*! + @method + @abstract + Sets the value of a property on this `FBGraphObject`. + + @param anObject the new value of the property + @param aKey name of the property to set + */ +- (void)setObject:(id)anObject forKey:(id)aKey; + +@optional + +/*! + @abstract + This property signifies that the current graph object is provisioned for POST (as a definition + for a new or updated graph object), and should be posted AS-IS in its JSON encoded form, whereas + some graph objects (usually those embedded in other graph objects as references to existing objects) + may only have their "id" or "url" posted. + */ +@property (nonatomic, assign) BOOL provisionedForPost; + +@end + +/*! + @class + + @abstract + Static class with helpers for use with graph objects + + @discussion + The public interface of this class is useful for creating objects that have the same graph characteristics + of those returned by methods of the SDK. This class also represents the internal implementation of the + `FBGraphObject` protocol, used by the Facebook SDK. Application code should not use the `FBGraphObject` class to + access instances and instance members, favoring the protocol. + */ +@interface FBGraphObject : NSMutableDictionary + +/*! + @method + @abstract + Used to create a graph object, usually for use in posting a new graph object or action. + */ ++ (NSMutableDictionary *)graphObject; + +/*! + @method + @abstract + Used to wrap an existing dictionary with a `FBGraphObject` facade + + @discussion + Normally you will not need to call this method, as the Facebook SDK already "FBGraphObject-ifys" json objects + fetch via `FBRequest` and `FBRequestConnection`. However, you may have other reasons to create json objects in your + application, which you would like to treat as a graph object. The pattern for doing this is that you pass the root + node of the json to this method, to retrieve a wrapper. From this point, if you traverse the graph, any other objects + deeper in the hierarchy will be wrapped as `FBGraphObject`'s in a lazy fashion. + + This method is designed to avoid unnecessary memory allocations, and object copying. Due to this, the method does + not copy the source object if it can be avoided, but rather wraps and uses it as is. The returned object derives + callers shoudl use the returned object after calls to this method, rather than continue to call methods on the original + object. + + @param jsonDictionary the dictionary representing the underlying object to wrap + */ ++ (NSMutableDictionary *)graphObjectWrappingDictionary:(NSDictionary *)jsonDictionary; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action. + */ ++ (NSMutableDictionary *)openGraphActionForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + */ ++ (NSMutableDictionary *)openGraphObjectForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + + @param type the object type name, in the form namespace:typename + @param title a title for the object + @param image the image property for the object + @param url the url property for the object + @param description the description for the object + */ ++ (NSMutableDictionary *)openGraphObjectForPostWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description; + +/*! + @method + @abstract + Used to compare two `FBGraphObject`s to determine if represent the same object. We do not overload + the concept of equality as there are various types of equality that may be important for an `FBGraphObject` + (for instance, two different `FBGraphObject`s could represent the same object, but contain different + subsets of fields). + + @param anObject an `FBGraphObject` to test + + @param anotherObject the `FBGraphObject` to compare it against + */ ++ (BOOL)isGraphObjectID:(id)anObject sameAs:(id)anotherObject; + + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObjectPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObjectPickerViewController.h new file mode 100644 index 0000000..66af8a5 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphObjectPickerViewController.h @@ -0,0 +1,157 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBGraphObject.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBGraphObjectPickerDelegate; + +/*! + @class FBGraphObjectPickerViewController + + @abstract + The `FBGraphObjectPickerViewController` class is an abstract controller object that + manages the user interface for displaying and selecting a collection of graph objects. + + @discussion + When the `FBGraphObjectPickerViewController` view loads it creates a `UITableView` + object where the graph objects defined by a concrete subclass will be displayed. You + can access this view through the `tableView` property. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to object selection and + data changes. The delegate can also be used to filter the objects to display in the + picker. + */ +@interface FBGraphObjectPickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get graph object data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + A Boolean value that indicates whether pictures representing the graph object are displayed. + Defaults to YES. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + The session that is used in the request for the graph object data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @abstract + Initiates a query to get the graph object data. + + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter or sort (if applicable) properties change. This may affect the + order or display of information. + */ +- (void)updateView; + +@end + +/*! + @protocol + + @abstract + The `FBGraphObjectPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBGraphObjectPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param graphObjectPicker The graph object picker view controller whose data changed. + */ +- (void)graphObjectPickerViewControllerDataDidChange:(FBGraphObjectPickerViewController *)graphObjectPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param graphObjectPicker The graph object picker view controller whose selection changed. + */ +- (void)graphObjectPickerViewControllerSelectionDidChange:(FBGraphObjectPickerViewController *)graphObjectPicker; + +/*! + @abstract + Asks the delegate whether to include a graph object in the list. + + @discussion + This can be used to implement a search bar that filters the graph object list. + + @param graphObjectPicker The graph object picker view controller that is requesting this information. + @param object An object + */ +- (BOOL)graphObjectPickerViewController:(FBGraphObjectPickerViewController *)graphObjectPicker + shouldIncludeGraphObject:(id)object; + +/*! + @abstract + Called if there is a communication error. + + @param graphObjectPicker The graph object picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)graphObjectPickerViewController:(FBGraphObjectPickerViewController *)graphObjectPicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPerson.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPerson.h new file mode 100644 index 0000000..44bdbe3 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPerson.h @@ -0,0 +1,69 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPerson` protocol enables typed access to a person's name, photo + and context-specific identifier as represented in the Graph API. + + + @discussion + The `FBGraphPerson` protocol provides access to the name, picture and context-specific + ID of a person represented by a graph object. It may be used to access an `NSDictionary` + object that has been wrapped with an facade. + */ +@protocol FBGraphPerson + +/*! + @property + @abstract Typed access to the user ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the user's name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the user's first name. + */ +@property (retain, nonatomic) NSString *first_name; + +/*! + @property + @abstract Typed access to the user's middle name. + */ +@property (retain, nonatomic) NSString *middle_name; + +/*! + @property + @abstract Typed access to the user's last name. + */ +@property (retain, nonatomic) NSString *last_name; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h new file mode 100644 index 0000000..2a0a4dc --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphPlace.h @@ -0,0 +1,70 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphLocation.h" +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPlace` protocol enables typed access to a place object + as represented in the Graph API. + + + @discussion + The `FBGraphPlace` protocol represents the most commonly used properties of a + Facebook place object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphPlace + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! +@property +@abstract Typed access to the place ID. +@discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. +*/ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the place name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the place category. + */ +@property (retain, nonatomic) NSString *category; + +/*! + @property + @abstract Typed access to the place location. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h new file mode 100644 index 0000000..5358bdb --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBGraphUser.h @@ -0,0 +1,67 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphPerson.h" +#import "FBGraphPlace.h" + +/*! + @protocol + + @abstract + The `FBGraphUser` protocol enables typed access to a user object + as represented in the Graph API. + + + @discussion + The `FBGraphUser` protocol represents the most commonly used properties of a + Facebook user object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphUser + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the user's profile URL. + */ +@property (retain, nonatomic) NSString *link; + +/*! + @property + @abstract Typed access to the user's username. + */ +@property (retain, nonatomic) NSString *username; + +/*! + @property + @abstract Typed access to the user's birthday. + */ +@property (retain, nonatomic) NSString *birthday; + +/*! + @property + @abstract Typed access to the user's current city. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h new file mode 100644 index 0000000..0a1d4b9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBInsights.h @@ -0,0 +1,103 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + @typedef FBInsightsFlushBehavior enum + + @abstract This enum has been deprecated in favor of FBAppEventsFlushBehavior. + */ +__attribute__ ((deprecated("use FBAppEventsFlushBehavior instead"))) +typedef NS_ENUM(NSUInteger, FBInsightsFlushBehavior) { + /*! Deprecated; use FBAppEventsFlushBehaviorAuto instead */ + FBInsightsFlushBehaviorAuto = 0, + /*! Deprecated; use FBAppEventsFlushBehaviorExplicitOnly instead */ + FBInsightsFlushBehaviorExplicitOnly +}; + +FBSDK_EXTERN NSString *const FBInsightsLoggingResultNotification __attribute__((deprecated)); + +/*! + @class FBInsights + + @abstract This class has been deprecated in favor of FBAppEvents. + */ +__attribute__ ((deprecated("Use the FBAppEvents class instead"))) +@interface FBInsights : NSObject + +/*! + @abstract deprecated +*/ ++ (NSString *)appVersion __attribute__((deprecated)); +/*! + @abstract deprecated + @param appVersion deprecated +*/ ++ (void)setAppVersion:(NSString *)appVersion __attribute__((deprecated("use [FBSettings setAppVersion] instead"))); + +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + @param parameters deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + @param parameters deprecated + @param session deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters session:(FBSession *)session __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param pixelID deprecated + @param value deprecated + */ ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value __attribute__((deprecated)); +/*! + @abstract deprecated + @param pixelID deprecated + @param value deprecated + @param session deprecated + */ ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value session:(FBSession *)session __attribute__((deprecated)); +/*! + @abstract deprecated + */ ++ (FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents flushBehavior] instead"))); +/*! + @abstract deprecated + @param flushBehavior deprecated + */ ++ (void)setFlushBehavior:(FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents setFlushBehavior] instead"))); +/*! + @abstract deprecated + */ ++ (void)flush __attribute__((deprecated("use [FBAppEvents flush] instead"))); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h new file mode 100644 index 0000000..511bf3b --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLikeControl.h @@ -0,0 +1,172 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlAuxiliaryPosition) + + @abstract Specifies the position of the auxiliary view relative to the like button. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlAuxiliaryPosition) +{ + /*! The auxiliary view is inline with the like button. */ + FBLikeControlAuxiliaryPositionInline, + /*! The auxiliary view is above the like button. */ + FBLikeControlAuxiliaryPositionTop, + /*! The auxiliary view is below the like button. */ + FBLikeControlAuxiliaryPositionBottom, +}; + +/*! + @abstract Converts an FBLikeControlAuxiliaryPosition to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlAuxiliaryPosition(FBLikeControlAuxiliaryPosition auxiliaryPosition); + +/*! + @typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) + + @abstract Specifies the horizontal alignment for FBLikeControlStyleStandard with + FBLikeControlAuxiliaryPositionTop or FBLikeControlAuxiliaryPositionBottom. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) +{ + /*! The subviews are left aligned. */ + FBLikeControlHorizontalAlignmentLeft, + /*! The subviews are center aligned. */ + FBLikeControlHorizontalAlignmentCenter, + /*! The subviews are right aligned. */ + FBLikeControlHorizontalAlignmentRight, +}; + +/*! + @abstract Converts an FBLikeControlHorizontalAlignment to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlHorizontalAlignment(FBLikeControlHorizontalAlignment horizontalAlignment); + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlObjectType) + + @abstract Specifies the type of object referenced by the objectID of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlObjectType) +{ + /*! The objectID refers to an unknown object type. */ + FBLikeControlObjectTypeUnknown = 0, + /*! The objectID refers to an Open Graph object. */ + FBLikeControlObjectTypeOpenGraphObject, + /*! The objectID refers to a Page object. */ + FBLikeControlObjectTypePage, +}; + +/*! + @abstract Converts an FBLikeControlObjectType to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlObjectType(FBLikeControlObjectType objectType); + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlStyle) + + @abstract Specifies the style of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlStyle) +{ + /*! Displays the button and the social sentence. */ + FBLikeControlStyleStandard = 0, + /*! Displays the button and a box that contains the like count. */ + FBLikeControlStyleBoxCount, + /*! Displays the button only. */ + FBLikeControlStyleButton, +}; + +/*! + @abstract Converts an FBLikeControlStyle to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlStyle(FBLikeControlStyle style); + +/*! + @class FBLikeControl + + @abstract UI control to like an object in the Facebook graph. + + @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a + fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update + with the new state and send actions for the UIControlEventValueChanged event. + */ +@interface FBLikeControl : UIControl + +/*! + @abstract The foreground color to use for the content of the receiver. + */ +@property (nonatomic, strong) UIColor *foregroundColor; + +/*! + @abstract The position for the auxiliary view for the receiver. + + @see FBLikeControlAuxiliaryPosition + */ +@property (nonatomic, assign) FBLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; + +/*! + @abstract The text alignment of the social sentence. + + @discussion This value is only valid for FBLikeControlStyleStandard with FBLikeControlAuxiliaryPositionTop|Bottom. + */ +@property (nonatomic, assign) FBLikeControlHorizontalAlignment likeControlHorizontalAlignment; + +/*! + @abstract The style to use for the receiver. + + @see FBLikeControlStyle + */ +@property (nonatomic, assign) FBLikeControlStyle likeControlStyle; + +/*! + @abstract The objectID for the object to like. + + @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an + Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract The type of object referenced by the objectID. + + @discussion If the objectType is unknown, the control will determine the objectType by querying the server with the + objectID. Specifying a value for the objectType is an optimization that should be used if the type is known by the + consumer. Consider setting the objectType if you know your objectType when setting the objectID. + */ +@property (nonatomic, assign) FBLikeControlObjectType objectType; + +/*! + @abstract The preferred maximum width (in points) for autolayout. + + @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, + if the text extends beyond the width specified by this property, the additional text is flowed to one or more new + lines, thereby increasing the height of the receiver. + */ +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h new file mode 100644 index 0000000..ba15437 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLinkShareParams.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBLinkShareParams + + @abstract + This object is used to encapsulate state for parameters to a share a link, + typically with the Facebook Native Share Dialog or the Message Dialog. + */ +@interface FBLinkShareParams : FBDialogsParams + +/*! @abstract The URL link to be attached to the post. Only "http" or "https" + schemes are supported. */ +@property (nonatomic, copy) NSURL *link; + +/*! @abstract The name, or title associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *name; + +/*! @abstract The caption to be used with the link. Is only used if the link is + non-nil. */ +@property (nonatomic, copy) NSString *caption; + +/*! @abstract The description associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *linkDescription; + +/*! @abstract The link to a thumbnail to associate with the post. Is only used + if the link is non-nil. Only "http" or "https" schemes are supported. Note that this + property should not be used to share photos; see the photos property. */ +@property (nonatomic, copy) NSURL *picture; + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract A text reference for the category of the post, used on Facebook + Insights. */ +@property (nonatomic, copy) NSString *ref; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! + @abstract Designated initializer + @param link the required link to share + @param name the optional name to describe the share + @param caption the optional caption to describe the share + @param description the optional description to describe the share + @param picture the optional url to use as the share's image +*/ +- (instancetype)initWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h new file mode 100644 index 0000000..ca797f9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginDialog.h @@ -0,0 +1,49 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#import "FBDialog.h" + +@protocol FBLoginDialogDelegate; + +/** + * Do not use this interface directly, instead, use authorize in Facebook.h + * + * Facebook Login Dialog interface for start the facebook webView login dialog. + * It start pop-ups prompting for credentials and permissions. + */ + +@interface FBLoginDialog : FBDialog + +- (instancetype)initWithURL:(NSString *)loginURL + loginParams:(NSMutableDictionary *)params + delegate:(id)loginDelegate; + +@property (nonatomic, assign) id loginDelegate; + +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@protocol FBLoginDialogDelegate + +- (void)fbDialogLogin:(NSString *)token expirationDate:(NSDate *)expirationDate params:(NSDictionary *)params; + +- (void)fbDialogNotLogin:(BOOL)cancelled; + +@end + + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h new file mode 100644 index 0000000..8f9fcbd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginTooltipView.h @@ -0,0 +1,92 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBTooltipView.h" + +@protocol FBLoginTooltipViewDelegate; + +/*! + @class FBLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBLoginView` may display this view automatically. If you do + not use the `FBLoginView`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBLoginTooltipViewDelegate` delegate. + + By default, the `FBLoginTooltipView` is not added to the superview until it is + determined the app has migrated to the new login experience. You can override this + (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. + + */ +@interface FBLoginTooltipView : FBTooltipView + +/*! @abstract the delegate */ +@property (nonatomic, assign) id delegate; + +/*! @abstract if set to YES, the view will always be displayed and the delegate's + `loginTooltipView:shouldAppear:` will NOT be called. */ +@property (nonatomic, assign) BOOL forceDisplay; + +@end + +/*! + @protocol + + @abstract + The `FBLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginTooltipView` objects. + */ +@protocol FBLoginTooltipViewDelegate + +@optional + +/*! + @abstract + Asks the delegate if the tooltip view should appear + + @param view The tooltip view. + @param appIsEligible The value fetched from the server identifying if the app + is eligible for the new login experience. + + @discussion Use this method to customize display behavior. + */ +- (BOOL)loginTooltipView:(FBLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; + +/*! + @abstract + Tells the delegate the tooltip view will appear, specifically after it's been + added to the super view but before the fade in animation. + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillAppear:(FBLoginTooltipView *)view; + +/*! + @abstract + Tells the delegate the tooltip view will not appear (i.e., was not + added to the super view). + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillNotAppear:(FBLoginTooltipView *)view; + + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h new file mode 100644 index 0000000..8e2ed93 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBLoginView.h @@ -0,0 +1,224 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBTooltipView.h" + +@protocol FBLoginViewDelegate; + +/*! + @typedef + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBLoginViewTooltipBehavior) { + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by server round trip) */ + FBLoginViewTooltipBehaviorDefault = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBLoginViewTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBLoginTooltipView` instance. */ + FBLoginViewTooltipBehaviorDisable = 2 +}; + +/*! + @class FBLoginView + @abstract FBLoginView is a custom UIView that renders a button to login or logout based on the + state of `FBSession.activeSession` + + @discussion This view is closely associated with `FBSession.activeSession`. Upon initialization, + it will attempt to open an active session without UI if the current active session is not open. + + The FBLoginView instance also monitors for changes to the active session. + + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@interface FBLoginView : UIView + +/*! + @abstract + The permissions to login with. Defaults to nil, meaning basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +@property (readwrite, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +/*! + @abstract + The login behavior for the active session if the user logs in via this view + + @discussion + The default value is FBSessionLoginBehaviorWithFallbackToWebView. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + +/*! + @abstract + Gets or sets the desired tooltip behavior. + */ +@property (nonatomic, assign) FBLoginViewTooltipBehavior tooltipBehavior; + +/*! + @abstract + Gets or sets the desired tooltip color style. + */ +@property (nonatomic, assign) FBTooltipColorStyle tooltipColorStyle; + +/*! + @abstract + Initializes and returns an `FBLoginView` object. The underlying session has basic permissions granted to it. + */ +- (instancetype)init; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +- (instancetype)initWithPermissions:(NSArray *)permissions __attribute__((deprecated)); + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + */ +- (instancetype)initWithReadPermissions:(NSArray *)readPermissions; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience An audience for published posts; note that FBSessionDefaultAudienceNone is not valid + for permission requests that include publish or manage permissions. + + */ +- (instancetype)initWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience; + +/*! + @abstract + The delegate object that receives updates for selection and display control. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +@end + +/*! + @protocol + + @abstract + The `FBLoginViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginView` objects. + + @discussion + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@protocol FBLoginViewDelegate + +@optional + +/*! + @abstract + Tells the delegate that the view is now in logged in mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that the view is has now fetched user info + + @param loginView The login view that transitioned its view mode + + @param user The user info object describing the logged in user + */ +- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView + user:(id)user; + +/*! + @abstract + Tells the delegate that the view is now in logged out mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that there is a communication or authorization error. + + @param loginView The login view that transitioned its view mode + @param error An error object containing details of the error. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginView:(FBLoginView *)loginView + handleError:(NSError *)error; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h new file mode 100644 index 0000000..ddf31a1 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBNativeDialogs.h @@ -0,0 +1,126 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +// note that the following class and types are deprecated in favor of FBDialogs and its methods + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Please note that this enum and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogResult` and its related methods. + */ +typedef NS_ENUM(NSUInteger, FBNativeDialogResult) { + /*! Indicates that the dialog action completed successfully. */ + FBNativeDialogResultSucceeded, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBNativeDialogResultCancelled, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBNativeDialogResultError +} +__attribute__((deprecated)); + +/*! + @typedef + + @abstract + Please note that `FBShareDialogHandler` and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogHandler` and its related methods. + */ +typedef void (^FBShareDialogHandler)(FBNativeDialogResult result, NSError *error) +__attribute__((deprecated)); + +/*! + @class FBNativeDialogs + + @abstract + Please note that `FBNativeDialogs` has been deprecated, please migrate your + code to use `FBDialogs`. + */ +@interface FBNativeDialogs : NSObject + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param initialText deprecated + @param image deprecated + @param url deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param initialText deprecated + @param images deprecated + @param urls deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param session deprecated + @param initialText deprecated + @param images deprecated + @param urls deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `canPresentOSIntegratedShareDialogWithSession`. + @param session deprecated + */ ++ (BOOL)canPresentShareDialogWithSession:(FBSession *)session __attribute__((deprecated)); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h new file mode 100644 index 0000000..2bf8334 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphAction.h @@ -0,0 +1,137 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +@protocol FBGraphPlace; +@protocol FBGraphUser; + +/*! + @protocol + + @abstract + The `FBOpenGraphAction` protocol is the base protocol for use in posting and retrieving Open Graph actions. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphAction` in order + implement typed access to your application's custom actions. + + @discussion + Represents an Open Graph custom action, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphAction + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the action's ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to action's start time + */ +@property (retain, nonatomic) NSString *start_time; + +/*! + @property + @abstract Typed access to action's end time + */ +@property (retain, nonatomic) NSString *end_time; + +/*! + @property + @abstract Typed access to action's publication time + */ +@property (retain, nonatomic) NSString *publish_time; + +/*! + @property + @abstract Typed access to action's creation time + */ +@property (retain, nonatomic) NSString *created_time; + +/*! + @property + @abstract Typed access to action's expiration time + */ +@property (retain, nonatomic) NSString *expires_time; + +/*! + @property + @abstract Typed access to action's ref + */ +@property (retain, nonatomic) NSString *ref; + +/*! + @property + @abstract Typed access to action's user message + */ +@property (retain, nonatomic) NSString *message; + +/*! + @property + @abstract Typed access to action's place + */ +@property (retain, nonatomic) id place; + +/*! + @property + @abstract Typed access to action's tags + */ +@property (retain, nonatomic) NSArray *tags; + +/*! + @property + @abstract Typed access to action's image(s) + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to action's from-user + */ +@property (retain, nonatomic) id from; + +/*! + @property + @abstract Typed access to action's likes + */ +@property (retain, nonatomic) NSArray *likes; + +/*! + @property + @abstract Typed access to action's application + */ +@property (retain, nonatomic) id application; + +/*! + @property + @abstract Typed access to action's comments + */ +@property (retain, nonatomic) NSArray *comments; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h new file mode 100644 index 0000000..b96ee0c --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionParams.h @@ -0,0 +1,54 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" +#import "FBOpenGraphAction.h" +#import "FBSDKMacros.h" + +FBSDK_EXTERN NSString *const FBPostObject; + +/*! + @class FBOpenGraphActionParams + + @abstract + This object is used to encapsulate state for parameters to an Open Graph share, + typically used with the Native Share Dialog or Message Dialog. + */ +@interface FBOpenGraphActionParams : FBDialogsParams + +/*! @abstract The Open Graph action to be published. */ +@property (nonatomic, retain) id action; + +/*! @abstract The name of the property representing the primary target of the Open + Graph action, which will be displayed as a preview in the dialog. */ +@property (nonatomic, copy) NSString *previewPropertyName; + +/*! @abstract The fully qualified type of the Open Graph action. */ +@property (nonatomic, copy) NSString *actionType; + +/*! + @abstract Designated initializer + @param action The action object, typically a dictionary based object created + from `[FBGraphObject openGraphActionForPost]`. + @param actionType The open graph action type defined in your application settings. + Typically, either a common open graph type like "books.reads", or a custom ":". + @param previewPropertyName The identifier for object in the open graph action. For example, for books.reads + this would be "book". +*/ +- (instancetype)initWithAction:(id)action actionType:(NSString *)actionType previewPropertyName:(NSString *)previewPropertyName; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h new file mode 100644 index 0000000..19f11a9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphActionShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBOpenGraphActionParams.h" + +/*! + @class FBOpenGraphActionShareDialogParams + + @abstract Deprecated. Use `FBOpenGraphActionParams` instead. + */ +__attribute__((deprecated)) +@interface FBOpenGraphActionShareDialogParams : FBOpenGraphActionParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h new file mode 100644 index 0000000..e6238ba --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBOpenGraphObject.h @@ -0,0 +1,87 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBOpenGraphObject` protocol is the base protocol for use in posting and retrieving Open Graph objects. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphObject` in order + implement typed access to your application's custom objects. + + @discussion + Represents an Open Graph custom object, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphObject + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the object's ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the object's type, which is a string in the form mynamespace:mytype + */ +@property (retain, nonatomic) NSString *type; + +/*! + @property + @abstract Typed access to object's title + */ +@property (retain, nonatomic) NSString *title; + +/*! + @property + @abstract Typed access to the object's image property + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to the object's url property + */ +@property (retain, nonatomic) id url; + +/*! + @abstract Typed access to the object's description property. + @discussion Note this typically refers to the "description" field of the graph object (i.e., equivalent + to `[self objectForKey:@"description"]`) but is differently named to avoid conflicting with Apple's + non-public selectors.*/ +@property (retain, nonatomic) id objectDescription; + +/*! + @property + @abstract Typed access to action's data, which is a dictionary of custom properties + */ +@property (retain, nonatomic) id data; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPeoplePickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPeoplePickerViewController.h new file mode 100644 index 0000000..f970163 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPeoplePickerViewController.h @@ -0,0 +1,96 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObjectPickerViewController.h" + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendSortOrdering) + + @abstract Indicates the order in which friends should be listed in the friend picker. + */ +typedef NS_ENUM(NSUInteger, FBFriendSortOrdering) { + /*! Sort friends by first, middle, last names. */ + FBFriendSortByFirstName = 0, + /*! Sort friends by last, first, middle names. */ + FBFriendSortByLastName +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendDisplayOrdering) + + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. + */ +typedef NS_ENUM(NSUInteger, FBFriendDisplayOrdering) { + /*! Display friends as First Middle Last. */ + FBFriendDisplayByFirstName = 0, + /*! Display friends as Last First Middle. */ + FBFriendDisplayByLastName, +}; + + +/*! + @class + + @abstract + The `FBPeoplePickerViewController` class is an abstract controller object that manages + the user interface for displaying and selecting people. + + @discussion + When the `FBPeoplePickerViewController` view loads it creates a `UITableView` object + where the people will be displayed. You can access this view through the `tableView` + property. The people display can be sorted by first name or last name. People's + names can be displayed with the first name first or the last name first. + + The `delegate` property may be set to an object that conforms to the + protocol, as defined by . The graph object passed to + the delegate conforms to the protocol. + */ +@interface FBPeoplePickerViewController : FBGraphObjectPickerViewController + +/*! + @abstract + A Boolean value that specifies whether multi-select is enabled. + */ +@property (nonatomic) BOOL allowsMultipleSelection; + +/*! + @abstract + The profile ID of the user whose 'user_friends' permission is being used. + */ +@property (nonatomic, copy) NSString *userID; + +/*! + @abstract + The list of people that are currently selected in the veiw. + The items in the array are objects. + */ +@property (nonatomic, copy, readonly) NSArray *selection; + +/*! + @abstract + The order in which people are sorted in the display. + */ +@property (nonatomic) FBFriendSortOrdering sortOrdering; + +/*! + @abstract + The order in which people's names are displayed. + */ +@property (nonatomic) FBFriendDisplayOrdering displayOrdering; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h new file mode 100644 index 0000000..4c389fd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPhotoParams.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBPhotoParams + + @abstract + This object is used to encapsulate state for parameters to share photos, + typically with the Facebook Native Share Dialog or Message Dialog + */ +@interface FBPhotoParams : FBDialogsParams + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! @abstract An array of UIImages representing photos to be shared. Only + six or fewer images are supported. */ +@property (nonatomic, copy) NSArray *photos; + +/*! @abstract Designated initializer. + @param photos the array of UIImages +*/ +- (instancetype)initWithPhotos:(NSArray *)photos; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h new file mode 100644 index 0000000..c8c0e04 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBPlacePickerViewController.h @@ -0,0 +1,183 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphObjectPickerViewController.h" +#import "FBGraphPlace.h" + +@protocol FBPlacePickerDelegate; + +/*! + @class FBPlacePickerViewController + + @abstract + The `FBPlacePickerViewController` class creates a controller object that manages + the user interface for displaying and selecting nearby places. + + @discussion + When the `FBPlacePickerViewController` view loads it creates a `UITableView` object + where the places near a given location will be displayed. You can access this view + through the `tableView` property. + + The place data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any place data requests will first check the cache and use that data. + If the place picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to place selection and + data changes. The delegate can also be used to filter the places to display in the + picker. + */ +@interface FBPlacePickerViewController : FBGraphObjectPickerViewController + +/*! + @abstract + The coordinates to use for place discovery. + */ +@property (nonatomic) CLLocationCoordinate2D locationCoordinate; + +/*! + @abstract + The radius to use for place discovery. + */ +@property (nonatomic) NSInteger radiusInMeters; + +/*! + @abstract + The maximum number of places to fetch. + */ +@property (nonatomic) NSInteger resultsLimit; + +/*! + @abstract + The search words used to narrow down the results returned. + */ +@property (nonatomic, copy) NSString *searchText; + +/*! + @abstract + The place that is currently selected in the view. This is nil + if nothing is selected. + */ +@property (nonatomic, retain, readonly) id selection; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the + `FBPlacePickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBPlacePickerViewController` + object. + + @param locationCoordinate The coordinates to use for place discovery. + @param radiusInMeters The radius to use for place discovery. + @param searchText The search words used to narrow down the results returned. + @param resultsLimit The maximum number of places to fetch. + @param fieldsForRequest Addtional fields to fetch when making the Graph API call to get place data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate + radiusInMeters:(NSInteger)radiusInMeters + searchText:(NSString *)searchText + resultsLimit:(NSInteger)resultsLimit + fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBPlacePickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + + The methods of correspond to . + If a pair of corresponding methods are implemented, the + method is called first. + */ +@protocol FBPlacePickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param placePicker The place picker view controller whose data changed. + */ +- (void)placePickerViewControllerDataDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param placePicker The place picker view controller whose selection changed. + */ +- (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Asks the delegate whether to include a place in the list. + + @discussion + This can be used to implement a search bar that filters the places list. + + If -[ graphObjectPickerViewController:shouldIncludeGraphObject:] + is implemented and returns NO, this method is not called. + + @param placePicker The place picker view controller that is requesting this information. + @param place An object representing the place. + */ +- (BOOL)placePickerViewController:(FBPlacePickerViewController *)placePicker + shouldIncludePlace:(id)place; + +/*! + @abstract + Called if there is a communication error. + + @param placePicker The place picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)placePickerViewController:(FBPlacePickerViewController *)placePicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h new file mode 100644 index 0000000..6ebdc52 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBProfilePictureView.h @@ -0,0 +1,76 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBProfilePictureCropping enum + + @abstract Specify the cropping treatment of the profile picture. + */ +typedef NS_ENUM(NSUInteger, FBProfilePictureCropping) { + + /*! Square (default) - the square version that the Facebook user defined. */ + FBProfilePictureCroppingSquare = 0, + + /*! Original - the original profile picture, as uploaded. */ + FBProfilePictureCroppingOriginal = 1 + +}; + +/*! + @class + @abstract + An instance of `FBProfilePictureView` is used to display a profile picture. + + The default behavior of this control is to center the profile picture + in the view and shrinks it, if necessary, to the view's bounds, preserving the aspect ratio. The smallest + possible image is downloaded to ensure that scaling up never happens. Resizing the view may result in + a different size of the image being loaded. Canonical image sizes are documented in the "Pictures" section + of https://developers.facebook.com/docs/reference/api. + */ +@interface FBProfilePictureView : UIView + +/*! + @abstract + The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + */ +@property (copy, nonatomic) NSString *profileID; + +/*! + @abstract + The cropping to use for the profile picture. + */ +@property (nonatomic) FBProfilePictureCropping pictureCropping; + +/*! + @abstract + Initializes and returns a profile view object. + */ +- (instancetype)init; + + +/*! + @abstract + Initializes and returns a profile view object for the given Facebook ID and cropping. + + @param profileID The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + @param pictureCropping The cropping to use for the profile picture. + */ +- (instancetype)initWithProfileID:(NSString *)profileID + pictureCropping:(FBProfilePictureCropping)pictureCropping; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h new file mode 100644 index 0000000..308c55d --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequest.h @@ -0,0 +1,662 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBOpenGraphAction.h" +#import "FBOpenGraphObject.h" +#import "FBRequestConnection.h" +#import "FBSDKMacros.h" + +/*! The base URL used for graph requests */ +FBSDK_EXTERN NSString *const FBGraphBasePath __attribute__((deprecated)); + +// up-front decl's +@protocol FBRequestDelegate; +@class FBSession; +@class UIImage; + +/*! + @typedef FBRequestState + + @abstract + Deprecated - do not use in new code. + + @discussion + FBRequestState is retained from earlier versions of the SDK to give existing + apps time to remove dependency on this. + + @deprecated + */ +typedef NSUInteger FBRequestState __attribute__((deprecated)); + +/*! + @class FBRequest + + @abstract + The `FBRequest` object is used to setup and manage requests to the Facebook Graph API. + This class provides helper methods that simplify the connection and response handling. + + @discussion + An object is required for all authenticated uses of `FBRequest`. + Requests that do not require an unauthenticated user are also supported and + do not require an object to be passed in. + + An instance of `FBRequest` represents the arguments and setup for a connection + to Facebook. After creating an `FBRequest` object it can be used to setup a + connection to Facebook through the object. The + object is created to manage a single connection. To + cancel a connection use the instance method in the class. + + An `FBRequest` object may be reused to issue multiple connections to Facebook. + However each instance will manage one connection. + + Class and instance methods prefixed with **start** can be used to perform the + request setup and initiate the connection in a single call. + + */ +@interface FBRequest : NSObject { +@private + id _delegate; + NSString * _url; + NSString * _versionPart; + NSURLConnection * _connection; + NSMutableData * _responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + FBRequestState _state; +#pragma GCC diagnostic pop + NSError * _error; + BOOL _sessionDidExpire; + id _graphObject; +} + +/*! + @methodgroup Creating a request + + @method + Calls with the default parameters. + */ +- (instancetype)init; + +/*! + @method + Calls with default parameters + except for the ones provided to this method. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Initializes an `FBRequest` object for a Graph API request call. + + @discussion + Note that this only sets properties on the `FBRequest` object. + + To send the request, initialize an object, add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a graph request. + + @discussion + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + */ +- (instancetype)initForPostWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @abstract + The parameters for the request. + + @discussion + May be used to read the parameters that were automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + `NSString` parameters are used to generate URL parameter values or JSON + parameters. `NSData` and `UIImage` parameters are added as attachments + to the HTTP body and referenced by name in the URL and/or JSON. + */ +@property (nonatomic, retain, readonly) NSMutableDictionary *parameters; + +/*! + @abstract + The session object to use for the request. + + @discussion + May be used to read the session that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The Graph API endpoint to use for the request, for example "me". + + @discussion + May be used to read the Graph API endpoint that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *graphPath; + +/*! + @abstract + The HTTPMethod to use for the request, for example "GET" or "POST". + + @discussion + May be used to read the HTTP method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *HTTPMethod; + +/*! + @abstract + The graph object to post with the request. + + @discussion + May be used to read the graph object that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) id graphObject; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + Overrides the default version for a single request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. Sometimes it is preferable to explicitly set the version for a request, which can be + accomplished in one of two ways. The first is to call this method and set an override version part. The second + is approach is to include the version part in the api path, for example @"v2.0/me/friends" + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Starts a connection to the Facebook API. + + @discussion + This is used to start an API call to Facebook and call the block when the + request completes with a success, error, or cancel. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + The handler will be invoked on the main thread. + */ +- (FBRequestConnection *)startWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @methodgroup FBRequestConnection start methods + + @abstract + These methods start an . + + @discussion + These methods simplify the process of preparing a request and starting + the connection. The methods handle initializing an `FBRequest` object, + initializing a object, adding the `FBRequest` + object to the to the , and finally starting the + connection. + */ + +/*! + @methodgroup FBRequest factory methods + + @abstract + These methods initialize a `FBRequest` for common scenarios. + + @discussion + These simplify the process of preparing a request to send. These + initialize a `FBRequest` based on strongly typed parameters that are + specific to the scenario. + + These method do not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + */ + +// request +// +// Summary: +// Helper methods used to create common request objects which can be used to create single or batch connections +// +// session: - the session object representing the identity of the +// Facebook user making the request; nil implies an +// unauthenticated request; default=nil + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me" endpoint, using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's identity. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an object representing the + user's identity. + + Note you may change the session property after construction if a session other than + the active session is preferred. + */ ++ (FBRequest *)requestForMe; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me/friends" endpoint using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's friends. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing the + user's friends. + */ ++ (FBRequest *)requestForMyFriends; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to upload a photo to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a photo. + + To post a photo to a specific album, get the `FBRequest` returned from this method + call, then modify the request parameters by adding the album ID to an "album" key. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param photo A `UIImage` for the photo to upload. + */ ++ (FBRequest *)requestForUploadPhoto:(UIImage *)photo; + +/*! + + @method + + @abstract + Creates a request representing a Graph API call to upload a video to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a video. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param filePath A `NSString` for the video file to upload. + */ ++ (FBRequest *)requestForUploadVideo:(NSString *)filePath; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies preparing a request to search for places near a coordinate. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing + the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + */ ++ (FBRequest *)requestForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText; + +/*! + @method + + @abstract + Creates a request representing the Graph API call to retrieve a Custom Audience "thirdy party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBRequest *)requestForCustomAudienceThirdPartyID:(FBSession *)session; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ ++ (FBRequest *)requestForGraphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Creates request representing a DELETE to a object. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object This can be an NSString, NSNumber or NSDictionary representing an object to delete + */ ++ (FBRequest *)requestForDeleteObject:(id)object; + +/*! + @method + + @abstract + Creates a request representing a POST for a graph object. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `requestForPostOpenGraphObject:` + */ ++ (FBRequest *)requestForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + */ ++ (FBRequest *)requestWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + */ ++ (FBRequest *)requestForPostOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description to be associated with the object. + @param objectProperties Any additional properties for the Open Graph object. + */ ++ (FBRequest *)requestForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to update the existing object with. + */ ++ (FBRequest *)requestForUpdateOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The updated description of the Open Graph object. + @param objectProperties Any additional properties to update for the Open Graph object. + */ ++ (FBRequest *)requestForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the image property for an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param image A `UIImage` for the image to upload. + */ ++ (FBRequest *)requestForUploadStagingResourceWithImage:(UIImage *)image; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h new file mode 100644 index 0000000..d7b7b03 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBRequestConnection.h @@ -0,0 +1,762 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBSDKMacros.h" + +// up-front decl's +@class FBRequest; +@class FBRequestConnection; +@class FBSession; +@class UIImage; + + +/*! + @attribute beta true + + @typedef FBRequestConnectionErrorBehavior enum + + @abstract Describes what automatic error handling behaviors to provide (if any). + + @discussion This is a bitflag enum that can be composed of different values. + + See FBError.h and FBErrorUtility.h for error category and user message details. + */ +typedef NS_OPTIONS(NSUInteger, FBRequestConnectionErrorBehavior) { + /*! The default behavior of none */ + FBRequestConnectionErrorBehaviorNone = 0, + + /*! This will retry any requests whose error category is classified as `FBErrorCategoryRetry`. + If the retry fails, the normal handler is invoked. */ + FBRequestConnectionErrorBehaviorRetry = 1, + + /*! This will automatically surface any SDK provided userMessage (at most one), after + retry attempts, but before any reconnects are tried. The alert will have one button + whose text can be localized with the key "FBE:AlertMessageButton". + + You should not display your own alert views in your request handler when specifying this + behavior. + */ + FBRequestConnectionErrorBehaviorAlertUser = 2, + + /*! This will automatically reconnect a session if the request failed due to an invalid token + that would otherwise close the session (such as an expired token or password change). Note + this will NOT reconnect a session if the user had uninstalled the app, or if the user had + disabled the app's slider in their privacy settings (in cases of iOS 6 system auth). + If the session is reconnected, this will transition the session state to FBSessionStateTokenExtended + which will invoke any state change handlers. Otherwise, the session is closed as normal. + + This behavior should not be used if the FBRequestConnection contains multiple + session instances. Further, when this behavior is used, you must not request new permissions + for the session until the connection is completed. + + Lastly, you should avoid using additional FBRequestConnections with the same session because + that will be subject to race conditions. + */ + FBRequestConnectionErrorBehaviorReconnectSession = 4, +}; + +/*! + Normally requests return JSON data that is parsed into a set of `NSDictionary` + and `NSArray` objects. + + When a request returns a non-JSON response, that response is packaged in + a `NSDictionary` using FBNonJSONResponseProperty as the key and the literal + response as the value. + */ +FBSDK_EXTERN NSString *const FBNonJSONResponseProperty; + +/*! + @typedef FBRequestHandler + + @abstract + A block that is passed to addRequest to register for a callback with the results of that + request once the connection completes. + + @discussion + Pass a block of this type when calling addRequest. This will be called once + the request completes. The call occurs on the UI thread. + + @param connection The `FBRequestConnection` that sent the request. + + @param result The result of the request. This is a translation of + JSON data to `NSDictionary` and `NSArray` objects. This + is nil if there was an error. + + @param error The `NSError` representing any error that occurred. + + */ +typedef void (^FBRequestHandler)(FBRequestConnection *connection, + id result, + NSError *error); + +/*! + @protocol + + @abstract + The `FBRequestConnectionDelegate` protocol defines the methods used to receive network + activity progress information from a . + */ +@protocol FBRequestConnectionDelegate + +@optional + +/*! + @method + + @abstract + Tells the delegate the request connection will begin loading + + @discussion + If the is created using one of the convenience factory methods prefixed with + start, the object returned from the convenience method has already begun loading and this method + will not be called when the delegate is set. + + @param connection The request connection that is starting a network request + @param isCached YES if the request can be fulfilled using cached data, otherwise NO indicating + the result will require a network request. + */ +- (void)requestConnectionWillBeginLoading:(FBRequestConnection *)connection + fromCache:(BOOL)isCached; + +/*! + @method + + @abstract + Tells the delegate the request connection finished loading + + @discussion + If the request connection completes without a network error occuring then this method is called. + Invocation of this method does not indicate success of every made, only that the + request connection has no further activity. Use the error argument passed to the FBRequestHandler + block to determine success or failure of each . + + This method is invoked after the completion handler for each . + + @param connection The request connection that successfully completed a network request + @param isCached YES if the request was fulfilled using cached data, otherwise NO indicating + a network request was completed. + */ +- (void)requestConnectionDidFinishLoading:(FBRequestConnection *)connection + fromCache:(BOOL)isCached; + +/*! + @method + + @abstract + Tells the delegate the request connection failed with an error + + @discussion + If the request connection fails with a network error then this method is called. The `error` + argument specifies why the network connection failed. The `NSError` object passed to the + FBRequestHandler block may contain additional information. + + This method is invoked after the completion handler for each and only if a network + request was made. If the request was fulfilled using cached data, this method is not called. + + @param connection The request connection that successfully completed a network request + @param error The `NSError` representing the network error that occurred, if any. May be nil + in some circumstances. Consult the `NSError` for the for reliable + failure information. + */ +- (void)requestConnection:(FBRequestConnection *)connection + didFailWithError:(NSError *)error; + +/*! + @method + + @abstract + Tells the delegate the request connection is going to retry some network operations + + @discussion + If some fail, may create a new instance to retry the failed + requests. This method is called before the new instance is started. You must set the delegate + property on `retryConnection` to continue to receive progress information. If a delegate is + set on `retryConnection` then -requestConnectionWillBeginLoading: will be invoked. + + This method is invoked after the completion handler for each and only if a network + request was made. If the request was fulfilled using cached data, this method is not called. + + @param connection The request connection that successfully completed a network request + @param retryConnection The new request connection that will retry the failed s + */ +- (void) requestConnection:(FBRequestConnection *)connection +willRetryWithRequestConnection:(FBRequestConnection *)retryConnection; + +/*! + @method + + @abstract + Tells the delegate how much data has been sent and is planned to send to the remote host + + @discussion + The byte count arguments refer to the aggregated objects, not a particular . + + Like `NSURLConnection`, the values may change in unexpected ways if data needs to be resent. + + @param connection The request connection transmitting data to a remote host + @param bytesWritten The number of bytes sent in the last transmission + @param totalBytesWritten The total number of bytes sent to the remote host + @param totalBytesExpectedToWrite The total number of bytes expected to send to the remote host + */ +- (void)requestConnection:(FBRequestConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; + +@end + +/*! + @class FBRequestConnection + + @abstract + The `FBRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBRequestConnection : NSObject + +/*! + @methodgroup Creating a request + */ + +/*! + @method + + Calls with a default timeout of 180 seconds. + */ +- (instancetype)init; + +/*! + @method + + @abstract + `FBRequestConnection` objects are used to issue one or more requests as a single + request/response connection with Facebook. + + @discussion + For a single request, the usual method for creating an `FBRequestConnection` + object is to call one of the **start* ** methods on . However, it is + allowable to init an `FBRequestConnection` object directly, and call + to add one or more request objects to the + connection, before calling start. + + Note that if requests are part of a batch, they must have an open + FBSession that has an access token associated with it. Alternatively a default App ID + must be set either in the plist or through an explicit call to <[FBSession defaultAppID]>. + + @param timeout The `NSTimeInterval` (seconds) to wait for a response before giving up. + */ + +- (instancetype)initWithTimeout:(NSTimeInterval)timeout; + +// properties + +/*! + @abstract + The request that will be sent to the server. + + @discussion + This property can be used to create a `NSURLRequest` without using + `FBRequestConnection` to send that request. It is legal to set this property + in which case the provided `NSMutableURLRequest` will be used instead. However, + the `NSMutableURLRequest` must result in an appropriate response. Furthermore, once + this property has been set, no more objects can be added to this + `FBRequestConnection`. + */ +@property (nonatomic, retain, readwrite) NSMutableURLRequest *urlRequest; + +/*! + @abstract + The raw response that was returned from the server. (readonly) + + @discussion + This property can be used to inspect HTTP headers that were returned from + the server. + + The property is nil until the request completes. If there was a response + then this property will be non-nil during the FBRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *urlResponse; + +/*! + @attribute beta true + + @abstract Set the automatic error handling behaviors. + @discussion This must be set before any requests are added. + + When using retry behaviors, note the FBRequestConnection instance + passed to the FBRequestHandler may be a different instance that the + one the requests were originally started on. + */ +@property (nonatomic, assign) FBRequestConnectionErrorBehavior errorBehavior; + +/*! + @abstract + The delegate object that receives updates. + */ +@property (nonatomic, assign) id delegate; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + + @param request A request to be included in the round-trip when start is called. + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + + @param name An optional name for this request. This can be used to feed + the results of one request to the input of another in the same + `FBRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + + @param batchParameters The optional dictionary of parameters to include for this request + as described in [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + Examples include "depends_on", "name", or "omit_response_on_success". + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion + Errors are reported via the handler callback, even in cases where no + communication is attempted by the implementation of `FBRequestConnection`. In + such cases multiple error conditions may apply, and if so the following + priority (highest to lowest) is used: + + - `FBRequestConnectionInvalidRequestKey` -- this error is reported when an + cannot be encoded for transmission. + + - `FBRequestConnectionInvalidBatchKey` -- this error is reported when any + request in the connection cannot be encoded for transmission with the batch. + In this scenario all requests fail. + + This method cannot be called twice for an `FBRequestConnection` instance. + */ +- (void)start; + +/*! + @method + + @abstract + Signals that a connection should be logically terminated as the + application is no longer interested in a response. + + @discussion + Synchronously calls any handlers indicating the request was cancelled. Cancel + does not guarantee that the request-related processing will cease. It + does promise that all handlers will complete before the cancel returns. A call to + cancel prior to a start implies a cancellation of all requests associated + with the connection. + */ +- (void)cancel; + +/*! + @method + + @abstract + Overrides the default version for a batch request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. If you want to override the version part while using batch requests on the connection, call + this method to set the version for the batch request. + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Simple method to make a graph API request for user info (/me), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMeWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request for user friends (/me/friends), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMyFriendsWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a photo. The request + uses the active session represented by `[FBSession activeSession]`. + + @param photo A `UIImage` for the photo to upload. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUploadPhoto:(UIImage *)photo + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies starting a request to search for places near a coordinate. + + This method creates the necessary object and initializes and + starts an object. A successful Graph API call will + return an array of objects representing the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the + radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForCustomAudienceThirdPartyID:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request, creates an object for HTTP GET, + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param graphPath The Graph API endpoint to use for the request, for example "me". + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to delete an object using the graph API, creates an object for + HTTP DELETE, then uses an object to start the connection with Facebook. + The request uses the active session represented by `[FBSession activeSession]`. + + @param object The object to delete, may be an NSString or NSNumber representing an fbid or an NSDictionary with an id property + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForDeleteObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to post an object using the graph API, creates an object for + HTTP POST, then uses to start a connection with Facebook. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `startForPostOpenGraphObject:completionHandler:` + */ ++ (FBRequestConnection *)startForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` object for a Graph API call, instantiate an + object, add the request to the newly created + connection and finally start the connection. Use this method for + specifying the request parameters and HTTP Method. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description for the object. + @param objectProperties Any additional properties for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to update the existing object with. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The object's description. + @param objectProperties Any additional properties to update for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request connection to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the value for the image property of an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call be creating the FBRequest + object and starting the request connection with a single method + + @param image A `UIImage` for the image to upload. + @param handler The handler block to call when the request completes. + */ ++ (FBRequestConnection *)startForUploadStagingResourceWithImage:(UIImage *)image + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h new file mode 100644 index 0000000..2faed4e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSDKMacros.h @@ -0,0 +1,25 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifdef __cplusplus +#define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define FBSDK_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define FBSDK_STATIC_INLINE static inline diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h new file mode 100644 index 0000000..870ab21 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSession.h @@ -0,0 +1,883 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import +#import + +#import "FBSDKMacros.h" + +// up-front decl's +@class FBAccessTokenData; +@class FBSession; +@class FBSessionTokenCachingStrategy; + +#define FB_SESSIONSTATETERMINALBIT (1 << 8) + +#define FB_SESSIONSTATEOPENBIT (1 << 9) + +/* + * Constants used by NSNotificationCenter for active session notification + */ + +/*! NSNotificationCenter name indicating that a new active session was set */ +FBSDK_EXTERN NSString *const FBSessionDidSetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that an active session was unset */ +FBSDK_EXTERN NSString *const FBSessionDidUnsetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that the active session is open */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeOpenActiveSessionNotification; + +/*! NSNotificationCenter name indicating that there is no longer an open active session */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeClosedActiveSessionNotification; + +/*! + @typedef FBSessionState enum + + @abstract Passed to handler block each time a session state changes + + @discussion A typical `FBSession` lifecycle will start with `FBSessionStateCreated`. If a cached + token is available, it will transition to `FBSessionStateCreatedTokenLoaded`. When attempting to + open a session, it will become `FBSessionStateCreatedOpening` internally before going to + `FBSessionStateOpen` or `FBSessionStateClosedLoginFailed`. From `FBSessionStateOpen` it can + go to `FBSessionStateOpenTokenExtended` (when more permissions were granted) or `FBSessionStateClosed`. + */ +typedef NS_ENUM(NSUInteger, FBSessionState) { + /*! One of two initial states indicating that no valid cached token was found */ + FBSessionStateCreated = 0, + /*! One of two initial session states indicating that a cached token was loaded; + when a session is in this state, a call to open* will result in an open session, + without UX or app-switching*/ + FBSessionStateCreatedTokenLoaded = 1, + /*! One of three pre-open session states indicating that an attempt to open the session + is underway*/ + FBSessionStateCreatedOpening = 2, + + /*! Open session state indicating user has logged in or a cached token is available */ + FBSessionStateOpen = 1 | FB_SESSIONSTATEOPENBIT, + /*! Open session state indicating token has been extended, or the user has granted additional permissions */ + FBSessionStateOpenTokenExtended = 2 | FB_SESSIONSTATEOPENBIT, + + /*! Closed session state indicating that a login attempt failed */ + FBSessionStateClosedLoginFailed = 1 | FB_SESSIONSTATETERMINALBIT, // NSError obj w/more info + /*! Closed session state indicating that the session was closed, but the users token + remains cached on the device for later use */ + FBSessionStateClosed = 2 | FB_SESSIONSTATETERMINALBIT, // " +}; + +/*! helper macro to test for states that imply an open session */ +#define FB_ISSESSIONOPENWITHSTATE(state) (0 != (state & FB_SESSIONSTATEOPENBIT)) + +/*! helper macro to test for states that are terminal */ +#define FB_ISSESSIONSTATETERMINAL(state) (0 != (state & FB_SESSIONSTATETERMINALBIT)) + +/*! + @typedef FBSessionLoginBehavior enum + + @abstract + Passed to open to indicate whether Facebook Login should allow for fallback to be attempted. + + @discussion + Facebook Login authorizes the application to act on behalf of the user, using the user's + Facebook account. Usually a Facebook Login will rely on an account maintained outside of + the application, by the native Facebook application, the browser, or perhaps the device + itself. This avoids the need for a user to enter their username and password directly, and + provides the most secure and lowest friction way for a user to authorize the application to + interact with Facebook. If a Facebook Login is not possible, a fallback Facebook Login may be + attempted, where the user is prompted to enter their credentials in a web-view hosted directly + by the application. + + The `FBSessionLoginBehavior` enum specifies whether to allow fallback, disallow fallback, or + force fallback login behavior. Most applications will use the default, which attempts a normal + Facebook Login, and only falls back if needed. In rare cases, it may be preferable to disallow + fallback Facebook Login completely, or to force a fallback login. + */ +typedef NS_ENUM(NSUInteger, FBSessionLoginBehavior) { + /*! Attempt Facebook Login, ask user for credentials if necessary */ + FBSessionLoginBehaviorWithFallbackToWebView = 0, + /*! Attempt Facebook Login, no direct request for credentials will be made */ + FBSessionLoginBehaviorWithNoFallbackToWebView = 1, + /*! Only attempt WebView Login; ask user for credentials */ + FBSessionLoginBehaviorForcingWebView = 2, + /*! Attempt Facebook Login, prefering system account and falling back to fast app switch if necessary */ + FBSessionLoginBehaviorUseSystemAccountIfPresent = 3, + /*! Attempt only to login with Safari */ + FBSessionLoginBehaviorForcingSafari = 4, +}; + +/*! + @typedef FBSessionDefaultAudience enum + + @abstract + Passed to open to indicate which default audience to use for sessions that post data to Facebook. + + @discussion + Certain operations such as publishing a status or publishing a photo require an audience. When the user + grants an application permission to perform a publish operation, a default audience is selected as the + publication ceiling for the application. This enumerated value allows the application to select which + audience to ask the user to grant publish permission for. + */ +typedef NS_ENUM(NSUInteger, FBSessionDefaultAudience) { + /*! No audience needed; this value is useful for cases where data will only be read from Facebook */ + FBSessionDefaultAudienceNone = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSessionDefaultAudienceOnlyMe = 10, + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSessionDefaultAudienceFriends = 20, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSessionDefaultAudienceEveryone = 30, +}; + +/*! + @typedef FBSessionLoginType enum + + @abstract + Used as the type of the loginType property in order to specify what underlying technology was used to + login the user. + + @discussion + The FBSession object is an abstraction over five distinct mechanisms. This enum allows an application + to test for the mechanism used by a particular instance of FBSession. Usually the mechanism used for a + given login does not matter, however for certain capabilities, the type of login can impact the behavior + of other Facebook functionality. + */ +typedef NS_ENUM(NSUInteger, FBSessionLoginType) { + /*! A login type has not yet been established */ + FBSessionLoginTypeNone = 0, + /*! A system integrated account was used to log the user into the application */ + FBSessionLoginTypeSystemAccount = 1, + /*! The Facebook native application was used to log the user into the application */ + FBSessionLoginTypeFacebookApplication = 2, + /*! Safari was used to log the user into the application */ + FBSessionLoginTypeFacebookViaSafari = 3, + /*! A web view was used to log the user into the application */ + FBSessionLoginTypeWebView = 4, + /*! A test user was used to create an open session */ + FBSessionLoginTypeTestUser = 5, +}; + +/*! + @typedef + + @abstract Block type used to define blocks called by for state updates + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionStateHandler)(FBSession *session, + FBSessionState status, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession requestNewReadPermissions:completionHandler:]> + and <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionRequestPermissionResultHandler)(FBSession *session, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession reauthorizeWithPermissions]>. + + @discussion You should use the preferred FBSessionRequestPermissionHandler typedef rather than + this synonym, which has been deprecated. + */ +typedef FBSessionRequestPermissionResultHandler FBSessionReauthorizeResultHandler __attribute__((deprecated)); + +/*! + @typedef + + @abstract Block type used to define blocks called for system credential renewals. + */ +typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewResult result, NSError *error) ; + +/*! + @class FBSession + + @abstract + The `FBSession` object is used to authenticate a user and manage the user's session. After + initializing a `FBSession` object the Facebook App ID and desired permissions are stored. + Opening the session will initiate the authentication flow after which a valid user session + should be available and subsequently cached. Closing the session can optionally clear the + cache. + + If an request requires user authorization then an `FBSession` object should be used. + + + @discussion + Instances of the `FBSession` class provide notification of state changes in the following ways: + + 1. Callers of certain `FBSession` methods may provide a block that will be called + back in the course of state transitions for the session (e.g. login or session closed). + + 2. The object supports Key-Value Observing (KVO) for property changes. + */ +@interface FBSession : NSObject + +/*! + @methodgroup Creating a session + */ + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with default values for the parameters + to . + */ +- (instancetype)init; + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with the specified permissions and other + default values for parameters to . + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + + */ +- (instancetype)initWithPermissions:(NSArray *)permissions; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param defaultAudience Most applications use FBSessionDefaultAudienceNone here, only specifying an audience when using reauthorize to request publish permissions. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. If publish permissions + are used, then the audience must also be specified. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +// instance readonly properties + +/*! @abstract Indicates whether the session is open and ready for use. */ +@property (readonly) BOOL isOpen; + +/*! @abstract Detailed session state */ +@property (readonly) FBSessionState state; + +/*! @abstract Identifies the Facebook app which the session object represents. */ +@property (readonly, copy) NSString *appID; + +/*! @abstract Identifies the URL Scheme Suffix used by the session. This is used when multiple iOS apps share a single Facebook app ID. */ +@property (readonly, copy) NSString *urlSchemeSuffix; + +/*! @abstract The access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSString *accessToken +__attribute__((deprecated)); + +/*! @abstract The expiration date of the access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSDate *expirationDate +__attribute__((deprecated)); + +/*! @abstract The permissions granted to the access token during the authentication flow. */ +@property (readonly, copy) NSArray *permissions; + +/*! @abstract Specifies the login type used to authenticate the user. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly) FBSessionLoginType loginType +__attribute__((deprecated)); + +/*! @abstract Gets the FBAccessTokenData for the session */ +@property (readonly, copy) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns a collection of permissions that have been declined by the user for this + given session instance. + + @discussion + A "declined" permission is one that had been requested but was either skipped or removed by + the user during the login flow. Note that once the permission has been granted (either by + requesting again or detected by a permissions refresh), it will be removed from this collection. + */ +@property (readonly, copy) NSArray *declinedPermissions; + +/*! + @abstract The presenting view controller passed to the `open...` methods + @discussion You can use this property to clear out weak references when they are no longer needed. + */ +@property (nonatomic, assign) UIViewController *fromViewController; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract Opens a session for the Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + Open may be called at most once and must be called after the `FBSession` is initialized. Open must + be called before the session is closed. Calling an open method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param handler A block to call with the state changes. The default is nil. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler fromViewController:(UIViewController *)fromViewController; + +/*! + @deprecated use openWithCompletionHandler:fromViewController: instead + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openWithCompletionHandler:fromViewController: instead"))); + + +/*! + @method + + @abstract Logs a user on to Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + The method may be called at most once and must be called after the `FBSession` is initialized. It must + be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param behavior Controls whether to allow, force, or prohibit Facebook Login or Inline Facebook Login. The default + is to allow Facebook Login, with fallback to Inline Facebook Login. + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler A block to call with session state changes. The default is nil. + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openWithBehavior:fromViewControllercompletionHandler instead + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openWithBehavior:fromViewControllercompletionHandler: instead"))); + +/*! + @method + + @abstract Imports an existing access token and opens the session with it. + + @discussion + The method attempts to open the session using an existing access token. No UX will occur. If + successful, the session with be in an Open state and the method will return YES; otherwise, NO. + + The method may be called at most once and must be called after the `FBSession` is initialized (see below). + It must be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + The initialized session must not have already been initialized from a cache (for example, you could use + the `[FBSessionTokenCachingStrategy nullCacheInstance]` instance). + + @param accessTokenData The token data. See `FBAccessTokenData` for construction methods. + @param handler A block to call with session state changes. The default is nil. + */ +- (BOOL)openFromAccessTokenData:(FBAccessTokenData *)accessTokenData completionHandler:(FBSessionStateHandler) handler; + +/*! + @abstract + Closes the local in-memory session object, but does not clear the persisted token cache. + */ +- (void)close; + +/*! + @abstract + Closes the in-memory session, and clears any persisted cache related to the session. + */ +- (void)closeAndClearTokenInformation; + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. The default is nil. + @param behavior Controls whether to allow, force, or prohibit Facebook Login. The default + is to allow Facebook Login and fall back to Inline Facebook Login if needed. + @param handler A block to call with session state changes. The default is nil. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred + (e.g. reauthorizeWithReadPermissions or reauthorizeWithPublishPermissions) + */ +- (void)reauthorizeWithPermissions:(NSArray *)permissions + behavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewReadPermissions:completionHandler:]>. Consider + using <[FBSession requestNewReadPermissions:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + Consider using <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Requests new or additional read permissions for the session. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + Requests new or additional write permissions for the session. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionRequestPermissionResultHandler)handler; +/*! + @abstract Refreshes the current permissions for the session. + @param handler Called after completion of the refresh. + @discussion This will update the sessions' permissions array from the server. This can be + useful if you want to make sure the local permissions are up to date. + */ +- (void)refreshPermissionsWithCompletionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked during + the Facebook Login flow and will update the session information based on the incoming URL. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + */ +- (BOOL)handleOpenURL:(NSURL *)url; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate applicationDidBecomeActive:] to properly resolve session state for + the Facebook Login flow, specifically to support app-switch login. + */ +- (void)handleDidBecomeActive; + +/*! + @abstract + Assign the block to be invoked for session state changes. + + @param stateChangeHandler the handler block. + + @discussion + This will overwrite any state change handler that was already assigned. Typically, + you should only use this setter if you were unable to assign a state change handler explicitly. + One example of this is if you are not opening the session (e.g., using the `open*`) + but still want to assign a `FBSessionStateHandler` block. This can happen when the SDK + opens a session from an app link. + */ +- (void)setStateChangeHandler:(FBSessionStateHandler)stateChangeHandler; + +/*! + @abstract + Returns true if the specified permission has been granted to this session. + + @param permission the permission to verify. + + @discussion + This is a convenience helper for checking if `pemission` is inside the permissions array. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @methodgroup Class methods + */ + +/*! + @abstract + This is the simplest method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + Note, if there is not a cached token available, this method will present UI to the user in order to + open the session via explicit login by the user. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be disirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @discussion + Returns YES if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI fromViewController:(UIViewController *)fromViewController; + +/*! + @deprecated use openActiveSessionWithAllowLoginUI:fromViewController: instead + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI +__attribute__ ((deprecated("use openActiveSessionWithAllowLoginUI:fromViewController: instead"))); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. A nil value specifies + default permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + It is required that initial permissions requests represent read-only permissions only. If publish + permissions are needed, you may use reauthorizeWithPermissions to specify additional permissions as + well as an audience. Use of this method will result in a legacy fast-app-switch Facebook Login due to + the requirement to separate read and publish permissions for newer applications. Methods and properties + that specify permissions without a read or publish qualification are deprecated; use of a read-qualified + or publish-qualified alternative is preferred. + */ ++ (BOOL)openActiveSessionWithPermissions:(NSArray *)permissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. It is not allowed to pass publish permissions to this method. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openActiveSessionWithReadPermissions:allowLoginUI:fromViewController:completionHandler: instead + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openActiveSessionWithReadPermissions:allowLoginUI:fromViewController:completionHandler: instead"))); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience Anytime an app publishes on behalf of a user, the post must have an audience (e.g. me, my friends, etc.) + The default audience is used to notify the user of the cieling that the user agrees to grant to the app for the provided permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openActiveSessionWithPublishPermissions:defaultAudience:allowLoginUI:fromViewController:completionHandler instead + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openActiveSessionWithPublishPermissions:defaultAudience:allowLoginUI:fromViewController:completionHandler: instead"))); + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @discussion + If sessionOpen* is called, the resulting `FBSession` object also becomes the activeSession. If another + session was active at the time, it is closed automatically. If activeSession is called when no session + is active, a session object is instatiated and returned; in this case open must be called on the session + in order for it to be useable for communication with Facebook. + */ ++ (FBSession *)activeSession; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @param session The FBSession object to become the active session + + @discussion + If an application prefers the flexibilility of directly instantiating a session object, an active + session can be set directly. + */ ++ (FBSession *)setActiveSession:(FBSession *)session; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultAppID]. + + @param appID The default Facebook App ID to use for methods. + */ ++ (void)setDefaultAppID:(NSString *)appID __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default Facebook App ID to use for sessions. If not explicitly + set, the default will be read from the application's plist. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultAppID]. + */ ++ (NSString *)defaultAppID __attribute__((deprecated)); + +/*! + @method + + @abstract Set the default url scheme suffix to use for sessions. The url + scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultUrlSchemeSuffix]. + + @param urlSchemeSuffix The default url scheme suffix to use for methods. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist. The + url scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultUrlSchemeSuffix]. + */ ++ (NSString *)defaultUrlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device Facebook account store. + + @param handler The completion handler to call when the renewal is completed. The handler will be + invoked on the main thread. + + @discussion This can be used to explicitly renew account credentials on iOS 6 devices and is provided + as a convenience wrapper around `[ACAccountStore renewCredentialsForAccount:completion]`. Note the + method will not issue the renewal call if the the Facebook account has not been set on the device, or + if access had not been granted to the account (though the handler wil receive an error). + + This is safe to call (and will surface an error to the handler) on versions of iOS before 6 or if the user + logged in via Safari or Facebook SSO. + */ ++ (void)renewSystemCredentials:(FBSessionRenewSystemCredentialsHandler)handler; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h new file mode 100644 index 0000000..2ba5ec8 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionManualTokenCachingStrategy.h @@ -0,0 +1,32 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSessionTokenCachingStrategy.h" + +// FBSessionManualTokenCachingStrategy +// +// Summary: +// Internal use only, this class enables migration logic for the Facebook class, by providing +// a means to directly provide the access token to a FBSession object +// +@interface FBSessionManualTokenCachingStrategy : FBSessionTokenCachingStrategy + +// set the properties before instantiating the FBSession object in order to seed a token +@property (readwrite, copy) NSString *accessToken; +@property (readwrite, copy) NSDate *expirationDate; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h new file mode 100644 index 0000000..f70b61e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSessionTokenCachingStrategy.h @@ -0,0 +1,167 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBSDKMacros.h" + +/*! + @class + + @abstract + The `FBSessionTokenCachingStrategy` class is responsible for persisting and retrieving cached data related to + an object, including the user's Facebook access token. + + @discussion + `FBSessionTokenCachingStrategy` is designed to be instantiated directly or used as a base class. Usually default + token caching behavior is sufficient, and you do not need to interface directly with `FBSessionTokenCachingStrategy` objects. + However, if you need to control where or how `FBSession` information is cached, then you may take one of two approaches. + + The first and simplest approach is to instantiate an instance of `FBSessionTokenCachingStrategy`, and then pass + the instance to `FBSession` class' `init` method. This enables your application to control the key name used in + the iOS Keychain to store session information. You may consider this approach if you plan to cache session information + for multiple users. + + The second and more advanced approached is to derive a custom class from `FBSessionTokenCachingStrategy`, which will + be responsible for caching behavior of your application. This approach is useful if you need to change where the + information is cached, for example if you prefer to use the filesystem or make a network connection to fetch and + persist cached tokens. Inheritors should override the cacheTokenInformation, fetchTokenInformation, and clearToken methods. + Doing this enables your application to implement any token caching scheme, including no caching at all (see + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Direct use of `FBSessionTokenCachingStrategy`is an advanced technique. Most applications use objects without + passing an `FBSessionTokenCachingStrategy`, which yields default caching to the iOS Keychain. + */ +@interface FBSessionTokenCachingStrategy : NSObject + +/*! + @abstract Initializes and returns an instance + */ +- (instancetype)init; + +/*! + @abstract + Initializes and returns an instance + + @param tokenInformationKeyName Specifies a key name to use for cached token information in the iOS Keychain, nil + indicates a default value of @"FBAccessTokenInformationKey" + */ +- (instancetype)initWithUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract + Called by (and overridden by inheritors), in order to cache token information. + + @param tokenInformation Dictionary containing token information to be cached by the method + @discussion You should favor overriding this instead of `cacheFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + */ +- (void)cacheTokenInformation:(NSDictionary *)tokenInformation; + +/*! + @abstract Cache the supplied token. + @param accessToken The token instance. + @discussion This essentially wraps a call to `cacheTokenInformation` so you should + override this when providing a custom token caching strategy. + */ +- (void)cacheFBAccessTokenData:(FBAccessTokenData *)accessToken; + +/*! + @abstract + Called by (and overridden by inheritors), in order to fetch cached token information + + @discussion + An overriding implementation should only return a token if it + can also return an expiration date, otherwise return nil. + You should favor overriding this instead of `fetchFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + + */ +- (NSDictionary *)fetchTokenInformation; + +/*! + @abstract + Fetches the cached token instance. + + @discussion + This essentially wraps a call to `fetchTokenInformation` so you should + override this when providing a custom token caching strategy. + + In order for an `FBSession` instance to be able to use a cached token, + the token must be not be expired (see `+isValidTokenInformation:`) and + must also contain all permissions in the initialized session instance. + */ +- (FBAccessTokenData *)fetchFBAccessTokenData; + +/*! + @abstract + Called by (and overridden by inheritors), in order delete any cached information for the current token + */ +- (void)clearToken; + +/*! + @abstract + Helper function called by the SDK as well as apps, in order to fetch the default strategy instance. + */ ++ (FBSessionTokenCachingStrategy *)defaultInstance; + +/*! + @abstract + Helper function to return a FBSessionTokenCachingStrategy instance that does not perform any caching. + */ ++ (FBSessionTokenCachingStrategy *)nullCacheInstance; + +/*! + @abstract + Helper function called by the SDK as well as application code, used to determine whether a given dictionary + contains the minimum token information usable by the . + + @param tokenInformation Dictionary containing token information to be validated + */ ++ (BOOL)isValidTokenInformation:(NSDictionary *)tokenInformation; + +@end + +// The key to use with token information dictionaries to get and set the token value +FBSDK_EXTERN NSString *const FBTokenInformationTokenKey; + +// The to use with token information dictionaries to get and set the expiration date +FBSDK_EXTERN NSString *const FBTokenInformationExpirationDateKey; + +// The to use with token information dictionaries to get and set the refresh date +FBSDK_EXTERN NSString *const FBTokenInformationRefreshDateKey; + +// The key to use with token information dictionaries to get the related user's fbid +FBSDK_EXTERN NSString *const FBTokenInformationUserFBIDKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via Facebook Login +FBSDK_EXTERN NSString *const FBTokenInformationIsFacebookLoginKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via the OS +FBSDK_EXTERN NSString *const FBTokenInformationLoginTypeLoginKey; + +// The key to use with token information dictionaries to get the latest known permissions +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the latest known declined permissions +FBSDK_EXTERN NSString *const FBTokenInformationDeclinedPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsRefreshDateKey; + +// The key to use with token information dictionaries to get the id of the creator app +FBSDK_EXTERN NSString *const FBTokenInformationAppIDKey; diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h new file mode 100644 index 0000000..7e40343 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBSettings.h @@ -0,0 +1,308 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +/* + * Constants defining logging behavior. Use with <[FBSettings setLoggingBehavior]>. + */ + +/*! Log requests from FBRequest* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBRequests; + +/*! Log requests from FBURLConnection* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBURLConnections; + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAccessTokens; + +/*! Log session state transitions. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorSessionStateTransitions; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBAppEvents interactions */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorCacheErrors; + +/*! Log errors from SDK UI controls */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorUIControlErrors; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorDeveloperErrors; + +/*! + @typedef + + @abstract A list of beta features that can be enabled for the SDK. Beta features are for evaluation only, + and are therefore only enabled for DEBUG builds. Beta features should not be enabled + in release builds. + */ +typedef NS_ENUM(NSUInteger, FBBetaFeatures) { + /*! Default value indicating no beta features */ + FBBetaFeaturesNone = 0, +}; + +/*! + @typedef + + @abstract Indicates if this app should be restricted + */ +typedef NS_ENUM(NSUInteger, FBRestrictedTreatment) { + /*! The default treatment indicating the app is not restricted. */ + FBRestrictedTreatmentNO = 0, + + /*! Indicates the app is restricted. */ + FBRestrictedTreatmentYES = 1 +}; + +/*! + @class FBSettings + + @abstract Allows configuration of SDK behavior. +*/ +@interface FBSettings : NSObject + +/*! + @method + + @abstract Retrieve the current iOS SDK version. + + */ ++ (NSString *)sdkVersion; + +/*! + @method + + @abstract Retrieve the current Facebook SDK logging behavior. + + */ ++ (NSSet *)loggingBehavior; + +/*! + @method + + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBLogBehavior*, and can be constructed with, e.g., [NSSet initWithObjects:]. + + @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging + behavior is reset to the default set of enabled behaviors. Set in an empty set in order to disable all logging. + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! + @method + + @abstract + This method is deprecated -- App Events favors using bundle identifiers to this. + */ ++ (NSString *)appVersion __attribute__ ((deprecated("App Events favors use of bundle identifiers for version identification."))); + +/*! + @method + + @abstract + This method is deprecated -- App Events favors using bundle identifiers to this. + @param appVersion deprecated + */ ++ (void)setAppVersion:(NSString *)appVersion __attribute__ ((deprecated("App Events favors use of bundle identifiers for version identification."))); + +/*! + @method + + @abstract Retrieve the Client Token that has been set via [FBSettings setClientToken] + */ ++ (NSString *)clientToken; + +/*! + @method + + @abstract Sets the Client Token for the Facebook App. This is needed for certain API calls when made anonymously, + without a user-based Session. + + @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + section of the Advanced tab of the Facebook App settings found at + + */ ++ (void)setClientToken:(NSString *)clientToken; + +/*! + @method + + @abstract Set the default Facebook Display Name to be used by the SDK. This should match + the Display Name that has been set for the app with the corresponding Facebook App ID, in + the Facebook App Dashboard + + @param displayName The default Facebook Display Name to be used by the SDK. + */ ++ (void)setDefaultDisplayName:(NSString *)displayName; + +/*! + @method + + @abstract Get the default Facebook Display Name used by the SDK. If not explicitly + set, the default will be read from the application's plist. + */ ++ (NSString *)defaultDisplayName; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + + @param appID The default Facebook App ID to be used by the SDK. + */ ++ (void)setDefaultAppID:(NSString *)appID; + +/*! + @method + + @abstract Get the default Facebook App ID used by the SDK. If not explicitly + set, the default will be read from the application's plist. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + */ ++ (NSString *)defaultAppID; + +/*! + @method + + @abstract Set the default url scheme suffix used by the SDK. + + @param urlSchemeSuffix The default url scheme suffix to be used by the SDK. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist value for 'FacebookUrlSchemeSuffix'. + */ ++ (NSString *)defaultUrlSchemeSuffix; + +/*! + @method + + @abstract Set the bundle name from the SDK will try and load overrides of images and text + + @param bundleName The name of the bundle (MyFBBundle). + */ ++ (void)setResourceBundleName:(NSString *)bundleName; + +/*! + @method + + @abstract Get the name of the bundle to override the SDK images and text + */ ++ (NSString *)resourceBundleName; + +/*! + @method + + @abstract Set the subpart of the facebook domain (e.g. @"beta") so that requests will be sent to graph.beta.facebook.com + + @param facebookDomainPart The domain part to be inserted into facebook.com + */ ++ (void)setFacebookDomainPart:(NSString *)facebookDomainPart; + +/*! + @method + + @abstract Get the Facebook domain part + */ ++ (NSString *)facebookDomainPart; + +/*! + @method + + @abstract Enables the specified beta features. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeatures The beta features to enable (expects a bitwise OR of FBBetaFeatures) + */ ++ (void)enableBetaFeatures:(NSUInteger)betaFeatures; + +/*! + @method + + @abstract Enables a beta feature. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeature The beta feature to enable. + */ ++ (void)enableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Disables a beta feature. + + @param betaFeature The beta feature to disable. + */ ++ (void)disableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Determines whether a beta feature is enabled or not. + + @param betaFeature The beta feature to check. + + @return YES if the beta feature is enabled, NO if not. + */ ++ (BOOL)isBetaFeatureEnabled:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract + Gets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + */ ++ (BOOL)limitEventAndDataUsage; + +/*! + @method + + @abstract + Sets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + + @param limitEventAndDataUsage The desired value. + */ ++ (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; + +/*! + @deprecated legacy Graph API 1.0 has been deprecated. This will always return NO. +*/ ++ (BOOL)isPlatformCompatibilityEnabled __attribute__ ((deprecated("legacy Graph API 1.0 has been deprecated. This will always return NO."))); + +/*! + @deprecated legacy Graph API 1.0 has been deprecated. This will be a no-op. +*/ ++ (void)enablePlatformCompatibility:(BOOL)enable __attribute__ ((deprecated("legacy Graph API 1.0 has been deprecated. This will be a no-op."))); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h new file mode 100644 index 0000000..7b828a8 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBLinkShareParams.h" + +/*! + @class FBShareDialogParams + + @abstract Deprecated. Use `FBLinkShareParams` instead. + */ +__attribute__((deprecated)) +@interface FBShareDialogParams : FBLinkShareParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h new file mode 100644 index 0000000..a7f0b75 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBShareDialogPhotoParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPhotoParams.h" + +/*! + @class FBShareDialogPhotoParams + + @abstract Deprecated. Use `FBPhotoParams` instead. +*/ +__attribute__((deprecated)) +@interface FBShareDialogPhotoParams : FBPhotoParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTaggableFriendPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTaggableFriendPickerViewController.h new file mode 100644 index 0000000..a6f314a --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTaggableFriendPickerViewController.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPeoplePickerViewController.h" + +/*! + @class + + @abstract + The `FBTaggableFriendPickerViewController` class creates a controller object that + manages the user interface for displaying and selecting taggable Facebook friends. + + @discussion + When the `FBTaggableFriendPickerViewController` view loads it creates a `UITableView` + object where the taggable friends will be displayed. You can access this view through + the `tableView` property. The taggalb e friend display can be sorted by first name or + last name. Taggable friends' names can be displayed with the first name first or the + last name first. + + The `FBTaggableFriendPickerViewController` does not support the `fieldsForRequest` + property, as there are no other fields that may be requested from the Graph API. + + The `delegate` property may be set to an object that conforms to the + protocol. The graph object passed to the delegate conforms to the protocol. + */ +@interface FBTaggableFriendPickerViewController : FBPeoplePickerViewController + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h new file mode 100644 index 0000000..74ba8a7 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestSession.h @@ -0,0 +1,145 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSession.h" + +#import "FBSDKMacros.h" + +#if defined(DEBUG) && !defined(SAFE_TO_USE_FBTESTSESSION) +#define SAFE_TO_USE_FBTESTSESSION +#endif + +#if !defined(SAFE_TO_USE_FBTESTSESSION) +#pragma message ("warning: using FBTestSession, which is designed for unit-testing uses only, in non-DEBUG code -- ensure this is what you really want") +#endif + +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a second unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kSecondTestUserTag; +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a third unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kThirdTestUserTag; + +/*! + @class FBTestSession + + @abstract Deprecated in favor of `FBTestUserSession` + and `FBTestUsersManager` + + @discussion + Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing unit tests. It is not designed for use in + production application code. + + The main use case for this class is using sessionForUnitTestingWithPermissions:mode: + to create a session for a test user. Two modes are supported. In "shared" mode, an attempt + is made to find an existing test user that has the required permissions and, if it is not + currently in use by another FBTestSession, just use that user. If no such user is available, + a new one is created with the required permissions. In "private" mode, designed for + scenarios which require a new user in a known clean state, a new test user will always be + created, and it will be automatically deleted when the FBTestSession is closed. + + Note that the shared test user functionality depends on a naming convention for the test users. + It is important that any testing of functionality which will mutate the permissions for a + test user NOT use a shared test user, or this scheme will break down. If a shared test user + seems to be in an invalid state, it can be deleted manually via the Web interface at + https://developers.facebook.com/apps/APP_ID/permissions?role=test+users. + */ +__attribute__ ((deprecated("use FBTestUsersManager and FBTestUserSession instead"))) +@interface FBTestSession : FBSession + +/// The app access token (composed of app ID and secret) to use for accessing test users. +@property (readonly, copy) NSString *appAccessToken; +/// The ID of the test user associated with this session. +@property (readonly, copy) NSString *testUserID; +/// The name of the test user associated with this session. +@property (readonly, copy) NSString *testUserName; +/// The App ID of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppID; +/// The App Secret of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppSecret; +/*! + @abstract Flag to disable reuathorize calls. + @discussion + Defaults to NO. If set to YES, reauthorize calls will fail with a nil token + as if the user had cancelled it reauthorize. +*/ +@property (assign) BOOL disableReauthorize; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). Calling this method multiple times may return sessions with the same user. If this is not + desired, use the variant sessionWithSharedUserWithPermissions:uniqueUserTag:. + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + + @param uniqueUserTag a string which will be used to make this user unique among other + users with the same permissions. Useful for tests which require two or more users to interact + with each other, and which therefore must have sessions associated with different users. For + this case, consider using kSecondTestUserTag and kThirdTestUserTag so these users can be shared + with other, similar, tests. + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions + uniqueUserTag:(NSString *)uniqueUserTag; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which creates a test user on open, and destroys the user on + close; This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithPrivateUserWithPermissions:(NSArray *)permissions; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUserSession.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUserSession.h new file mode 100644 index 0000000..c659550 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUserSession.h @@ -0,0 +1,55 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBAccessTokenData.h" +#import "FBSession.h" + +/*! + @class FBTestUserSession + @abstract a "headless" (no UI) `FBSession` subclass that requires a token and is used for testing. + + @discussion This will generally be used with `FBTestUsersManager` to help exercise + integration tests with Facebook. Use the class method `sessionWithAccessTokenData:` to construct + instances. + + Note the supplied token data is not read until the session instance is "opened" (i.e., it will + never be in a "TokenLoaded" state) and uses + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Furthermore, reauthorization calls will succeed as a no-op (no new permissions added). You may toggle + the `treatReauthorizeAsCancellation` property to get cancellation treatment. +*/ +@interface FBTestUserSession : FBSession + +/*! + @abstract returns an instance + @discussion This should be used in place of any init methods. +*/ ++ (instancetype)sessionWithAccessTokenData:(FBAccessTokenData *)tokenData; + +/*! + @abstract Flag to treat reauthorize calls as cancelled. + @discussion + Defaults to NO. If set to YES, reauthorize calls will receive a nil token + as if the user had cancelled the reauthorize. + */ +@property (nonatomic, assign) BOOL treatReauthorizeAsCancellation; + +/*! + @abstract Flag to force extending a token expiration at the next opportunity. +*/ +@property (nonatomic, assign) BOOL forceAccessTokenExtension; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUsersManager.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUsersManager.h new file mode 100644 index 0000000..7b6ad73 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTestUsersManager.h @@ -0,0 +1,88 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBAccessTokenData; + +/*! + @typedef + + @abstract Callback block for returning an array of `FBAccessTokenData` (and possibly `NSNull` instances); or an error. + */ +typedef void (^FBTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; + +/*! + @typedef + + @abstract Callback block for removing a test user. + */ +typedef void (^FBTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; + + +/*! + @class FBTestUsersManager + @abstract Provides methods for managing test accounts for testing Facebook integration. + + @discussion Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing tests. It is not designed for use in + production application code. + + This class will make Graph API calls on behalf of your app to manage test accounts and requires + an app id and app secret. You will typically use this class to write unit or integration tests. + Make sure you NEVER include your app secret in your production app. +*/ +@interface FBTestUsersManager : NSObject + +/*! + @abstract construct or return the shared instance + @param appId the Facebook app id + @param appSecret the Facebook app secret +*/ ++ (instancetype)sharedInstanceForAppId:(NSString *)appId appSecret:(NSString *)appSecret; + +/*! + @abstract retrieve `FBAccessTokenData` instances for test accounts with the specific permissions. + @param arraysOfPermissions an array of permissions arrays, such as @[ @[@"email"], @[@"user_birthday"]] + if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested arrays + such as @[ @[], @[] ] if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ @[] ] + for fetching a single test user. + @param createIfNotFound if YES, new test accounts are created if no test accounts existed that fit the permissions + requirement + @param handler the callback to invoke which will return an array of `FBAccessTokenData` instances or an `NSError`. + If param `createIfNotFound` is NO, the array may contain `[NSNull null]` instances. + + @discussion If you are requesting test accounts with differing number of permissions, try to order + `arrayOfPermissionsArrays` so that the most number of permissions come first to minimize creation of new + test accounts. + */ +- (void)requestTestAccountTokensWithArraysOfPermissions:(NSArray *)arraysOfPermissions + createIfNotFound:(BOOL)createIfNotFound + completionHandler:(FBTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract add a test account with the specified permissions +*/ +- (void)addTestAccountWithPermissions:(NSArray *)permissions + completionHandler:(FBTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract remove a test account for the given user id +*/ +- (void)removeTestAccount:(NSString *)userId completionHandler:(FBTestUsersManagerRemoveTestAccountHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h new file mode 100644 index 0000000..4a92bf9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBTooltipView.h @@ -0,0 +1,137 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBTooltipViewArrowDirection) { + /*! View is located above given point, arrow is pointing down. */ + FBTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBTooltipColorStyle) { + /*! Light blue background, white text, faded blue close button. */ + FBTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBTooltipView + + @abstract + Tooltip bubble with text in it used to display tips for UI elements, + with a pointed arrow (to refer to the UI element). + + @discussion + The tooltip fades in and will automatically fade out. See `displayDuration`. + */ +@interface FBTooltipView : UIView + +/*! + @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. + + @discussion Set this to zero to make the display permanent until explicitly dismissed. + Defaults to six seconds. +*/ +@property (nonatomic, assign) CFTimeInterval displayDuration; + +/*! + @abstract Gets or sets the color style after initialization. + + @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. + */ +@property (nonatomic, assign) FBTooltipColorStyle colorStyle; + +/*! + @abstract Gets or sets the message. +*/ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). +*/ +@property (nonatomic, copy) NSString *tagline; + +/*! + @abstract + Designated initializer. + + @param tagline First part of the label, that will be highlighted with different color. Can be nil. + + @param message Main message to display. + + @param colorStyle Color style to use for tooltip. + + @discussion + If you need to show a tooltip for login, consider using the `FBLoginTooltipView` view. + + @see FBLoginTooltipView + */ +- (id)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBTooltipColorStyle)colorStyle; + +/*! + @abstract + Show tooltip at the top or at the bottom of given view. + Tooltip will be added to anchorView.window.rootViewController.view + + @param anchorView view to show at, must be already added to window view hierarchy, in order to decide + where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - + tooltip will be shown at the bottom of it) + + @discussion + Use this method to present the tooltip with automatic positioning or + use -presentInView:withArrowPosition:direction: for manual positioning + If anchorView is nil or has no window - this method does nothing. + */ +- (void)presentFromView:(UIView *)anchorView; + +/*! + @abstract + Adds tooltip to given view, with given position and arrow direction. + + @param view View to be used as superview. + + @param arrowPosition Point in view's cordinates, where arrow will be pointing + + @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or + down (message bubble is above the arrow). + */ +- (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBTooltipViewArrowDirection)arrowDirection; + +/*! + @abstract + Remove tooltip manually. + + @discussion + Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. + */ +- (void)dismiss; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h new file mode 100644 index 0000000..5df08e7 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBUserSettingsViewController.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" +#import "FBViewController.h" + +/*! + @protocol + + @abstract + The `FBUserSettingsDelegate` protocol defines the methods called by a . + */ +@protocol FBUserSettingsDelegate + +@optional + +/*! + @abstract + Called when the view controller will log the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillLogUserOut:(id)sender; + +/*! + @abstract + Called after the view controller logged the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserOut:(id)sender; + +/*! + @abstract + Called when the view controller will log the user in in response to a button press. + Note that logging in can fail for a number of reasons, so there is no guarantee that this + will be followed by a call to loginViewControllerDidLogUserIn:. Callers wanting more granular + notification of the session state changes can use KVO or the NSNotificationCenter to observe them. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillAttemptToLogUserIn:(id)sender; + +/*! + @abstract + Called after the view controller successfully logged the user in in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserIn:(id)sender; + +/*! + @abstract + Called if the view controller encounters an error while trying to log a user in. + + @param sender The view controller sending the message. + @param error The error encountered. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginViewController:(id)sender receivedError:(NSError *)error; + +@end + + +/*! + @class FBUserSettingsViewController + + @abstract + The `FBUserSettingsViewController` class provides a user interface exposing a user's + Facebook-related settings. Currently, this is limited to whether they are logged in or out + of Facebook. + + Because of the size of some graphics used in this view, its resources are packaged as a separate + bundle. In order to use `FBUserSettingsViewController`, drag the `FBUserSettingsViewResources.bundle` + from the SDK directory into your Xcode project. + */ +@interface FBUserSettingsViewController : FBViewController + +/*! + @abstract + The permissions to request if the user logs in via this view. + */ +@property (nonatomic, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h new file mode 100644 index 0000000..fa33d21 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBViewController.h @@ -0,0 +1,118 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBViewController; + +/*! + @typedef FBModalCompletionHandler + + @abstract + A block that is passed to [FBViewController presentModallyInViewController:animated:handler:] + and called when the view controller is dismissed via either Done or Cancel. + + @param sender The that is being dismissed. + + @param donePressed If YES, Done was pressed. If NO, Cancel was pressed. + */ +typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePressed); + +/*! + @protocol + + @abstract + The `FBViewControllerDelegate` protocol defines the methods called when the Cancel or Done + buttons are pressed in a . + */ +@protocol FBViewControllerDelegate + +@optional + +/*! + @abstract + Called when the Cancel button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerCancelWasPressed:(id)sender; + +/*! + @abstract + Called when the Done button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerDoneWasPressed:(id)sender; + +@end + + +/*! + @class FBViewController + + @abstract + The `FBViewController` class is a base class encapsulating functionality common to several + other view controller classes. Specifically, it provides UI when a view controller is presented + modally, in the form of optional Cancel and Done buttons. + */ +@interface FBViewController : UIViewController + +/*! + @abstract + The Cancel button to display when presented modally. If nil, no Cancel button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *cancelButton; + +/*! + @abstract + The Done button to display when presented modally. If nil, no Done button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *doneButton; + +/*! + @abstract + The delegate that will be called when Cancel or Done is pressed. Derived classes may specify + derived types for their delegates that provide additional functionality. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +/*! + @abstract + The view into which derived classes should put their subviews. This view will be resized correctly + depending on whether or not a toolbar is displayed. + */ +@property (nonatomic, readonly, retain) UIView *canvasView; + +/*! + @abstract + Provides a wrapper that presents the view controller modally and automatically dismisses it + when either the Done or Cancel button is pressed. + + @param viewController The view controller that is presenting this view controller. + @param animated If YES, presenting and dismissing the view controller is animated. + @param handler The block called when the Done or Cancel button is pressed. + */ +- (void)presentModallyFromViewController:(UIViewController *)viewController + animated:(BOOL)animated + handler:(FBModalCompletionHandler)handler; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h new file mode 100644 index 0000000..5fdcedd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FBWebDialogs.h @@ -0,0 +1,236 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBFrictionlessRecipientCache; +@class FBSession; +@protocol FBWebDialogsDelegate; + +/*! + @typedef NS_ENUM (NSUInteger, FBWebDialogResult) + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + + @discussion Note `FBWebDialogResultDialogCompleted` is also used for cancelled operations. +*/ +typedef NS_ENUM(NSUInteger, FBWebDialogResult) { + /*! Indicates that the dialog action completed successfully. Note, that cancel operations represent completed dialog operations. + The url argument may be used to distinguish between success and user-cancelled cases */ + FBWebDialogResultDialogCompleted = 0, + /*! Indicates that the dialog operation was not completed. This occurs in cases such as the closure of the web-view using the X in the upper left corner. */ + FBWebDialogResultDialogNotCompleted +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the web dialog + being dismissed + */ +typedef void (^FBWebDialogHandler)( + FBWebDialogResult result, + NSURL *resultURL, + NSError *error); + +/*! + @class FBWebDialogs + + @abstract + Provides methods to display web based dialogs to the user. +*/ +@interface FBWebDialogs : NSObject + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + + @param delegate An optional delegate to allow for advanced processing of web based + dialogs. See 'FBWebDialogsDelegate' for more details. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + delegate:(id)delegate; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + + @param friendCache An optional cache object used to enable frictionless sharing for a known set of friends. The + cache instance should be preserved for the life of the session and reused for multiple calls to the present method. + As the users set of friends enabled for frictionless sharing changes, this method auto-updates the cache. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + friendCache:(FBFrictionlessRecipientCache *)friendCache; + +/*! + @abstract + Presents a Facebook feed dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentFeedDialogModallyWithSession:(FBSession *)session + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +@end + +/*! + @protocol + + @abstract + The `FBWebDialogsDelegate` protocol enables the plugging of advanced behaviors into + the presentation flow of a Facebook web dialog. Advanced uses include modification + of parameters and application-level handling of links on the dialog. The + `FBFrictionlessRequestFriendCache` class implements this protocol to add frictionless + behaviors to a presentation of the request dialog. + */ +@protocol FBWebDialogsDelegate + +@optional + +/*! + @abstract + Called prior to the presentation of a web dialog + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A mutable dictionary of parameters which will be sent to the dialog. + + @param session The session object to use with the dialog. + */ +- (void)webDialogsWillPresentDialog:(NSString *)dialog + parameters:(NSMutableDictionary *)parameters + session:(FBSession *)session; + +/*! + @abstract + Called when the user of a dialog clicks a link that would cause a transition away from the application. + Your application may handle this method, and return NO if the URL handling will be performed by the application. + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param url The url in question, which will not be handled by the SDK if this method NO + */ +- (BOOL)webDialogsDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + shouldAutoHandleURL:(NSURL *)url; + +/*! + @abstract + Called when the dialog is about to be dismissed + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param result A pointer to a result, which may be read or changed by the handling method as needed + + @param url A pointer to a pointer to a URL representing the URL returned by the dialog, which may be read or changed by this mehthod + + @param error A pointer to a pointer to an error object which may be read or changed by this method as needed + */ +- (void)webDialogsWillDismissDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + result:(FBWebDialogResult *)result + url:(NSURL **)url + error:(NSError **)error; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h new file mode 100644 index 0000000..b8c8922 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/Facebook.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBFrictionlessRequestSettings.h" +#import "FBLoginDialog.h" +#import "FBRequest.h" +#import "FBSessionManualTokenCachingStrategy.h" +#import "FacebookSDK.h" + +//////////////////////////////////////////////////////////////////////////////// +// deprecated API +// +// Summary +// The classes, protocols, etc. in this header are provided for backward +// compatibility and migration; for new code, use FacebookSDK.h, and/or the +// public headers that it imports; for existing code under active development, +// Facebook.h imports FacebookSDK.h, and updates should favor the new interfaces +// whenever possible + +// up-front decl's +@class FBFrictionlessRequestSettings; +@protocol FBRequestDelegate; +@protocol FBSessionDelegate; + +/** + * Main Facebook interface for interacting with the Facebook developer API. + * Provides methods to log in and log out a user, make requests using the REST + * and Graph APIs, and start user interface interactions (such as + * pop-ups promoting for credentials, permissions, stream posts, etc.) + */ +@interface Facebook : NSObject + +@property (nonatomic, copy) NSString *accessToken; +@property (nonatomic, copy) NSDate *expirationDate; +@property (nonatomic, assign) id sessionDelegate; +@property (nonatomic, copy) NSString *urlSchemeSuffix; +@property (nonatomic, readonly) BOOL isFrictionlessRequestsEnabled; +@property (nonatomic, readonly, retain) FBSession *session; + +- (instancetype)initWithAppId:(NSString *)appId + andDelegate:(id)delegate; + +- (instancetype)initWithAppId:(NSString *)appId + urlSchemeSuffix:(NSString *)urlSchemeSuffix + andDelegate:(id)delegate; + +- (void)authorize:(NSArray *)permissions; + +- (void)extendAccessToken; + +- (void)extendAccessTokenIfNeeded; + +- (BOOL)shouldExtendAccessToken; + +- (BOOL)handleOpenURL:(NSURL *)url; + +- (void)logout; + +- (void)logout:(id)delegate; + +- (FBRequest *)requestWithParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (FBRequest *)requestWithMethodName:(NSString *)methodName + andParams:(NSMutableDictionary *)params + andHttpMethod:(NSString *)httpMethod + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (FBRequest *)requestWithGraphPath:(NSString *)graphPath + andParams:(NSMutableDictionary *)params + andHttpMethod:(NSString *)httpMethod + andDelegate:(id)delegate; + +- (void)dialog:(NSString *)action + andDelegate:(id)delegate; + +- (void)dialog:(NSString *)action + andParams:(NSMutableDictionary *)params + andDelegate:(id)delegate; + +- (BOOL)isSessionValid; + +- (void)enableFrictionlessRequests; + +- (void)reloadFrictionlessRecipientCache; + +- (BOOL)isFrictionlessEnabledForRecipient:(id)fbid; + +- (BOOL)isFrictionlessEnabledForRecipients:(NSArray *)fbids; + +@end + +//////////////////////////////////////////////////////////////////////////////// + +/** + * Your application should implement this delegate to receive session callbacks. + */ +@protocol FBSessionDelegate + +/** + * Called when the user successfully logged in. + */ +- (void)fbDidLogin; + +/** + * Called when the user dismissed the dialog without logging in. + */ +- (void)fbDidNotLogin:(BOOL)cancelled; + +/** + * Called after the access token was extended. If your application has any + * references to the previous access token (for example, if your application + * stores the previous access token in persistent storage), your application + * should overwrite the old access token with the new one in this method. + * See extendAccessToken for more details. + */ +- (void)fbDidExtendToken:(NSString *)accessToken + expiresAt:(NSDate *)expiresAt; + +/** + * Called when the user logged out. + */ +- (void)fbDidLogout; + +/** + * Called when the current session has expired. This might happen when: + * - the access token expired + * - the app has been disabled + * - the user revoked the app's permissions + * - the user changed his or her password + */ +- (void)fbSessionInvalidated; + +@end + +@protocol FBRequestDelegate; + +enum { + kFBRequestStateReady, + kFBRequestStateLoading, + kFBRequestStateComplete, + kFBRequestStateError +}; + +// FBRequest(Deprecated) +// +// Summary +// The deprecated category is used to maintain back compat and ease migration +// to the revised SDK for iOS + +/** + * Do not use this interface directly, instead, use method in Facebook.h + */ +@interface FBRequest (Deprecated) + +@property (nonatomic, assign) id delegate; + +/** + * The URL which will be contacted to execute the request. + */ +@property (nonatomic, copy) NSString *url; + +/** + * The API method which will be called. + */ +@property (nonatomic, copy) NSString *httpMethod; + +/** + * The dictionary of parameters to pass to the method. + * + * These values in the dictionary will be converted to strings using the + * standard Objective-C object-to-string conversion facilities. + */ +@property (nonatomic, retain) NSMutableDictionary *params; +@property (nonatomic, retain) NSURLConnection *connection; +@property (nonatomic, retain) NSMutableData *responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +@property (nonatomic) FBRequestState state; +#pragma GCC diagnostic pop +@property (nonatomic) BOOL sessionDidExpire; + +/** + * Error returned by the server in case of request's failure (or nil otherwise). + */ +@property (nonatomic, retain) NSError *error; + +- (BOOL)loading; + ++ (NSString *)serializeURL:(NSString *)baseUrl + params:(NSDictionary *)params; + ++ (NSString *)serializeURL:(NSString *)baseUrl + params:(NSDictionary *)params + httpMethod:(NSString *)httpMethod; + +@end + +//////////////////////////////////////////////////////////////////////////////// + +/* + *Your application should implement this delegate + */ +@protocol FBRequestDelegate + +@optional + +/** + * Called just before the request is sent to the server. + */ +- (void)requestLoading:(FBRequest *)request; + +/** + * Called when the Facebook API request has returned a response. + * + * This callback gives you access to the raw response. It's called before + * (void)request:(FBRequest *)request didLoad:(id)result, + * which is passed the parsed response object. + */ +- (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response; + +/** + * Called when an error prevents the request from completing successfully. + */ +- (void)request:(FBRequest *)request didFailWithError:(NSError *)error; + +/** + * Called when a request returns and its response has been parsed into + * an object. + * + * The resulting object may be a dictionary, an array or a string, depending + * on the format of the API response. If you need access to the raw response, + * use: + * + * (void)request:(FBRequest *)request + * didReceiveResponse:(NSURLResponse *)response + */ +- (void)request:(FBRequest *)request didLoad:(id)result; + +/** + * Called when a request returns a response. + * + * The result object is the raw response from the server of type NSData + */ +- (void)request:(FBRequest *)request didLoadRawResponse:(NSData *)data; + +@end + + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h new file mode 100644 index 0000000..c3033e2 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/FacebookSDK.h @@ -0,0 +1,143 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// core +#import "FBAccessTokenData.h" +#import "FBAppCall.h" +#import "FBAppEvents.h" +#import "FBCacheDescriptor.h" +#import "FBDialogs.h" +#import "FBError.h" +#import "FBErrorUtility.h" +#import "FBFrictionlessRecipientCache.h" +#import "FBFriendPickerViewController.h" +#import "FBGraphLocation.h" +#import "FBGraphObject.h" // + design summary for graph component-group +#import "FBGraphPlace.h" +#import "FBGraphUser.h" +#import "FBInsights.h" +#import "FBLikeControl.h" +#import "FBLoginView.h" +#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h +#import "FBOpenGraphAction.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBOpenGraphObject.h" +#import "FBPlacePickerViewController.h" +#import "FBProfilePictureView.h" +#import "FBRequest.h" +#import "FBSession.h" +#import "FBSessionTokenCachingStrategy.h" +#import "FBSettings.h" +#import "FBShareDialogParams.h" +#import "FBShareDialogPhotoParams.h" +#import "FBTaggableFriendPickerViewController.h" +#import "FBUserSettingsViewController.h" +#import "FBWebDialogs.h" +#import "NSError+FBError.h" + +/*! + @header + + @abstract Library header, import this to import all of the public types + in the Facebook SDK + + @discussion + +//////////////////////////////////////////////////////////////////////////////// + + + Summary: this header summarizes the structure and goals of the Facebook SDK for iOS. + Goals: + * Leverage and work well with modern features of iOS (e.g. blocks, ARC, etc.) + * Patterned after best of breed iOS frameworks (e.g. naming, pattern-use, etc.) + * Common integration experience is simple & easy to describe + * Factored to enable a growing list of scenarios over time + + Notes on approaches: + 1. We use a key scenario to drive prioritization of work for a given update + 2. We are building-atop and refactoring, rather than replacing, existing iOS SDK releases + 3. We use take an incremental approach where we can choose to maintain as little or as much compatibility with the existing SDK needed + a) and so we will be developing to this approach + b) and then at push-time for a release we will decide when/what to break + on a feature by feature basis + 4. Some light but critical infrastructure is needed to support both the goals + and the execution of this change (e.g. a build/package/deploy process) + + Design points: + We will move to a more object-oriented approach, in order to facilitate the + addition of a different class of objects, such as controls and visual helpers + (e.g. FBLikeView, FBPersonView), as well as sub-frameworks to enable scenarios + such (e.g. FBOpenGraphEntity, FBLocalEntityCache, etc.) + + As we add features, it will no longer be appropriate to host all functionality + in the Facebook class, though it will be maintained for some time for migration + purposes. Instead functionality lives in related collections of classes. + +
+ @textblock
+
+               *------------* *----------*  *----------------* *---*
+  Scenario --> |FBPersonView| |FBLikeView|  | FBPlacePicker  | | F |
+               *------------* *----------*  *----------------* | a |
+               *-------------------*  *----------*  *--------* | c |
+ Component --> |   FBGraphObject   |  | FBDialog |  | FBView | | e |
+               *-------------------*  *----------*  *--------* | b |
+               *---------* *---------* *---------------------* | o |
+      Core --> |FBSession| |FBRequest| |Utilities (e.g. JSON)| | o |
+               *---------* *---------* *---------------------* * k *
+
+ @/textblock
+ 
+ + The figure above describes three layers of functionality, with the existing + Facebook on the side as a helper proxy to a subset of the overall SDK. The + layers loosely organize the SDK into *Core Objects* necessary to interface + with Facebook, higher-level *Framework Components* that feel like natural + extensions to existing frameworks such as UIKit and Foundation, but which + surface behavior broadly applicable to Facebook, and finally the + *Scenario Objects*, which provide deeper turn-key capibilities for useful + mobile scenarios. + + Use example (low barrier use case): + +
+ @textblock
+
+// log on to Facebook
+[FBSession sessionOpenWithPermissions:nil
+                    completionHandler:^(FBSession *session,
+                                        FBSessionState status,
+                                        NSError *error) {
+                        if (session.isOpen) {
+                            // request basic information for the user
+                            [FBRequestConnection startWithGraphPath:@"me"
+                                                  completionHandler:^void(FBRequestConnection *request,
+                                                                          id result,
+                                                                          NSError *error) {
+                                                      if (!error) {
+                                                          // get json from result
+                                                      }
+                                                  }];
+                        }
+                    }];
+ @/textblock
+ 
+ + */ + +#define FB_IOS_SDK_VERSION_STRING @"3.24.0" +#define FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2" + diff --git a/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h new file mode 100644 index 0000000..686b4ca --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/DeprecatedHeaders/NSError+FBError.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @category NSError(FBError) + + @abstract + Adds additional properties to NSError to provide more information for Facebook related errors. + */ +@interface NSError (FBError) + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) FBErrorCategory fberrorCategory; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the Facebook operation. + + @discussion + In general if fberrorShouldNotifyUser is NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) BOOL fberrorShouldNotifyUser; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + + @see +[FBErrorUtility userMessageForError:] + */ +@property (readonly, copy) NSString *fberrorUserMessage; + +/*! + @abstract + A short summary of this error suitable for display to the user. + Not all Facebook errors yield a message/title suitable for user display; + However in all cases when title is available, user should be notified. + + @see +[FBErrorUtility userTitleForError:] + */ +@property (readonly, copy) NSString *fberrorUserTitle; + +/*! + @abstract + YES if this error is transient and may succeed if the initial action is retried as-is. + Application may use this information to display a "Retry" button, if user should be notified about this error. + */ +@property (readonly) BOOL fberrorIsTransient; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/FacebookSDK b/Vendor/FacebookSDK.framework/Versions/A/FacebookSDK new file mode 100644 index 0000000..4c8f31f Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/FacebookSDK differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h new file mode 100644 index 0000000..2c6c98a --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAccessTokenData.h @@ -0,0 +1,203 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class FBAccessTokenData + + @abstract Represents an access token used for the Facebook login flow + and includes associated metadata such as expiration date and permissions. + You should use factory methods (createToken...) to construct instances + and should be treated as immutable. + + @discussion For more information, see + https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/. + */ +@interface FBAccessTokenData : NSObject + +/*! + @method + + @abstract Creates an FBAccessTokenData from an App Link provided by the Facebook application + or nil if the url is not valid. + + @param url The url provided. + @param appID needed in order to verify URL format. + @param urlSchemeSuffix needed in order to verify URL format. + + */ ++ (FBAccessTokenData *)createTokenFromFacebookURL:(NSURL *)url appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Creates an FBAccessTokenData from a dictionary or returns nil if required data is missing. + @param dictionary the dictionary with FBSessionTokenCachingStrategy keys. + */ ++ (FBAccessTokenData *)createTokenFromDictionary:(NSDictionary *)dictionary; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate; + +/*! + @method + + @abstract Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + @param appID The ID string of the calling app. A value of nil defaults to `[FBSettings defaultAppID]`. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate + appID:(NSString *)appID; + +/*! + @method + + @abstract Designated factory method. + Creates an FBAccessTokenData from existing information or returns nil if required data is missing. + + @param accessToken The token string. If nil or empty, this method will return nil. + @param permissions The permissions set. A value of nil indicates basic permissions. + @param declinedPermissions The declined permissions set. A value of nil indicates empty array. + @param expirationDate The expiration date. A value of nil defaults to `[NSDate distantFuture]`. + @param loginType The login source of the token. + @param refreshDate The date that token was last refreshed. A value of nil defaults to `[NSDate date]`. + @param permissionsRefreshDate The date the permissions were last refreshed. A value of nil defaults to `[NSDate distantPast]`. + @param appID The ID string of the calling app. A value of nil defaults to `[FBSettings defaultAppID]`. + @param userID The user ID associated with the token. + */ ++ (FBAccessTokenData *)createTokenFromString:(NSString *)accessToken + permissions:(NSArray *)permissions + declinedPermissions:(NSArray *)declinedPermissions + expirationDate:(NSDate *)expirationDate + loginType:(FBSessionLoginType)loginType + refreshDate:(NSDate *)refreshDate + permissionsRefreshDate:(NSDate *)permissionsRefreshDate + appID:(NSString *)appID + userID:(NSString *)userID; + +/*! + @method + + @abstract Returns a dictionary representation of this instance. + + @discussion This is provided for backwards compatibility with previous + access token related APIs that used a NSDictionary (see `FBSessionTokenCachingStrategy`). + */ +- (NSMutableDictionary *)dictionary; + +/*! + @method + + @abstract Returns a Boolean value that indicates whether a given object is an FBAccessTokenData object and exactly equal the receiver. + + @param accessTokenData the data to compare to the receiver. + */ +- (BOOL)isEqualToAccessTokenData:(FBAccessTokenData *)accessTokenData; + +/*! + @abstract returns the access token NSString. + */ +@property (readonly, nonatomic, copy) NSString *accessToken; + +/*! + @abstract returns the app ID NSString. + */ +@property (readonly, nonatomic, copy) NSString *appID; + +/*! + @abstract returns the user ID NSString that is associated with the token,if available. + @discussion This may not be populated for login behaviours such as the iOS system account. + */ +@property (readonly, nonatomic, copy) NSString *userID; + +/*! + @abstract returns the permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *permissions; + +/*! + @abstract returns the declined permissions associated with the access token. + */ +@property (readonly, nonatomic, copy) NSArray *declinedPermissions; + +/*! + @abstract returns the expiration date of the access token. + */ +@property (readonly, nonatomic, copy) NSDate *expirationDate; + +/*! + @abstract returns the login type associated with the token. + */ +@property (readonly, nonatomic) FBSessionLoginType loginType; + +/*! + @abstract returns the date the token was last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *refreshDate; + +/*! + @abstract returns the date the permissions were last refreshed. + */ +@property (readonly, nonatomic, copy) NSDate *permissionsRefreshDate; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h new file mode 100644 index 0000000..4a74fb9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppCall.h @@ -0,0 +1,232 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAccessTokenData.h" +#import "FBAppLinkData.h" +#import "FBDialogsData.h" +#import "FBSession.h" + +@class FBAppCall; + +/*! + @typedef FBAppCallHandler + + @abstract + A block that is passed to performAppCall to register for a callback with the results + of that AppCall + + @discussion + Pass a block of this type when calling performAppCall. This will be called on the UI + thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + */ +typedef void (^FBAppCallHandler)(FBAppCall *call); + +/*! + @typedef FBAppLinkFallbackHandler + + @abstract + See `+openDeferredAppLink`. + */ +typedef void (^FBAppLinkFallbackHandler)(NSError *error); + +/*! + @class FBAppCall + + @abstract + The FBAppCall object is used to encapsulate state when the app performs an + action that requires switching over to the native Facebook app, or when the app + receives an App Link. + + @discussion + - Each FBAppCall instance will have a unique ID + - This object is passed into an FBAppCallHandler for context + - dialogData will be present if this AppCall is for a Native Dialog + - appLinkData will be present if this AppCall is for an App Link + - accessTokenData will be present if this AppCall contains an access token. + */ +@interface FBAppCall : NSObject + +/*! @abstract The ID of this FBAppCall instance */ +@property (nonatomic, readonly) NSString *ID; + +/*! @abstract Error that occurred in processing this AppCall */ +@property (nonatomic, readonly) NSError *error; + +/*! @abstract Data related to a Dialog AppCall */ +@property (nonatomic, readonly) FBDialogsData *dialogData; + +/*! @abstract Data for native app link */ +@property (nonatomic, readonly) FBAppLinkData *appLinkData; + +/*! @abstract Access Token that was returned in this AppCall */ +@property (nonatomic, readonly) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns an FBAppCall instance from a url, if applicable. Otherwise, returns nil. + + @param url The url. + + @return an FBAppCall instance if the url is valid; nil otherwise. + + @discussion This is typically used for App Link URLs. + */ ++ (FBAppCall *)appCallFromURL:(NSURL *)url; + +/*! + @abstract + Compares the receiving FBAppCall to the passed in FBAppCall + + @param appCall the other FBAppCall to compare to. + + @return YES if the AppCalls can be considered to be the same; NO if otherwise. + */ +- (BOOL)isEqualToAppCall:(FBAppCall *)appCall; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:openURL:sourceApplication:annotation:] method + of the AppDelegate for your app. It should be invoked for the proper processing of responses during interaction + with the native Facebook app or as part of SSO authorization flow. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param sourceApplication The sourceApplication as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @param session If this url is being sent back to this app as part of SSO authorization flow, then pass in the + session that was being opened. A nil value defaults to FBSession.activeSession + + @param handler Optional handler that gives the app the opportunity to do some further processing on urls + that the SDK could not completely process. A fallback handler is not a requirement for such a url to be considered + handled. The fallback handler, if specified, is only ever called sychronously, before the method returns. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ ++ (BOOL)handleOpenURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + withSession:(FBSession *)session + fallbackHandler:(FBAppCallHandler)handler; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or pending login flow for the + FBSession.activeSession. If any pending FBAppCalls are found, their registered callbacks + will be invoked with appropriate state + */ ++ (void)handleDidBecomeActive; + +/*! + @abstract + Call this method when the application's applicationDidBecomeActive: is invoked. + This ensures proper state management of any pending FBAppCalls or a pending open for the + passed in FBSession. If any pending FBAppCalls are found, their registered callbacks will + be invoked with appropriate state + + @param session Session that is currently being used. Any pending calls to open will be cancelled. + If no session is provided, then the activeSession (if present) is used. + */ ++ (void)handleDidBecomeActiveWithSession:(FBSession *)session; + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data. This may require + a network round trip. If successful, [+UIApplication openURL:] is invoked with the link + data. Otherwise, the fallbackHandler will be dispatched to the main thread. + + @param fallbackHandler the handler to be invoked if applink data could not be opened. + + @discussion the fallbackHandler may contain an NSError instance to capture any errors. In the + common case where there simply was no app link data, the NSError instance will be nil. + + This method should only be called from a location that occurs after any launching URL has + been processed (e.g., you should call this method from your application delegate's applicationDidBecomeActive:) + to avoid duplicate invocations of openURL:. + + If you must call this from the delegate's didFinishLaunchingWithOptions: you should + only do so if the application is not being launched by a URL. For example, + + if (launchOptions[UIApplicationLaunchOptionsURLKey] == nil) { + [FBAppCall openDeferredAppLink:^(NSError *error) { + // .... + } + } + */ ++ (void)openDeferredAppLink:(FBAppLinkFallbackHandler)fallbackHandler; +@end + + + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h new file mode 100644 index 0000000..90d67db --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppEvents.h @@ -0,0 +1,492 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + + @typedef NS_ENUM (NSUInteger, FBAppEventsFlushBehavior) + + @abstract Specifies when `FBAppEvents` sends log events to the server. + + */ +typedef NS_ENUM(NSUInteger, FBAppEventsFlushBehavior) { + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBAppEventsFlushBehaviorAuto = 0, + + /*! Only flush when the `flush` method is called. When an app is moved to background/terminated, the + events are persisted and re-established at activation, but they will only be written with an + explicit call to `flush`. */ + FBAppEventsFlushBehaviorExplicitOnly, + +}; + +/* + * Constant used by NSNotificationCenter for results of flushing AppEvents event logs + */ + +/*! NSNotificationCenter name indicating a result of a failed log flush attempt */ +FBSDK_EXTERN NSString *const FBAppEventsLoggingResultNotification; + + +// Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBAppEvents`. +// Common event parameters are provided in the `FBAppEventsParameterNames*` constants. + +// General purpose + +/*! Deprecated: use [FBAppEvents activateApp] instead. */ +FBSDK_EXTERN NSString *const FBAppEventNameActivatedApp __attribute__ ((deprecated("use [FBAppEvents activateApp] instead"))); + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedRegistration; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameViewedContent; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameSearched; + +/*! Log this event when the user has rated an item in the app. The valueToSum passed to logEvent should be the numeric rating. */ +FBSDK_EXTERN NSString *const FBAppEventNameRated; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameCompletedTutorial; + +// Ecommerce related + +/*! Log this event when the user has added an item to their cart. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToCart; + +/*! Log this event when the user has added an item to their wishlist. The valueToSum passed to logEvent should be the item's price. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedToWishlist; + +/*! Log this event when the user has entered the checkout process. The valueToSum passed to logEvent should be the total price in the cart. */ +FBSDK_EXTERN NSString *const FBAppEventNameInitiatedCheckout; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBAppEventNameAddedPaymentInfo; + +/*! Deprecated: use [FBAppEvents logPurchase:currency:] or [FBAppEvents logPurchase:currency:parameters:] instead */ +FBSDK_EXTERN NSString *const FBAppEventNamePurchased __attribute__ ((deprecated("use [FBAppEvents logPurchase:currency:] or [FBAppEvents logPurchase:currency:parameters:] instead"))); + +// Gaming related + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameAchievedLevel; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBAppEventNameUnlockedAchievement; + +/*! Log this event when the user has spent app credits. The valueToSum passed to logEvent should be the number of credits spent. */ +FBSDK_EXTERN NSString *const FBAppEventNameSpentCredits; + + + +// Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + +/*! Parameter key used to specify currency used with logged event. E.g. "USD", "EUR", "GBP". See ISO-4217 for specific values. One reference for these is . */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameCurrency; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify a generic content type/family for the logged event, e.g. "music", "photo", "video". Options to use will vary based upon what the app is all about. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentType; + +/*! Parameter key used to specify an ID for the specific piece of content being logged about. Could be an EAN, article identifier, etc., depending on the nature of the app. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameContentID; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameSuccess; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBAppEventParameterValueYes` and `FBAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameNumItems; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameLevel; + +/*! Parameter key used to specify a description appropriate to the event being logged. E.g., the name of the achievement unlocked in the `FBAppEventNameAchievementUnlocked` event. */ +FBSDK_EXTERN NSString *const FBAppEventParameterNameDescription; + + + +// Predefined values to assign to event parameters that accompany events logged through the `logEvent` family +// of methods on `FBAppEvents`. Common event parameters are provided in the `FBAppEventParameterName*` constants. + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBAppEventParameterValueNo; + + +/*! + + @class FBAppEvents + + @abstract + Client-side event logging for specialized application analytics available through Facebook App Insights + and for use with Facebook Ads conversion tracking and optimization. + + @discussion + The `FBAppEvents` static class has a few related roles: + + + Logging predefined and application-defined events to Facebook App Insights with a + numeric value to sum across a large number of events, and an optional set of key/value + parameters that define "segments" for this event (e.g., 'purchaserStatus' : 'frequent', or + 'gamerLevel' : 'intermediate') + + + Logging events to later be used for ads optimization around lifetime value. + + + Methods that control the way in which events are flushed out to the Facebook servers. + + Here are some important characteristics of the logging mechanism provided by `FBAppEvents`: + + + Events are not sent immediately when logged. They're cached and flushed out to the Facebook servers + in a number of situations: + - when an event count threshold is passed (currently 100 logged events). + - when a time threshold is passed (currently 15 seconds). + - when an app has gone to background and is then brought back to the foreground. + + + Events will be accumulated when the app is in a disconnected state, and sent when the connection is + restored and one of the above 'flush' conditions are met. + + + The `FBAppEvents` class in thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBAppEvents` to force the flushing of events to only + occur on an explicit call to the `flush` method. + + + The developer can turn on console debug output for event logging and flushing to the server by using + the `FBLoggingBehaviorAppEvents` value in `[FBSettings setLoggingBehavior:]`. + + Some things to note when logging events: + + + There is a limit on the number of unique event names an app can use, on the order of 300. + + There is a limit to the number of unique parameter names in the provided parameters that can + be used per event, on the order of 25. This is not just for an individual call, but for all + invocations for that eventName. + + Event names and parameter names (the keys in the NSDictionary) must be between 2 and 40 characters, and + must consist of alphanumeric characters, _, -, or spaces. + + The length of each parameter value can be no more than on the order of 100 characters. + + */ +@interface FBAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @method + + @abstract + Log an event with just an eventName. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @method + + @abstract + Log an event with an eventName and a numeric value to be aggregated with other events of this name. + + @param eventName The name of the event to record. Limitations on number of events and name length + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum; + + +/*! + + @method + + @abstract + Log an event with an eventName and a set of key/value pairs in the parameters dictionary. + Parameter limitations are described above. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @method + + @abstract + Log an event with an eventName, a numeric value to be aggregated with other events of this name, + and a set of key/value pairs in the parameters dictionary. Providing session lets the developer + target a particular . If nil is provided, then `[FBSession activeSession]` will be used. + + @param eventName The name of the event to record. Limitations on number of events and name construction + are given in the `FBAppEvents` documentation. Common event names are provided in `FBAppEventName*` constants. + + @param valueToSum Amount to be aggregated into all events of this eventName, and App Insights will report + the cumulative and average value of this amount. Note that this is an NSNumber, and a value of `nil` denotes + that this event doesn't have a value associated with it for summation. + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + + +/* + * Purchase logging + */ + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency. This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @method + + @abstract + Log a purchase of the specified amount, in the specified currency, also providing a set of + additional characteristics describing the purchase, as well as an to log to. + + @param purchaseAmount Purchase amount to be logged, as expressed in the specified currency.This value + will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346). + + @param currency Currency, is denoted as, e.g. "USD", "EUR", "GBP". See ISO-4217 for + specific values. One reference for these is . + + @param parameters Arbitrary parameter dictionary of characteristics. The keys to this dictionary must + be NSString's, and the values are expected to be NSString or NSNumber. Limitations on the number of + parameters and name construction are given in the `FBAppEvents` documentation. Commonly used parameter names + are provided in `FBAppEventParameterName*` constants. + + @param session to direct the event logging to, and thus be logged with whatever user (if any) + is associated with that . A value of `nil` will use `[FBSession activeSession]`. + + @discussion This event immediately triggers a flush of the `FBAppEvents` event queue, unless the `flushBehavior` is set + to `FBAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + session:(FBSession *)session; + +/*! + @method + + @abstract This method has been replaced by [FBSettings limitEventAndDataUsage] */ ++ (BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings limitEventAndDataUsage] instead"))); + +/*! + @method + + @abstract This method has been replaced by [FBSettings setLimitEventUsage] + @param limitEventUsage deprecated +*/ ++ (void)setLimitEventUsage:(BOOL)limitEventUsage __attribute__ ((deprecated("use [FBSettings setLimitEventAndDataUsage] instead"))); + +/*! + + @method + + @abstract + Notifies the events system that the app has launched and, when appropriate, logs an "activated app" event. Should typically be placed in the + app delegates' `applicationDidBecomeActive:` method. + + This method also takes care of logging the event indicating the first time this app has been launched, which, among other things, is used to + track user acquisition and app install ads conversions. + + @discussion + `activateApp` will not log an event on every app launch, since launches happen every time the app is backgrounded and then foregrounded. + "activated app" events will be logged when the app has not been active for more than 60 seconds. This method also causes a "deactivated app" + event to be logged when sessions are "completed", and these events are logged with the session length, with an indication of how much + time has elapsed between sessions, and with the number of background/foreground interruptions that session had. This data + is all visible in your app's App Events Insights. + */ ++ (void)activateApp; + +/* + * Control over event batching/flushing + */ + +/*! + + @method + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBAppEventsFlushBehavior)flushBehavior; + +/*! + + @method + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBAppEventsFlushBehavior)flushBehavior; + +/*! + @method + + @abstract + Set the 'override' App ID for App Event logging. + + @discussion + In some cases, apps want to use one Facebook App ID for login and social presence and another + for App Event logging. (An example is if multiple apps from the same company share an app ID for login, but + want distinct logging.) By default, this value is `nil`, and defers to the `FacebookLoggingOverrideAppID` + plist value. If that's not set, the default App ID set via [FBSettings setDefaultAppID] + or in the `FacebookAppID` plist entry. + + This should be set before any other calls are made to `FBAppEvents`. Thus, you should set it in your application + delegate's `application:didFinishLaunchingWithOptions:` delegate. + + @param appID The Facebook App ID to be used for App Event logging. + */ ++ (void)setLoggingOverrideAppID:(NSString *)appID; + +/*! + @method + + @abstract + Get the 'override' App ID for App Event logging. + + @see setLoggingOverrideAppID: + + */ ++ (NSString *)loggingOverrideAppID; + + +/*! + + @method + + @abstract + Explicitly kick off flushing of events to Facebook. This is an asynchronous method, but it does initiate an immediate + kick off. Server failures will be reported through the NotificationCenter with notification ID `FBAppEventsLoggingResultNotification`. + */ ++ (void)flush; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h new file mode 100644 index 0000000..dfdcd2e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkData.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract This class contains information that represents an App Link from Facebook. + */ +@interface FBAppLinkData : NSObject + +/*! @abstract The target */ +@property (readonly) NSURL *targetURL; + +/*! @abstract List of the types of actions for this target */ +@property (readonly) NSArray *actionTypes; + +/*! @abstract List of the ids of the actions for this target */ +@property (readonly) NSArray *actionIDs; + +/*! @abstract Reference breadcrumb provided during creation of story */ +@property (readonly) NSString *ref; + +/*! @abstract User Agent string set by the referer */ +@property (readonly) NSString *userAgent; + +/*! @abstract Referer data is a JSON object set by the referer with referer-specific content */ +@property (readonly) NSDictionary *refererData; + +/*! @abstract Full set of query parameters for this app link */ +@property (readonly) NSDictionary *originalQueryParameters; + +/*! @abstract Original url from which applinkData was extracted */ +@property (readonly) NSURL *originalURL; + +/*! @abstract Addtional arguments supplied with the App Link data. */ +@property (readonly) NSDictionary *arguments; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h new file mode 100644 index 0000000..e1be2ea --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBAppLinkResolver.h @@ -0,0 +1,52 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import + +/*! + @class FBAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook app link + index to resolve App Links given a URL. It also provides an additional helper method that can resolve + multiple App Links in a single call. + + @discussion + Usage of this type requires a client token and linking + Bolts.framework. See `[FBSettings setClientToken:]`. + */ +@interface FBAppLinkResolver : NSObject + +/*! + @abstract Asynchronously resolves App Link data for multiple URLs. + + @param urls An array of NSURLs to resolve into App Links. + @returns A BFTask that will return dictionary mapping input NSURLs to their + corresponding BFAppLink. + + @discussion + You should set the client token before making this call. See `[FBSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h new file mode 100644 index 0000000..2cea86e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBCacheDescriptor.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" + +/*! + @class + + @abstract + Base class from which CacheDescriptors derive, provides a method to fetch data for later use + + @discussion + Cache descriptors allow your application to specify the arguments that will be + later used with another object, such as the FBFriendPickerViewController. By using a cache descriptor + instance, an application can choose to fetch data ahead of the point in time where the data is needed. + */ +@interface FBCacheDescriptor : NSObject + +/*! + @method + @abstract + Fetches and caches the data described by the cache descriptor instance, for the given session. + + @param session the to use for fetching data + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBColor.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBColor.h new file mode 100644 index 0000000..2c461f1 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBColor.h @@ -0,0 +1,20 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +UIColor *FBUIColorWithRGBA(uint8_t r, uint8_t g, uint8_t b, CGFloat a); +UIColor *FBUIColorWithRGB(uint8_t r, uint8_t g, uint8_t b); diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h new file mode 100644 index 0000000..01d3450 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogs.h @@ -0,0 +1,1029 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBLinkShareParams.h" +#import "FBOpenGraphActionParams.h" +#import "FBPhotoParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + */ +typedef NS_ENUM(NSUInteger, FBOSIntegratedShareDialogResult) { + /*! Indicates that the dialog action completed successfully. */ + FBOSIntegratedShareDialogResultSucceeded = 0, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBOSIntegratedShareDialogResultCancelled = 1, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBOSIntegratedShareDialogResultError = 2 +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the native share dialog + being displayed. + */ +typedef void (^FBOSIntegratedShareDialogHandler)(FBOSIntegratedShareDialogResult result, NSError *error); + +/*! + @typedef FBDialogAppCallCompletionHandler + + @abstract + A block that when passed to a method in FBDialogs is called back + with the results of the AppCall for that dialog. + + @discussion + This will be called on the UI thread, once the AppCall completes. + + @param call The `FBAppCall` that was completed. + + @param results The results of the AppCall for the dialog. This parameters is present + purely for convenience, and is the exact same value as call.dialogData.results. + + @param error The `NSError` representing any error that occurred. This parameters is + present purely for convenience, and is the exact same value as call.error. + + */ +typedef void (^FBDialogAppCallCompletionHandler)( + FBAppCall *call, + NSDictionary *results, + NSError *error); + +/*! + @class FBDialogs + + @abstract + Provides methods to display native (i.e., non-Web-based) dialogs to the user. + + @discussion + If you are building an app with a urlSchemeSuffix, you should also set the appropriate + plist entry. See `[FBSettings defaultUrlSchemeSuffix]`. + */ +@interface FBDialogs : NSObject + +#pragma mark - OSIntegratedShareDialog + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. The + current active session returned by [FBSession activeSession] will be used to determine + whether the dialog will be displayed. If a session is active, it must be open and the + login method used to authenticate the user must be native iOS 6.0 authentication. + If no session active, then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param image A UIImage that will be attached to the status update. May be nil. + + @param url An NSURL that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. The + current active session returned by [FBSession activeSession] will be used to determine + whether the dialog will be displayed. If a session is active, it must be open and the + login method used to authenticate the user must be native iOS 6.0 authentication. + If no session active, then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param images An array of UIImages that will be attached to the status update. May + be nil. + + @param urls An array of NSURLs that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract + Presents a dialog that allows the user to share a status update that may include + text, images, or URLs. This dialog is only available on iOS 6.0 and above. An + may be specified, or nil may be passed to indicate that the current + active session should be used. If a session is specified (whether explicitly or by + virtue of being the active session), it must be open and the login method used to + authenticate the user must be native iOS 6.0 authentication. If no session is specified + (and there is no active session), then whether the call succeeds or not will depend on + whether Facebook integration has been configured. + + @param viewController The view controller which will present the dialog. + + @param session The to use to determine whether or not the user has been + authenticated with iOS native authentication. If nil, then [FBSession activeSession] + will be checked. See discussion above for the implications of nil or non-nil session. + + @param initialText The text which will initially be populated in the dialog. The user + will have the opportunity to edit this text before posting it. May be nil. + + @param images An array of UIImages that will be attached to the status update. May + be nil. + + @param urls An array of NSURLs that will be attached to the status update. May be nil. + + @param handler A handler that will be called when the dialog is dismissed, or if an error + occurs. May be nil. + + @return YES if the dialog was presented, NO if not (in the case of a NO result, the handler + will still be called, with an error indicating the reason the dialog was not displayed) + */ ++ (BOOL)presentOSIntegratedShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBOSIntegratedShareDialogHandler)handler; + +/*! + @abstract Determines if the device is capable of presenting the OS integrated share dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentOSIntegratedShareDialogWithSession: + */ ++ (BOOL)canPresentOSIntegratedShareDialog; + +/*! + @abstract + Determines whether a call to presentShareDialogModallyFrom: will successfully present + a dialog. This is useful for applications that need to modify the available UI controls + depending on whether the dialog is available on the current platform and for the current + user. + + @param session The to use to determine whether or not the user has been + authenticated with iOS native authentication. If nil, then [FBSession activeSession] + will be checked. See discussion above for the implications of nil or non-nil session. + + @return YES if the dialog would be presented for the session, and NO if not + */ ++ (BOOL)canPresentOSIntegratedShareDialogWithSession:(FBSession *)session; + +#pragma mark - Native Share Dialog + +/*! + @abstract Determines if the device is capable of presenting the share dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentShareDialogWithOpenGraphActionParams: + @see canPresentShareDialogWithParams: + @see canPresentShareDialogWithPhotos + */ ++ (BOOL)canPresentShareDialog; + +/*! + @abstract + Determines whether a call to presentShareDialogWithOpenGraphActionParams:clientState:handler: + will successfully present a dialog in the Facebook application. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithOpenGraphActionParams method will return a non-nil FBAppCall for + the same params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithTarget: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params The parameters for the FB share dialog. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithParams method will return a non-nil FBAppCall for the same + params. And vice versa. +*/ ++ (BOOL)canPresentShareDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to presentShareDialogWithPhotoParams: will successfully + present a dialog in the Facebook application. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not + + @discussion A return value of YES here indicates that the corresponding + presentShareDialogWithPhotoParams method will return a non-nil FBAppCall. +*/ ++ (BOOL)canPresentShareDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the FB share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to share the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithPhotoParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook application that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Facebook app, and will cause the + current app to be suspended. When the share is complete, the Facebook app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentShareDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentShareDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +#pragma mark - Message Dialog + +/*! + @abstract Determines if the device is capable of presenting the message dialog. + + @discussion This is the most basic check for capability for this feature. + + @see canPresentMessageDialogWithOpenGraphActionParams: + @see canPresentMessageDialogWithParams: + @see canPresentMessageDialogWithPhotos + */ ++ (BOOL)canPresentMessageDialog; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithOpenGraphActionParams:...` will + successfully present a dialog in the Facebook Messenger app. This is useful for applications + that need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithParams:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @param params the dialog parameters + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithParams:(FBLinkShareParams *)params; + +/*! + @abstract + Determines whether a call to `presentMessageDialogWithPhotos:...` will successfully + present a dialog in the Facebook Messenger app. This is useful for applications that + need to modify the available UI controls depending on whether the dialog is + available on the current platform. + + @return YES if the dialog would be presented, and NO if not +*/ ++ (BOOL)canPresentMessageDialogWithPhotos; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish an Open + Graph action. No session is required, and the app does not need to be authorized to call + this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Open Graph action dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithOpenGraphActionParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphActionParams:(FBOpenGraphActionParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */+ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to publish the + supplied Open Graph action. No session is required, and the app does not need to be + authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param action The Open Graph action to be published. May not be nil. + + @param actionType the fully-specified Open Graph action type of the action (e.g., + my_app_namespace:my_action). + + @param previewPropertyName the name of the property on the action that represents the + primary Open Graph object associated with the action; this object will be displayed in the + preview portion of the share dialog. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithOpenGraphActionParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithOpenGraphAction:(id)action + actionType:(NSString *)actionType + previewPropertyName:(NSString *)previewPropertyName + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. The "friends" and "place" properties + will be ignored as the Facebook Messenger app does not support tagging. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotoParams:(FBPhotoParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. + */ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + handler:(FBDialogAppCallCompletionHandler)handler; +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to send the + supplied photo(s). No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param photos An NSArray containing UIImages to be shared. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithPhotos` method is also returning YES. +*/ ++ (FBAppCall *)presentMessageDialogWithPhotos:(NSArray *)photos + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share a status + update that may include text, images, or URLs. No session is required, and the app + does not need to be authorized to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param params The parameters for the Message Dialog. The "friends" and "place" properties + will be ignored as the Facebook Messenger app does not support tagging. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + `canPresentMessageDialogWithParams:` method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithParams:(FBLinkShareParams *)params + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + handler:(FBDialogAppCallCompletionHandler)handler; + +/*! + @abstract + Presents a dialog in the Facebook Messenger app that allows the user to share the + supplied link. No session is required, and the app does not need to be authorized + to call this. + + Note that this will perform an app switch to the Messenger app, and will cause the + current app to be suspended. When the share is complete, the Messenger app will redirect + to a url of the form "fb{APP_ID}://" that the application must handle. The app should + then call [FBAppCall handleOpenURL:sourceApplication:fallbackHandler:] to trigger + the appropriate handling. Note that FBAppCall will first try to call the completion + handler associated with this method, but since during an app switch, the calling app + may be suspended or killed, the app must also give a fallbackHandler to the + handleOpenURL: method in FBAppCall. + + @param link The URL link to be attached to the post. + + @param name The name, or title associated with the link. May be nil. + + @param caption The caption to be used with the link. May be nil. + + @param description The description associated with the link. May be nil. + + @param picture The link to a thumbnail to associate with the link. May be nil. + + @param clientState An NSDictionary that's passed through when the completion handler + is called. This is useful for the app to maintain state about the share request that + was made so as to have appropriate action when the handler is called. May be nil. + + @param handler A completion handler that may be called when the status update is + complete. May be nil. If non-nil, the handler will always be called asynchronously. + + @return An FBAppCall object that will also be passed into the provided + FBAppCallCompletionHandler. + + @discussion A non-nil FBAppCall object is only returned if the corresponding + canPresentMessageDialogWithParams method is also returning YES for the same params. + */ ++ (FBAppCall *)presentMessageDialogWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture + clientState:(NSDictionary *)clientState + handler:(FBDialogAppCallCompletionHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h new file mode 100644 index 0000000..bffbc46 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsData.h @@ -0,0 +1,35 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @abstract + This class encapsulates state and data related to the presentation and completion + of a dialog. + */ +@interface FBDialogsData : NSObject + +/*! @abstract The method being performed */ +@property (nonatomic, readonly) NSString *method; +/*! @abstract The arguments being passed to the entity that will show the dialog */ +@property (nonatomic, readonly) NSDictionary *arguments; +/*! @abstract Client JSON state that is passed through to the completion handler for context */ +@property (nonatomic, readonly) NSDictionary *clientState; +/*! @abstract Results of this FBAppCall that are only set before calling an FBAppCallHandler */ +@property (nonatomic, readonly) NSDictionary *results; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h new file mode 100644 index 0000000..6fb76d6 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBDialogsParams.h @@ -0,0 +1,33 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @class FBDialogsParams + + @abstract + This object is used as a base class for parameters passed to native dialogs that + open in the Facebook app. + */ +@interface FBDialogsParams : NSObject + +/*! + @abstract Validates the receiver to ensure that it is configured properly. + */ +- (NSError *)validate; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBError.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBError.h new file mode 100644 index 0000000..1d2f628 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBError.h @@ -0,0 +1,385 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + The NSError domain of all errors returned by the Facebook SDK. +*/ +FBSDK_EXTERN NSString *const FacebookSDKDomain; + +/*! + The NSError domain of all errors surfaced by the Facebook SDK that + were returned by the Facebook Application + */ +FBSDK_EXTERN NSString *const FacebookNativeApplicationDomain; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the inner NSError (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorInnerErrorKey; + +/*! + The key in the userInfo NSDictionary of NSError for the parsed JSON response + from the server. In case of a batch, includes the JSON for a single FBRequest. +*/ +FBSDK_EXTERN NSString *const FBErrorParsedJSONResponseKey; + +/*! + The key in the userInfo NSDictionary of NSError indicating + the HTTP status code of the response (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorHTTPStatusCodeKey; + +/*! + @typedef NS_ENUM (NSUInteger, FBErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookSDKDomain. + */ +typedef NS_ENUM(NSInteger, FBErrorCode) { + /*! + Like nil for FBErrorCode values, represents an error code that + has not been initialized yet. + */ + FBErrorInvalid = 0, + + /*! The operation failed because it was cancelled. */ + FBErrorOperationCancelled, + + /*! A login attempt failed */ + FBErrorLoginFailedOrCancelled, + + /*! The graph API returned an error for this operation. */ + FBErrorRequestConnectionApi, + + /*! + The operation failed because the server returned an unexpected + response. You can get this error if you are not using the most + recent SDK, or if you set your application's migration settings + incorrectly for the version of the SDK you are using. + + If this occurs on the current SDK with proper app migration + settings, you may need to try changing to one request per batch. + */ + FBErrorProtocolMismatch, + + /*! Non-success HTTP status code was returned from the operation. */ + FBErrorHTTPError, + + /*! An endpoint that returns a binary response was used with FBRequestConnection. + Endpoints that return image/jpg, etc. should be accessed using NSURLRequest */ + FBErrorNonTextMimeTypeReturned, + + /*! An error occurred while trying to display a native dialog */ + FBErrorDialog, + + /*! An error occurred using the FBAppEvents class */ + FBErrorAppEvents, + + /*! An error occurred related to an iOS API call */ + FBErrorSystemAPI, + + /*! + The application had its applicationDidBecomeActive: method called while waiting + on a response from the native Facebook app for a pending FBAppCall. + */ + FBErrorAppActivatedWhilePendingAppCall, + + /*! + The application had its openURL: method called from a source that was not a + Facebook app and with a URL that was intended for the AppBridge + */ + FBErrorUntrustedURL, + + /*! + The URL passed to FBAppCall, was not able to be parsed + */ + FBErrorMalformedURL, + + /*! + The operation failed because the session is currently busy reconnecting. + */ + FBErrorSessionReconnectInProgess, + + /*! + Reserved for future use. + */ + FBErrorOperationDisallowedForRestrictedTreatment, + + /*! + The server returned a response that the SDK could not decode. + */ + FBErrorUnexpectedResponse, +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBNativeApplicationErrorCode) + @abstract Error codes returned by the Facebook SDK in NSError. + + @discussion + These are valid only in the scope of FacebookNativeApplicationDomain. + */ +typedef NS_ENUM(NSUInteger, FBNativeApplicationErrorCode) { + /*! A general error in processing an FBAppCall, without a known cause. Unhandled exceptions are a good example */ + FBAppCallErrorUnknown = 1, + + /*! The FBAppCall cannot be processed for some reason */ + FBAppCallErrorUnsupported = 2, + + /*! The FBAppCall is for a method that does not exist (or is turned off) */ + FBAppCallErrorUnknownMethod = 3, + + /*! The FBAppCall cannot be processed at the moment, but can be retried at a later time. */ + FBAppCallErrorServiceBusy = 4, + + /*! Share was called in the native Facebook app with incomplete or incorrect arguments */ + FBShareErrorInvalidParam = 100, + + /*! A server error occurred while calling Share in the native Facebook app. */ + FBShareErrorServer = 102, + + /*! An unknown error occurred while calling Share in the native Facebook app. */ + FBShareErrorUnknown = 103, + + /*! Disallowed from calling Share in the native Facebook app. */ + FBShareErrorDenied = 104, +}; + +/*! + @typedef NS_ENUM (NSInteger, FBErrorCategory) + + @abstract Indicates the Facebook SDK classification for the error + + @discussion See `[FBErrorUtility errorCategoryForError:]`. + */ +typedef NS_ENUM(NSInteger, FBErrorCategory) { + /*! Indicates that the error category is invalid and likely represents an error that + is unrelated to Facebook or the Facebook SDK */ + FBErrorCategoryInvalid = 0, + /*! Indicates that the error may be authentication related but the application should retry the operation. + This case may involve user action that must be taken, and so the application should also test + the fberrorShouldNotifyUser property and if YES display fberrorUserMessage to the user before retrying.*/ + FBErrorCategoryRetry = 1, + /*! Indicates that the error is authentication related and the application should reopen the session */ + FBErrorCategoryAuthenticationReopenSession = 2, + /*! Indicates that the error is permission related */ + FBErrorCategoryPermissions = 3, + /*! Indicates that the error implies that the server had an unexpected failure or may be temporarily down */ + FBErrorCategoryServer = 4, + /*! Indicates that the error results from the server throttling the client */ + FBErrorCategoryThrottling = 5, + /*! Indicates the user cancelled the operation */ + FBErrorCategoryUserCancelled = 6, + /*! Indicates that the error is Facebook-related but is uncategorizable, and likely newer than the + current version of the SDK */ + FBErrorCategoryFacebookOther = -1, + /*! Indicates that the error is an application error resulting in a bad or malformed request to the server. */ + FBErrorCategoryBadRequest = -2, +}; + +/*! + The key in the userInfo NSDictionary of NSError where you can find + the session associated with the error (if any). +*/ +FBSDK_EXTERN NSString *const FBErrorSessionKey; + +/*! + The key in the userInfo NSDictionary of NSError that points to the URL + that caused an error, in its processing by FBAppCall. + */ +FBSDK_EXTERN NSString *const FBErrorUnprocessedURLKey; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value will be one of the constants prefixed by FBErrorLoginFailedReason*. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReason; + +/*! + The key in the userInfo NSDictionary of NSError for unsuccessful + logins (error.code equals FBErrorLoginFailedOrCancelled). If present, + the value indicates an original login error code wrapped by this error. + This is only used in the web dialog login flow. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedOriginalErrorCode; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a web dialog auth. +*/ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + did not cancel a web dialog auth. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonInlineNotCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled a non-iOS 6 SSO (either Safari or Facebook App) login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the user + cancelled an iOS system login. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUserCancelledSystemValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + condition. You may inspect the rest of userInfo for other data. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonOtherError; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates the app's + slider in iOS 6 (device Settings -> Privacy -> Facebook {app}) has + been disabled. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue; + +/*! + A value that may appear in an NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key for login failures. Indicates an error + has occurred when requesting Facebook account acccess in iOS 6 that was + not `FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue` nor + a user cancellation. + */ +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonSystemError; +FBSDK_EXTERN NSString *const FBErrorLoginFailedReasonUnitTestResponseUnrecognized; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the session was closed. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonSessionClosed; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelled; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails on + iOS 6 with the Facebook account. Indicates the request for new permissions has + failed because the user cancelled. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonUserCancelledSystem; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorLoginFailedReason` key when requesting new permissions fails. Indicates + the request for new permissions has failed because the request was + for a different user than the original permission set. + */ +FBSDK_EXTERN NSString *const FBErrorReauthorizeFailedReasonWrongUser; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBDialogs` operations. (error.code equals FBErrorDialog). + If present, the value will be one of the constants prefixed by FBErrorDialog *. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogReasonKey; + +/*! + A value that may appear in the NSError userInfo dictionary under the +`FBErrorDialogReasonKey` key. Indicates that a native dialog is not supported + in the current OS. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogNotSupported; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because it is not appropriate for the current session. +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidForSession; + +/*! + A value that may appear in the NSError userInfo dictionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed for some other reason. + */ +FBSDK_EXTERN NSString *const FBErrorDialogCantBeDisplayed; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because an Open Graph object that was passed was not configured + correctly. The object must either (a) exist by having an 'id' or 'url' value; + or, (b) configured for creation (by setting the 'type' value and + provisionedForPost property) +*/ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphObject; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing an Open Graph action were + not configured. The parameters must include an 'action', 'actionType', and + 'previewPropertyName'. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidOpenGraphActionParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a native dialog cannot be + displayed because the parameters for sharing a status update, link, or photo were + not configured. The parameters must not include both 'photos' and a 'link'. */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidShareParameters; + +/*! + A value that may appear in the NSError userInfo ditionary under the + `FBErrorDialogReasonKey` key. Indicates that a like dialog cannot be + displayed because the objectID parameter value is invalid. + */ +FBSDK_EXTERN NSString *const FBErrorDialogInvalidLikeObjectID; + +/*! + The key in the userInfo NSDictionary of NSError for errors + encountered with `FBAppEvents` operations (error.code equals FBErrorAppEvents). +*/ +FBSDK_EXTERN NSString *const FBErrorAppEventsReasonKey; + +// Exception strings raised by the Facebook SDK + +/*! + This exception is raised by methods in the Facebook SDK to indicate + that an attempted operation is invalid + */ +FBSDK_EXTERN NSString *const FBInvalidOperationException; + +// Facebook SDK also raises exceptions the following common exceptions: +// NSInvalidArgumentException + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h new file mode 100644 index 0000000..ab075cb --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBErrorUtility.h @@ -0,0 +1,103 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @class FBErrorUtility + + @abstract A utility class with methods to provide more information for Facebook + related errors if you do not want to use the NSError(FBError) category. + + */ +@interface FBErrorUtility : NSObject + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error The error to be categorized. + */ ++ (FBErrorCategory)errorCategoryForError:(NSError *)error; + +/*! + @abstract + Retrieves the underlying error code from an FBError that is wrapped within an NSError. + Returns NSNotFound if no error code was found. + + @param error The error whose error code should be retrieved. + */ ++ (NSUInteger)errorCodeForError:(NSError *)error; + +/*! + @abstract + Retrieves the underlying error subcode from an FBError that is wrapped within an NSError. + Returns NSNotFound if no error subcode was found. + + @param error The error whose error subcode should be retrieved. + */ ++ (NSUInteger)errorSubcodeForError:(NSError *)error; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the facebook operation + + @discussion + In general if this returns NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + + @param error The error to inspect. + */ ++ (BOOL)shouldNotifyUserForError:(NSError *)error; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + +shouldNotifyUserForError: returns YES, this method returns a localizable message suitable for display. + + @param error The error to inspect. + */ ++ (NSString *)userMessageForError:(NSError *)error; + +/*! + @abstract + A short summary of the error suitable for display to the user. + Not all Facebook errors yield a localized message/title suitable for user display; however in all cases when title is + available, user should be notified. + + @param error The error to inspect. + */ ++ (NSString *)userTitleForError:(NSError *)error; + +/*! + @abstract + YES if given error is transient and may succeed if the initial action is retried as-is. + Application may use this information to display a "Retry" button, if user should be notified about this error. + + @param error The error to inspect. + */ ++ (BOOL)isTransientError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h new file mode 100644 index 0000000..cfca124 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFrictionlessRecipientCache.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +#import "FBCacheDescriptor.h" +#import "FBRequest.h" +#import "FBWebDialogs.h" + +/*! + @class FBFrictionlessRecipientCache + + @abstract + Maintains a cache of friends that can recieve application requests from the user in + using the frictionless feature of the requests web dialog. + + This class follows the `FBCacheDescriptor` pattern used elsewhere in the SDK, and applications may call + one of the prefetchAndCacheForSession methods to fetch a friend list prior to the + point where a dialog is presented. The cache is also updated with each presentation of the request + dialog using the cache instance. + */ +@interface FBFrictionlessRecipientCache : FBCacheDescriptor + +/*! @abstract An array containing the list of known FBIDs for recipients enabled for frictionless requests */ +@property (nonatomic, readwrite, copy) NSArray *recipientIDs; + +/*! + @abstract + Checks to see if a given user or FBID for a user is known to be enabled for + frictionless requestests + + @param user An NSString, NSNumber of `FBGraphUser` representing a user to check + */ +- (BOOL)isFrictionlessRecipient:(id)user; + +/*! + @abstract + Checks to see if a collection of users or FBIDs for users are known to be enabled for + frictionless requestests + + @param users An NSArray of NSString, NSNumber of `FBGraphUser` objects + representing users to check + */ +- (BOOL)areFrictionlessRecipients:(NSArray *)users; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + */ +- (void)prefetchAndCacheForSession:(FBSession *)session; + +/*! + @abstract + Issues a request and fills the cache with a list of users to use for frictionless requests + + @param session The session to use for the request; nil indicates that the Active Session should + be used + + @param handler An optional completion handler, called when the request for cached users has + completed. It can be useful to use the handler to enable UI or perform other request-related + operations, after the cache is populated. + */ +- (void)prefetchAndCacheForSession:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h new file mode 100644 index 0000000..b3e2704 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBFriendPickerViewController.h @@ -0,0 +1,170 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphUser.h" +#import "FBPeoplePickerViewController.h" + +@protocol FBFriendPickerDelegate; + + +/*! + @class + + @abstract + The `FBFriendPickerViewController` class creates a controller object that manages + the user interface for displaying and selecting Facebook friends. + + @discussion + When the `FBFriendPickerViewController` view loads it creates a `UITableView` object + where the friends will be displayed. You can access this view through the `tableView` + property. The friend display can be sorted by first name or last name. Friends' + names can be displayed with the first name first or the last name first. + + The friend data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any friend data requests will first check the cache and use that data. + If the friend picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to friend selection and + data changes. The delegate can also be used to filter the friends to display in the + picker. + */ +@interface FBFriendPickerViewController : FBPeoplePickerViewController + +/*! + @abstract + The list of friends that are currently selected in the view. + The items in the array are objects. + + @discussion + You can set this this array to pre-select items in the picker. The objects in the array + must be complete id objects (i.e., fetched from a Graph query or from a + previous picker's selection, with id and appropriate name fields). + */ +@property (nonatomic, copy, readwrite) NSArray *selection; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor based on default settings of the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + */ ++ (FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the `FBFriendPickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBFriendPickerViewController` + object. + + @param userID The profile ID of the user whose friends will be displayed. A nil value implies a "me" alias. + @param fieldsForRequest The set of additional fields to include in the request for friend data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithUserID:(NSString *)userID fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBFriendPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + + The methods of correspond to . + If a pair of corresponding methods are implemented, the + method is called first. + */ +@protocol FBFriendPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param friendPicker The friend picker view controller whose data changed. + */ +- (void)friendPickerViewControllerDataDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param friendPicker The friend picker view controller whose selection changed. + */ +- (void)friendPickerViewControllerSelectionDidChange:(FBFriendPickerViewController *)friendPicker; + +/*! + @abstract + Asks the delegate whether to include a friend in the list. + + @discussion + This can be used to implement a search bar that filters the friend list. + + If -[ graphObjectPickerViewController:shouldIncludeGraphObject:] + is implemented and returns NO, this method is not called. + + @param friendPicker The friend picker view controller that is requesting this information. + @param user An object representing the friend. + */ +- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + shouldIncludeUser:(id)user; + +/*! + @abstract + Tells the delegate that there is a communication error. + + @param friendPicker The friend picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)friendPickerViewController:(FBFriendPickerViewController *)friendPicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h new file mode 100644 index 0000000..7f71ce6 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphLocation.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphLocation` protocol enables typed access to the `location` property + of a Facebook place object. + + + @discussion + The `FBGraphLocation` protocol represents the most commonly used properties of a + location object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphLocation + +/*! + @property + @abstract Typed access to a location's street. + */ +@property (retain, nonatomic) NSString *street; + +/*! + @property + @abstract Typed access to a location's city. + */ +@property (retain, nonatomic) NSString *city; + +/*! + @property + @abstract Typed access to a location's state. + */ +@property (retain, nonatomic) NSString *state; + +/*! + @property + @abstract Typed access to a location's country. + */ +@property (retain, nonatomic) NSString *country; + +/*! + @property + @abstract Typed access to a location's zip code. + */ +@property (retain, nonatomic) NSString *zip; + +/*! + @property + @abstract Typed access to a location's latitude. + */ +@property (retain, nonatomic) NSNumber *latitude; + +/*! + @property + @abstract Typed access to a location's longitude. + */ +@property (retain, nonatomic) NSNumber *longitude; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h new file mode 100644 index 0000000..dfdff1c --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObject.h @@ -0,0 +1,269 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@protocol FBOpenGraphObject; +@protocol FBOpenGraphAction; + +/*! + @protocol + + @abstract + The `FBGraphObject` protocol is the base protocol which enables typed access to graph objects and + open graph objects. Inherit from this protocol or a sub-protocol in order to introduce custom types + for typed access to Facebook objects. + + @discussion + The `FBGraphObject` protocol is the core type used by the Facebook SDK for iOS to + represent objects in the Facebook Social Graph and the Facebook Open Graph (OG). + The `FBGraphObject` class implements useful default functionality, but is rarely + used directly by applications. The `FBGraphObject` protocol, in contrast is the + base protocol for all graph object access via the SDK. + + Goals of the FBGraphObject types: +
    +
  • Lightweight/maintainable/robust
  • +
  • Extensible and resilient to change, both by Facebook and third party (OG)
  • +
  • Simple and natural extension to Objective-C
  • +
+ + The FBGraphObject at its core is a duck typed (if it walks/swims/quacks... + its a duck) model which supports an optional static facade. Duck-typing achieves + the flexibility necessary for Social Graph and OG uses, and the static facade + increases discoverability, maintainability, robustness and simplicity. + The following excerpt from the PlacePickerSample shows a simple use of the + a facade protocol `FBGraphPlace` by an application: + +
+ ‐ (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker
+ {
+ id<FBGraphPlace> place = placePicker.selection;
+
+ // we'll use logging to show the simple typed property access to place and location info
+ NSLog(@"place=%@, city=%@, state=%@, lat long=%@ %@",
+ place.name,
+ place.location.city,
+ place.location.state,
+ place.location.latitude,
+ place.location.longitude);
+ }
+ 
+ + Note that in this example, access to common place information is available through typed property + syntax. But if at some point places in the Social Graph supported additional fields "foo" and "bar", not + reflected in the `FBGraphPlace` protocol, the application could still access the values like so: + +
+ NSString *foo = [place objectForKey:@"foo"]; // perhaps located at the ... in the preceding example
+ NSNumber *bar = [place objectForKey:@"bar"]; // extensibility applies to Social and Open graph uses
+ 
+ + In addition to untyped access, applications and future revisions of the SDK may add facade protocols by + declaring a protocol inheriting the `FBGraphObject` protocol, like so: + +
+ @protocol MyGraphThing<FBGraphObject>
+ @property (copy, nonatomic) NSString *objectID;
+ @property (copy, nonatomic) NSString *name;
+ @end
+ 
+ + Important: facade implementations are inferred by graph objects returned by the methods of the SDK. This + means that no explicit implementation is required by application or SDK code. Any `FBGraphObject` instance + may be cast to any `FBGraphObject` facade protocol, and accessed via properties. If a field is not present + for a given facade property, the property will return nil. + + The following layer diagram depicts some of the concepts discussed thus far: + +
+                        *-------------* *------------* *-------------**--------------------------*
+ Facade -->             | FBGraphUser | |FBGraphPlace| | MyGraphThing|| MyGraphPersonExtentension| ...
+                        *-------------* *------------* *-------------**--------------------------*
+                        *------------------------------------* *--------------------------------------*
+ Transparent impl -->   |     FBGraphObject (instances)      | |      CustomClass<FBGraphObject>      |
+                        *------------------------------------* *--------------------------------------*
+                        *-------------------**------------------------* *-----------------------------*
+ Apparent impl -->      |NSMutableDictionary||FBGraphObject (protocol)| |FBGraphObject (class methods)|
+                        *-------------------**------------------------* *-----------------------------*
+ 
+ + The *Facade* layer is meant for typed access to graph objects. The *Transparent impl* layer (more + specifically, the instance capabilities of `FBGraphObject`) are used by the SDK and app logic + internally, but are not part of the public interface between application and SDK. The *Apparent impl* + layer represents the lower-level "duck-typed" use of graph objects. + + Implementation note: the SDK returns `NSMutableDictionary` derived instances with types declared like + one of the following: + +
+ NSMutableDictionary<FBGraphObject> *obj;     // no facade specified (still castable by app)
+ NSMutableDictionary<FBGraphPlace> *person;   // facade specified when possible
+ 
+ + However, when passing a graph object to the SDK, `NSMutableDictionary` is not assumed; only the + FBGraphObject protocol is assumed, like so: + +
+ id<FBGraphObject> anyGraphObj;
+ 
+ + As such, the methods declared on the `FBGraphObject` protocol represent the methods used by the SDK to + consume graph objects. While the `FBGraphObject` class implements the full `NSMutableDictionary` and KVC + interfaces, these are not consumed directly by the SDK, and are optional for custom implementations. + */ +@protocol FBGraphObject + +/*! + @method + @abstract + Returns the number of properties on this `FBGraphObject`. + */ +- (NSUInteger)count; +/*! + @method + @abstract + Returns a property on this `FBGraphObject`. + + @param aKey name of the property to return + */ +- (id)objectForKey:(id)aKey; +/*! + @method + @abstract + Returns an enumerator of the property names on this `FBGraphObject`. + */ +- (NSEnumerator *)keyEnumerator; +/*! + @method + @abstract + Removes a property on this `FBGraphObject`. + + @param aKey name of the property to remove + */ +- (void)removeObjectForKey:(id)aKey; +/*! + @method + @abstract + Sets the value of a property on this `FBGraphObject`. + + @param anObject the new value of the property + @param aKey name of the property to set + */ +- (void)setObject:(id)anObject forKey:(id)aKey; + +@optional + +/*! + @abstract + This property signifies that the current graph object is provisioned for POST (as a definition + for a new or updated graph object), and should be posted AS-IS in its JSON encoded form, whereas + some graph objects (usually those embedded in other graph objects as references to existing objects) + may only have their "id" or "url" posted. + */ +@property (nonatomic, assign) BOOL provisionedForPost; + +@end + +/*! + @class + + @abstract + Static class with helpers for use with graph objects + + @discussion + The public interface of this class is useful for creating objects that have the same graph characteristics + of those returned by methods of the SDK. This class also represents the internal implementation of the + `FBGraphObject` protocol, used by the Facebook SDK. Application code should not use the `FBGraphObject` class to + access instances and instance members, favoring the protocol. + */ +@interface FBGraphObject : NSMutableDictionary + +/*! + @method + @abstract + Used to create a graph object, usually for use in posting a new graph object or action. + */ ++ (NSMutableDictionary *)graphObject; + +/*! + @method + @abstract + Used to wrap an existing dictionary with a `FBGraphObject` facade + + @discussion + Normally you will not need to call this method, as the Facebook SDK already "FBGraphObject-ifys" json objects + fetch via `FBRequest` and `FBRequestConnection`. However, you may have other reasons to create json objects in your + application, which you would like to treat as a graph object. The pattern for doing this is that you pass the root + node of the json to this method, to retrieve a wrapper. From this point, if you traverse the graph, any other objects + deeper in the hierarchy will be wrapped as `FBGraphObject`'s in a lazy fashion. + + This method is designed to avoid unnecessary memory allocations, and object copying. Due to this, the method does + not copy the source object if it can be avoided, but rather wraps and uses it as is. The returned object derives + callers shoudl use the returned object after calls to this method, rather than continue to call methods on the original + object. + + @param jsonDictionary the dictionary representing the underlying object to wrap + */ ++ (NSMutableDictionary *)graphObjectWrappingDictionary:(NSDictionary *)jsonDictionary; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action. + */ ++ (NSMutableDictionary *)openGraphActionForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + */ ++ (NSMutableDictionary *)openGraphObjectForPost; + +/*! + @method + @abstract + Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object. + + @param type the object type name, in the form namespace:typename + @param title a title for the object + @param image the image property for the object + @param url the url property for the object + @param description the description for the object + */ ++ (NSMutableDictionary *)openGraphObjectForPostWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description; + +/*! + @method + @abstract + Used to compare two `FBGraphObject`s to determine if represent the same object. We do not overload + the concept of equality as there are various types of equality that may be important for an `FBGraphObject` + (for instance, two different `FBGraphObject`s could represent the same object, but contain different + subsets of fields). + + @param anObject an `FBGraphObject` to test + + @param anotherObject the `FBGraphObject` to compare it against + */ ++ (BOOL)isGraphObjectID:(id)anObject sameAs:(id)anotherObject; + + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObjectPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObjectPickerViewController.h new file mode 100644 index 0000000..66af8a5 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphObjectPickerViewController.h @@ -0,0 +1,157 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBGraphObject.h" +#import "FBSession.h" +#import "FBViewController.h" + +@protocol FBGraphObjectPickerDelegate; + +/*! + @class FBGraphObjectPickerViewController + + @abstract + The `FBGraphObjectPickerViewController` class is an abstract controller object that + manages the user interface for displaying and selecting a collection of graph objects. + + @discussion + When the `FBGraphObjectPickerViewController` view loads it creates a `UITableView` + object where the graph objects defined by a concrete subclass will be displayed. You + can access this view through the `tableView` property. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to object selection and + data changes. The delegate can also be used to filter the objects to display in the + picker. + */ +@interface FBGraphObjectPickerViewController : FBViewController + +/*! + @abstract + Returns an outlet for the spinner used in the view controller. + */ +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner; + +/*! + @abstract + Returns an outlet for the table view managed by the view controller. + */ +@property (nonatomic, retain) IBOutlet UITableView *tableView; + +/*! + @abstract + Addtional fields to fetch when making the Graph API call to get graph object data. + */ +@property (nonatomic, copy) NSSet *fieldsForRequest; + +/*! + @abstract + A Boolean value that indicates whether pictures representing the graph object are displayed. + Defaults to YES. + */ +@property (nonatomic) BOOL itemPicturesEnabled; + +/*! + @abstract + The session that is used in the request for the graph object data. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + Clears the current selection, so the picker is ready for a fresh use. + */ +- (void)clearSelection; + +/*! + @abstract + Initiates a query to get the graph object data. + + + @discussion + A cached copy will be returned if available. The cached view is temporary until a fresh copy is + retrieved from the server. It is legal to call this more than once. + */ +- (void)loadData; + +/*! + @abstract + Updates the view locally without fetching data from the server or from cache. + + @discussion + Use this if the filter or sort (if applicable) properties change. This may affect the + order or display of information. + */ +- (void)updateView; + +@end + +/*! + @protocol + + @abstract + The `FBGraphObjectPickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + */ +@protocol FBGraphObjectPickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param graphObjectPicker The graph object picker view controller whose data changed. + */ +- (void)graphObjectPickerViewControllerDataDidChange:(FBGraphObjectPickerViewController *)graphObjectPicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param graphObjectPicker The graph object picker view controller whose selection changed. + */ +- (void)graphObjectPickerViewControllerSelectionDidChange:(FBGraphObjectPickerViewController *)graphObjectPicker; + +/*! + @abstract + Asks the delegate whether to include a graph object in the list. + + @discussion + This can be used to implement a search bar that filters the graph object list. + + @param graphObjectPicker The graph object picker view controller that is requesting this information. + @param object An object + */ +- (BOOL)graphObjectPickerViewController:(FBGraphObjectPickerViewController *)graphObjectPicker + shouldIncludeGraphObject:(id)object; + +/*! + @abstract + Called if there is a communication error. + + @param graphObjectPicker The graph object picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)graphObjectPickerViewController:(FBGraphObjectPickerViewController *)graphObjectPicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPerson.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPerson.h new file mode 100644 index 0000000..44bdbe3 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPerson.h @@ -0,0 +1,69 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPerson` protocol enables typed access to a person's name, photo + and context-specific identifier as represented in the Graph API. + + + @discussion + The `FBGraphPerson` protocol provides access to the name, picture and context-specific + ID of a person represented by a graph object. It may be used to access an `NSDictionary` + object that has been wrapped with an facade. + */ +@protocol FBGraphPerson + +/*! + @property + @abstract Typed access to the user ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the user's name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the user's first name. + */ +@property (retain, nonatomic) NSString *first_name; + +/*! + @property + @abstract Typed access to the user's middle name. + */ +@property (retain, nonatomic) NSString *middle_name; + +/*! + @property + @abstract Typed access to the user's last name. + */ +@property (retain, nonatomic) NSString *last_name; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h new file mode 100644 index 0000000..2a0a4dc --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphPlace.h @@ -0,0 +1,70 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphLocation.h" +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBGraphPlace` protocol enables typed access to a place object + as represented in the Graph API. + + + @discussion + The `FBGraphPlace` protocol represents the most commonly used properties of a + Facebook place object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphPlace + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! +@property +@abstract Typed access to the place ID. +@discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. +*/ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the place name. + */ +@property (retain, nonatomic) NSString *name; + +/*! + @property + @abstract Typed access to the place category. + */ +@property (retain, nonatomic) NSString *category; + +/*! + @property + @abstract Typed access to the place location. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h new file mode 100644 index 0000000..5358bdb --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBGraphUser.h @@ -0,0 +1,67 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphPerson.h" +#import "FBGraphPlace.h" + +/*! + @protocol + + @abstract + The `FBGraphUser` protocol enables typed access to a user object + as represented in the Graph API. + + + @discussion + The `FBGraphUser` protocol represents the most commonly used properties of a + Facebook user object. It may be used to access an `NSDictionary` object that has + been wrapped with an facade. + */ +@protocol FBGraphUser + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the user's profile URL. + */ +@property (retain, nonatomic) NSString *link; + +/*! + @property + @abstract Typed access to the user's username. + */ +@property (retain, nonatomic) NSString *username; + +/*! + @property + @abstract Typed access to the user's birthday. + */ +@property (retain, nonatomic) NSString *birthday; + +/*! + @property + @abstract Typed access to the user's current city. + */ +@property (retain, nonatomic) id location; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBInsights.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBInsights.h new file mode 100644 index 0000000..0a1d4b9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBInsights.h @@ -0,0 +1,103 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" +#import "FBSession.h" + +/*! + @typedef FBInsightsFlushBehavior enum + + @abstract This enum has been deprecated in favor of FBAppEventsFlushBehavior. + */ +__attribute__ ((deprecated("use FBAppEventsFlushBehavior instead"))) +typedef NS_ENUM(NSUInteger, FBInsightsFlushBehavior) { + /*! Deprecated; use FBAppEventsFlushBehaviorAuto instead */ + FBInsightsFlushBehaviorAuto = 0, + /*! Deprecated; use FBAppEventsFlushBehaviorExplicitOnly instead */ + FBInsightsFlushBehaviorExplicitOnly +}; + +FBSDK_EXTERN NSString *const FBInsightsLoggingResultNotification __attribute__((deprecated)); + +/*! + @class FBInsights + + @abstract This class has been deprecated in favor of FBAppEvents. + */ +__attribute__ ((deprecated("Use the FBAppEvents class instead"))) +@interface FBInsights : NSObject + +/*! + @abstract deprecated +*/ ++ (NSString *)appVersion __attribute__((deprecated)); +/*! + @abstract deprecated + @param appVersion deprecated +*/ ++ (void)setAppVersion:(NSString *)appVersion __attribute__((deprecated("use [FBSettings setAppVersion] instead"))); + +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + @param parameters deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param purchaseAmount deprecated + @param currency deprecated + @param parameters deprecated + @param session deprecated + */ ++ (void)logPurchase:(double)purchaseAmount currency:(NSString *)currency parameters:(NSDictionary *)parameters session:(FBSession *)session __attribute__((deprecated("use [FBAppEvents logPurchase] instead"))); +/*! + @abstract deprecated + @param pixelID deprecated + @param value deprecated + */ ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value __attribute__((deprecated)); +/*! + @abstract deprecated + @param pixelID deprecated + @param value deprecated + @param session deprecated + */ ++ (void)logConversionPixel:(NSString *)pixelID valueOfPixel:(double)value session:(FBSession *)session __attribute__((deprecated)); +/*! + @abstract deprecated + */ ++ (FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents flushBehavior] instead"))); +/*! + @abstract deprecated + @param flushBehavior deprecated + */ ++ (void)setFlushBehavior:(FBInsightsFlushBehavior)flushBehavior __attribute__((deprecated("use [FBAppEvents setFlushBehavior] instead"))); +/*! + @abstract deprecated + */ ++ (void)flush __attribute__((deprecated("use [FBAppEvents flush] instead"))); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h new file mode 100644 index 0000000..511bf3b --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLikeControl.h @@ -0,0 +1,172 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSDKMacros.h" + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlAuxiliaryPosition) + + @abstract Specifies the position of the auxiliary view relative to the like button. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlAuxiliaryPosition) +{ + /*! The auxiliary view is inline with the like button. */ + FBLikeControlAuxiliaryPositionInline, + /*! The auxiliary view is above the like button. */ + FBLikeControlAuxiliaryPositionTop, + /*! The auxiliary view is below the like button. */ + FBLikeControlAuxiliaryPositionBottom, +}; + +/*! + @abstract Converts an FBLikeControlAuxiliaryPosition to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlAuxiliaryPosition(FBLikeControlAuxiliaryPosition auxiliaryPosition); + +/*! + @typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) + + @abstract Specifies the horizontal alignment for FBLikeControlStyleStandard with + FBLikeControlAuxiliaryPositionTop or FBLikeControlAuxiliaryPositionBottom. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlHorizontalAlignment) +{ + /*! The subviews are left aligned. */ + FBLikeControlHorizontalAlignmentLeft, + /*! The subviews are center aligned. */ + FBLikeControlHorizontalAlignmentCenter, + /*! The subviews are right aligned. */ + FBLikeControlHorizontalAlignmentRight, +}; + +/*! + @abstract Converts an FBLikeControlHorizontalAlignment to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlHorizontalAlignment(FBLikeControlHorizontalAlignment horizontalAlignment); + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlObjectType) + + @abstract Specifies the type of object referenced by the objectID of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlObjectType) +{ + /*! The objectID refers to an unknown object type. */ + FBLikeControlObjectTypeUnknown = 0, + /*! The objectID refers to an Open Graph object. */ + FBLikeControlObjectTypeOpenGraphObject, + /*! The objectID refers to a Page object. */ + FBLikeControlObjectTypePage, +}; + +/*! + @abstract Converts an FBLikeControlObjectType to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlObjectType(FBLikeControlObjectType objectType); + +/*! + @typedef NS_ENUM (NSUInteger, FBLikeControlStyle) + + @abstract Specifies the style of a like control. + */ +typedef NS_ENUM(NSUInteger, FBLikeControlStyle) +{ + /*! Displays the button and the social sentence. */ + FBLikeControlStyleStandard = 0, + /*! Displays the button and a box that contains the like count. */ + FBLikeControlStyleBoxCount, + /*! Displays the button only. */ + FBLikeControlStyleButton, +}; + +/*! + @abstract Converts an FBLikeControlStyle to an NSString. + */ +FBSDK_EXTERN NSString *NSStringFromFBLikeControlStyle(FBLikeControlStyle style); + +/*! + @class FBLikeControl + + @abstract UI control to like an object in the Facebook graph. + + @discussion Taps on the like button within this control will invoke an API call to the Facebook app through a + fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update + with the new state and send actions for the UIControlEventValueChanged event. + */ +@interface FBLikeControl : UIControl + +/*! + @abstract The foreground color to use for the content of the receiver. + */ +@property (nonatomic, strong) UIColor *foregroundColor; + +/*! + @abstract The position for the auxiliary view for the receiver. + + @see FBLikeControlAuxiliaryPosition + */ +@property (nonatomic, assign) FBLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; + +/*! + @abstract The text alignment of the social sentence. + + @discussion This value is only valid for FBLikeControlStyleStandard with FBLikeControlAuxiliaryPositionTop|Bottom. + */ +@property (nonatomic, assign) FBLikeControlHorizontalAlignment likeControlHorizontalAlignment; + +/*! + @abstract The style to use for the receiver. + + @see FBLikeControlStyle + */ +@property (nonatomic, assign) FBLikeControlStyle likeControlStyle; + +/*! + @abstract The objectID for the object to like. + + @discussion This value may be an Open Graph object ID or a string representation of an URL that describes an + Open Graph object. The objects may be public objects, like pages, or objects that are defined by your application. + */ +@property (nonatomic, copy) NSString *objectID; + +/*! + @abstract The type of object referenced by the objectID. + + @discussion If the objectType is unknown, the control will determine the objectType by querying the server with the + objectID. Specifying a value for the objectType is an optimization that should be used if the type is known by the + consumer. Consider setting the objectType if you know your objectType when setting the objectID. + */ +@property (nonatomic, assign) FBLikeControlObjectType objectType; + +/*! + @abstract The preferred maximum width (in points) for autolayout. + + @discussion This property affects the size of the receiver when layout constraints are applied to it. During layout, + if the text extends beyond the width specified by this property, the additional text is flowed to one or more new + lines, thereby increasing the height of the receiver. + */ +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +/*! + @abstract If YES, a sound is played when the receiver is toggled. + + @default YES + */ +@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h new file mode 100644 index 0000000..ba15437 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLinkShareParams.h @@ -0,0 +1,81 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBLinkShareParams + + @abstract + This object is used to encapsulate state for parameters to a share a link, + typically with the Facebook Native Share Dialog or the Message Dialog. + */ +@interface FBLinkShareParams : FBDialogsParams + +/*! @abstract The URL link to be attached to the post. Only "http" or "https" + schemes are supported. */ +@property (nonatomic, copy) NSURL *link; + +/*! @abstract The name, or title associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *name; + +/*! @abstract The caption to be used with the link. Is only used if the link is + non-nil. */ +@property (nonatomic, copy) NSString *caption; + +/*! @abstract The description associated with the link. Is only used if the + link is non-nil. */ +@property (nonatomic, copy) NSString *linkDescription; + +/*! @abstract The link to a thumbnail to associate with the post. Is only used + if the link is non-nil. Only "http" or "https" schemes are supported. Note that this + property should not be used to share photos; see the photos property. */ +@property (nonatomic, copy) NSURL *picture; + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract A text reference for the category of the post, used on Facebook + Insights. */ +@property (nonatomic, copy) NSString *ref; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! + @abstract Designated initializer + @param link the required link to share + @param name the optional name to describe the share + @param caption the optional caption to describe the share + @param description the optional description to describe the share + @param picture the optional url to use as the share's image +*/ +- (instancetype)initWithLink:(NSURL *)link + name:(NSString *)name + caption:(NSString *)caption + description:(NSString *)description + picture:(NSURL *)picture; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h new file mode 100644 index 0000000..8f9fcbd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginTooltipView.h @@ -0,0 +1,92 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBTooltipView.h" + +@protocol FBLoginTooltipViewDelegate; + +/*! + @class FBLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBLoginView` may display this view automatically. If you do + not use the `FBLoginView`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBLoginTooltipViewDelegate` delegate. + + By default, the `FBLoginTooltipView` is not added to the superview until it is + determined the app has migrated to the new login experience. You can override this + (e.g., to test the UI layout) by implementing the delegate or setting `forceDisplay` to YES. + + */ +@interface FBLoginTooltipView : FBTooltipView + +/*! @abstract the delegate */ +@property (nonatomic, assign) id delegate; + +/*! @abstract if set to YES, the view will always be displayed and the delegate's + `loginTooltipView:shouldAppear:` will NOT be called. */ +@property (nonatomic, assign) BOOL forceDisplay; + +@end + +/*! + @protocol + + @abstract + The `FBLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginTooltipView` objects. + */ +@protocol FBLoginTooltipViewDelegate + +@optional + +/*! + @abstract + Asks the delegate if the tooltip view should appear + + @param view The tooltip view. + @param appIsEligible The value fetched from the server identifying if the app + is eligible for the new login experience. + + @discussion Use this method to customize display behavior. + */ +- (BOOL)loginTooltipView:(FBLoginTooltipView *)view shouldAppear:(BOOL)appIsEligible; + +/*! + @abstract + Tells the delegate the tooltip view will appear, specifically after it's been + added to the super view but before the fade in animation. + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillAppear:(FBLoginTooltipView *)view; + +/*! + @abstract + Tells the delegate the tooltip view will not appear (i.e., was not + added to the super view). + + @param view The tooltip view. + */ +- (void)loginTooltipViewWillNotAppear:(FBLoginTooltipView *)view; + + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h new file mode 100644 index 0000000..8e2ed93 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBLoginView.h @@ -0,0 +1,224 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphUser.h" +#import "FBSession.h" +#import "FBTooltipView.h" + +@protocol FBLoginViewDelegate; + +/*! + @typedef + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBLoginViewTooltipBehavior) { + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by server round trip) */ + FBLoginViewTooltipBehaviorDefault = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBLoginViewTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBLoginTooltipView` instance. */ + FBLoginViewTooltipBehaviorDisable = 2 +}; + +/*! + @class FBLoginView + @abstract FBLoginView is a custom UIView that renders a button to login or logout based on the + state of `FBSession.activeSession` + + @discussion This view is closely associated with `FBSession.activeSession`. Upon initialization, + it will attempt to open an active session without UI if the current active session is not open. + + The FBLoginView instance also monitors for changes to the active session. + + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@interface FBLoginView : UIView + +/*! + @abstract + The permissions to login with. Defaults to nil, meaning basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +@property (readwrite, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +/*! + @abstract + The login behavior for the active session if the user logs in via this view + + @discussion + The default value is FBSessionLoginBehaviorWithFallbackToWebView. + */ +@property (nonatomic) FBSessionLoginBehavior loginBehavior; + +/*! + @abstract + Gets or sets the desired tooltip behavior. + */ +@property (nonatomic, assign) FBLoginViewTooltipBehavior tooltipBehavior; + +/*! + @abstract + Gets or sets the desired tooltip color style. + */ +@property (nonatomic, assign) FBTooltipColorStyle tooltipColorStyle; + +/*! + @abstract + Initializes and returns an `FBLoginView` object. The underlying session has basic permissions granted to it. + */ +- (instancetype)init; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred. + */ +- (instancetype)initWithPermissions:(NSArray *)permissions __attribute__((deprecated)); + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. A value of nil will indicates basic permissions. + + */ +- (instancetype)initWithReadPermissions:(NSArray *)readPermissions; + +/*! + @method + + @abstract + Initializes and returns an `FBLoginView` object constructed with the specified permissions. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience An audience for published posts; note that FBSessionDefaultAudienceNone is not valid + for permission requests that include publish or manage permissions. + + */ +- (instancetype)initWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience; + +/*! + @abstract + The delegate object that receives updates for selection and display control. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +@end + +/*! + @protocol + + @abstract + The `FBLoginViewDelegate` protocol defines the methods used to receive event + notifications from `FBLoginView` objects. + + @discussion + Please note: Since FBLoginView observes the active session, using multiple FBLoginView instances + in different parts of your app can result in each instance's delegates being notified of changes + for one event. + */ +@protocol FBLoginViewDelegate + +@optional + +/*! + @abstract + Tells the delegate that the view is now in logged in mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that the view is has now fetched user info + + @param loginView The login view that transitioned its view mode + + @param user The user info object describing the logged in user + */ +- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView + user:(id)user; + +/*! + @abstract + Tells the delegate that the view is now in logged out mode + + @param loginView The login view that transitioned its view mode + */ +- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView; + +/*! + @abstract + Tells the delegate that there is a communication or authorization error. + + @param loginView The login view that transitioned its view mode + @param error An error object containing details of the error. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginView:(FBLoginView *)loginView + handleError:(NSError *)error; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h new file mode 100644 index 0000000..ddf31a1 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBNativeDialogs.h @@ -0,0 +1,126 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBAppCall.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBShareDialogParams.h" + +@class FBSession; +@protocol FBOpenGraphAction; + +// note that the following class and types are deprecated in favor of FBDialogs and its methods + +/*! + @typedef FBNativeDialogResult enum + + @abstract + Please note that this enum and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogResult` and its related methods. + */ +typedef NS_ENUM(NSUInteger, FBNativeDialogResult) { + /*! Indicates that the dialog action completed successfully. */ + FBNativeDialogResultSucceeded, + /*! Indicates that the dialog action was cancelled (either by the user or the system). */ + FBNativeDialogResultCancelled, + /*! Indicates that the dialog could not be shown (because not on ios6 or ios6 auth was not used). */ + FBNativeDialogResultError +} +__attribute__((deprecated)); + +/*! + @typedef + + @abstract + Please note that `FBShareDialogHandler` and its related methods have been deprecated, please migrate your + code to use `FBOSIntegratedShareDialogHandler` and its related methods. + */ +typedef void (^FBShareDialogHandler)(FBNativeDialogResult result, NSError *error) +__attribute__((deprecated)); + +/*! + @class FBNativeDialogs + + @abstract + Please note that `FBNativeDialogs` has been deprecated, please migrate your + code to use `FBDialogs`. + */ +@interface FBNativeDialogs : NSObject + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param initialText deprecated + @param image deprecated + @param url deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + image:(UIImage *)image + url:(NSURL *)url + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param initialText deprecated + @param images deprecated + @param urls deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `presentOSIntegratedShareDialogModallyFrom`. + @param viewController deprecated + @param session deprecated + @param initialText deprecated + @param images deprecated + @param urls deprecated + @param handler deprecated + */ ++ (BOOL)presentShareDialogModallyFrom:(UIViewController *)viewController + session:(FBSession *)session + initialText:(NSString *)initialText + images:(NSArray *)images + urls:(NSArray *)urls + handler:(FBShareDialogHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Please note that this method has been deprecated, please migrate your + code to use `FBDialogs` and the related method `canPresentOSIntegratedShareDialogWithSession`. + @param session deprecated + */ ++ (BOOL)canPresentShareDialogWithSession:(FBSession *)session __attribute__((deprecated)); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h new file mode 100644 index 0000000..2bf8334 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphAction.h @@ -0,0 +1,137 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +@protocol FBGraphPlace; +@protocol FBGraphUser; + +/*! + @protocol + + @abstract + The `FBOpenGraphAction` protocol is the base protocol for use in posting and retrieving Open Graph actions. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphAction` in order + implement typed access to your application's custom actions. + + @discussion + Represents an Open Graph custom action, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphAction + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the action's ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to action's start time + */ +@property (retain, nonatomic) NSString *start_time; + +/*! + @property + @abstract Typed access to action's end time + */ +@property (retain, nonatomic) NSString *end_time; + +/*! + @property + @abstract Typed access to action's publication time + */ +@property (retain, nonatomic) NSString *publish_time; + +/*! + @property + @abstract Typed access to action's creation time + */ +@property (retain, nonatomic) NSString *created_time; + +/*! + @property + @abstract Typed access to action's expiration time + */ +@property (retain, nonatomic) NSString *expires_time; + +/*! + @property + @abstract Typed access to action's ref + */ +@property (retain, nonatomic) NSString *ref; + +/*! + @property + @abstract Typed access to action's user message + */ +@property (retain, nonatomic) NSString *message; + +/*! + @property + @abstract Typed access to action's place + */ +@property (retain, nonatomic) id place; + +/*! + @property + @abstract Typed access to action's tags + */ +@property (retain, nonatomic) NSArray *tags; + +/*! + @property + @abstract Typed access to action's image(s) + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to action's from-user + */ +@property (retain, nonatomic) id from; + +/*! + @property + @abstract Typed access to action's likes + */ +@property (retain, nonatomic) NSArray *likes; + +/*! + @property + @abstract Typed access to action's application + */ +@property (retain, nonatomic) id application; + +/*! + @property + @abstract Typed access to action's comments + */ +@property (retain, nonatomic) NSArray *comments; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h new file mode 100644 index 0000000..b96ee0c --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionParams.h @@ -0,0 +1,54 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" +#import "FBOpenGraphAction.h" +#import "FBSDKMacros.h" + +FBSDK_EXTERN NSString *const FBPostObject; + +/*! + @class FBOpenGraphActionParams + + @abstract + This object is used to encapsulate state for parameters to an Open Graph share, + typically used with the Native Share Dialog or Message Dialog. + */ +@interface FBOpenGraphActionParams : FBDialogsParams + +/*! @abstract The Open Graph action to be published. */ +@property (nonatomic, retain) id action; + +/*! @abstract The name of the property representing the primary target of the Open + Graph action, which will be displayed as a preview in the dialog. */ +@property (nonatomic, copy) NSString *previewPropertyName; + +/*! @abstract The fully qualified type of the Open Graph action. */ +@property (nonatomic, copy) NSString *actionType; + +/*! + @abstract Designated initializer + @param action The action object, typically a dictionary based object created + from `[FBGraphObject openGraphActionForPost]`. + @param actionType The open graph action type defined in your application settings. + Typically, either a common open graph type like "books.reads", or a custom ":". + @param previewPropertyName The identifier for object in the open graph action. For example, for books.reads + this would be "book". +*/ +- (instancetype)initWithAction:(id)action actionType:(NSString *)actionType previewPropertyName:(NSString *)previewPropertyName; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h new file mode 100644 index 0000000..19f11a9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphActionShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBOpenGraphActionParams.h" + +/*! + @class FBOpenGraphActionShareDialogParams + + @abstract Deprecated. Use `FBOpenGraphActionParams` instead. + */ +__attribute__((deprecated)) +@interface FBOpenGraphActionShareDialogParams : FBOpenGraphActionParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h new file mode 100644 index 0000000..e6238ba --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBOpenGraphObject.h @@ -0,0 +1,87 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObject.h" + +/*! + @protocol + + @abstract + The `FBOpenGraphObject` protocol is the base protocol for use in posting and retrieving Open Graph objects. + It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphObject` in order + implement typed access to your application's custom objects. + + @discussion + Represents an Open Graph custom object, to be used directly, or from which to + derive custom action protocols with custom properties. + */ +@protocol FBOpenGraphObject + +/*! + @abstract use objectID instead + @deprecated use objectID instead + */ +@property (retain, nonatomic) NSString *id __attribute__ ((deprecated("use objectID instead"))); + +/*! + @property + @abstract Typed access to the object's ID. + @discussion Note this typically refers to the "id" field of the graph object (i.e., equivalent + to `[self objectForKey:@"id"]`) but is differently named to avoid conflicting with Apple's + non-public selectors. + */ +@property (retain, nonatomic) NSString *objectID; + +/*! + @property + @abstract Typed access to the object's type, which is a string in the form mynamespace:mytype + */ +@property (retain, nonatomic) NSString *type; + +/*! + @property + @abstract Typed access to object's title + */ +@property (retain, nonatomic) NSString *title; + +/*! + @property + @abstract Typed access to the object's image property + */ +@property (retain, nonatomic) id image; + +/*! + @property + @abstract Typed access to the object's url property + */ +@property (retain, nonatomic) id url; + +/*! + @abstract Typed access to the object's description property. + @discussion Note this typically refers to the "description" field of the graph object (i.e., equivalent + to `[self objectForKey:@"description"]`) but is differently named to avoid conflicting with Apple's + non-public selectors.*/ +@property (retain, nonatomic) id objectDescription; + +/*! + @property + @abstract Typed access to action's data, which is a dictionary of custom properties + */ +@property (retain, nonatomic) id data; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPeoplePickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPeoplePickerViewController.h new file mode 100644 index 0000000..f970163 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPeoplePickerViewController.h @@ -0,0 +1,96 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBGraphObjectPickerViewController.h" + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendSortOrdering) + + @abstract Indicates the order in which friends should be listed in the friend picker. + */ +typedef NS_ENUM(NSUInteger, FBFriendSortOrdering) { + /*! Sort friends by first, middle, last names. */ + FBFriendSortByFirstName = 0, + /*! Sort friends by last, first, middle names. */ + FBFriendSortByLastName +}; + +/*! + @typedef NS_ENUM (NSUInteger, FBFriendDisplayOrdering) + + @abstract Indicates whether friends should be displayed first-name-first or last-name-first. + */ +typedef NS_ENUM(NSUInteger, FBFriendDisplayOrdering) { + /*! Display friends as First Middle Last. */ + FBFriendDisplayByFirstName = 0, + /*! Display friends as Last First Middle. */ + FBFriendDisplayByLastName, +}; + + +/*! + @class + + @abstract + The `FBPeoplePickerViewController` class is an abstract controller object that manages + the user interface for displaying and selecting people. + + @discussion + When the `FBPeoplePickerViewController` view loads it creates a `UITableView` object + where the people will be displayed. You can access this view through the `tableView` + property. The people display can be sorted by first name or last name. People's + names can be displayed with the first name first or the last name first. + + The `delegate` property may be set to an object that conforms to the + protocol, as defined by . The graph object passed to + the delegate conforms to the protocol. + */ +@interface FBPeoplePickerViewController : FBGraphObjectPickerViewController + +/*! + @abstract + A Boolean value that specifies whether multi-select is enabled. + */ +@property (nonatomic) BOOL allowsMultipleSelection; + +/*! + @abstract + The profile ID of the user whose 'user_friends' permission is being used. + */ +@property (nonatomic, copy) NSString *userID; + +/*! + @abstract + The list of people that are currently selected in the veiw. + The items in the array are objects. + */ +@property (nonatomic, copy, readonly) NSArray *selection; + +/*! + @abstract + The order in which people are sorted in the display. + */ +@property (nonatomic) FBFriendSortOrdering sortOrdering; + +/*! + @abstract + The order in which people's names are displayed. + */ +@property (nonatomic) FBFriendDisplayOrdering displayOrdering; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h new file mode 100644 index 0000000..4c389fd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPhotoParams.h @@ -0,0 +1,51 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBDialogsParams.h" + +/*! + @class FBPhotoParams + + @abstract + This object is used to encapsulate state for parameters to share photos, + typically with the Facebook Native Share Dialog or Message Dialog + */ +@interface FBPhotoParams : FBDialogsParams + +/*! @abstract An array of NSStrings or FBGraphUsers to tag in the post. + If using NSStrings, the values must represent the IDs of the users to tag. */ +@property (nonatomic, copy) NSArray *friends; + +/*! @abstract An NSString or FBGraphPlace to tag in the status update. If + NSString, the value must be the ID of the place to tag. */ +@property (nonatomic, copy) id place; + +/*! @abstract If YES, treats any data failures (e.g. failures when getting + data for IDs passed through "friends" or "place") as a fatal error, and will not + continue with the status update. */ +@property (nonatomic, assign) BOOL dataFailuresFatal; + +/*! @abstract An array of UIImages representing photos to be shared. Only + six or fewer images are supported. */ +@property (nonatomic, copy) NSArray *photos; + +/*! @abstract Designated initializer. + @param photos the array of UIImages +*/ +- (instancetype)initWithPhotos:(NSArray *)photos; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h new file mode 100644 index 0000000..c8c0e04 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBPlacePickerViewController.h @@ -0,0 +1,183 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBCacheDescriptor.h" +#import "FBGraphObjectPickerViewController.h" +#import "FBGraphPlace.h" + +@protocol FBPlacePickerDelegate; + +/*! + @class FBPlacePickerViewController + + @abstract + The `FBPlacePickerViewController` class creates a controller object that manages + the user interface for displaying and selecting nearby places. + + @discussion + When the `FBPlacePickerViewController` view loads it creates a `UITableView` object + where the places near a given location will be displayed. You can access this view + through the `tableView` property. + + The place data can be pre-fetched and cached prior to using the view controller. The + cache is setup using an object that can trigger the + data fetch. Any place data requests will first check the cache and use that data. + If the place picker is being displayed cached data will initially be shown before + a fresh copy is retrieved. + + The `delegate` property may be set to an object that conforms to the + protocol. The `delegate` object will receive updates related to place selection and + data changes. The delegate can also be used to filter the places to display in the + picker. + */ +@interface FBPlacePickerViewController : FBGraphObjectPickerViewController + +/*! + @abstract + The coordinates to use for place discovery. + */ +@property (nonatomic) CLLocationCoordinate2D locationCoordinate; + +/*! + @abstract + The radius to use for place discovery. + */ +@property (nonatomic) NSInteger radiusInMeters; + +/*! + @abstract + The maximum number of places to fetch. + */ +@property (nonatomic) NSInteger resultsLimit; + +/*! + @abstract + The search words used to narrow down the results returned. + */ +@property (nonatomic, copy) NSString *searchText; + +/*! + @abstract + The place that is currently selected in the view. This is nil + if nothing is selected. + */ +@property (nonatomic, retain, readonly) id selection; + +/*! + @abstract + Configures the properties used in the caching data queries. + + @discussion + Cache descriptors are used to fetch and cache the data used by the view controller. + If the view controller finds a cached copy of the data, it will + first display the cached content then fetch a fresh copy from the server. + + @param cacheDescriptor The containing the cache query properties. + */ +- (void)configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor; + +/*! + @method + + @abstract + Creates a cache descriptor with additional fields and a profile ID for use with the + `FBPlacePickerViewController` object. + + @discussion + An `FBCacheDescriptor` object may be used to pre-fetch data before it is used by + the view controller. It may also be used to configure the `FBPlacePickerViewController` + object. + + @param locationCoordinate The coordinates to use for place discovery. + @param radiusInMeters The radius to use for place discovery. + @param searchText The search words used to narrow down the results returned. + @param resultsLimit The maximum number of places to fetch. + @param fieldsForRequest Addtional fields to fetch when making the Graph API call to get place data. + */ ++ (FBCacheDescriptor *)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate + radiusInMeters:(NSInteger)radiusInMeters + searchText:(NSString *)searchText + resultsLimit:(NSInteger)resultsLimit + fieldsForRequest:(NSSet *)fieldsForRequest; + +@end + +/*! + @protocol + + @abstract + The `FBPlacePickerDelegate` protocol defines the methods used to receive event + notifications and allow for deeper control of the + view. + + The methods of correspond to . + If a pair of corresponding methods are implemented, the + method is called first. + */ +@protocol FBPlacePickerDelegate +@optional + +/*! + @abstract + Tells the delegate that data has been loaded. + + @discussion + The object's `tableView` property is automatically + reloaded when this happens. However, if another table view, for example the + `UISearchBar` is showing data, then it may also need to be reloaded. + + @param placePicker The place picker view controller whose data changed. + */ +- (void)placePickerViewControllerDataDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Tells the delegate that the selection has changed. + + @param placePicker The place picker view controller whose selection changed. + */ +- (void)placePickerViewControllerSelectionDidChange:(FBPlacePickerViewController *)placePicker; + +/*! + @abstract + Asks the delegate whether to include a place in the list. + + @discussion + This can be used to implement a search bar that filters the places list. + + If -[ graphObjectPickerViewController:shouldIncludeGraphObject:] + is implemented and returns NO, this method is not called. + + @param placePicker The place picker view controller that is requesting this information. + @param place An object representing the place. + */ +- (BOOL)placePickerViewController:(FBPlacePickerViewController *)placePicker + shouldIncludePlace:(id)place; + +/*! + @abstract + Called if there is a communication error. + + @param placePicker The place picker view controller that encountered the error. + @param error An error object containing details of the error. + */ +- (void)placePickerViewController:(FBPlacePickerViewController *)placePicker + handleError:(NSError *)error; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h new file mode 100644 index 0000000..6ebdc52 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBProfilePictureView.h @@ -0,0 +1,76 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBProfilePictureCropping enum + + @abstract Specify the cropping treatment of the profile picture. + */ +typedef NS_ENUM(NSUInteger, FBProfilePictureCropping) { + + /*! Square (default) - the square version that the Facebook user defined. */ + FBProfilePictureCroppingSquare = 0, + + /*! Original - the original profile picture, as uploaded. */ + FBProfilePictureCroppingOriginal = 1 + +}; + +/*! + @class + @abstract + An instance of `FBProfilePictureView` is used to display a profile picture. + + The default behavior of this control is to center the profile picture + in the view and shrinks it, if necessary, to the view's bounds, preserving the aspect ratio. The smallest + possible image is downloaded to ensure that scaling up never happens. Resizing the view may result in + a different size of the image being loaded. Canonical image sizes are documented in the "Pictures" section + of https://developers.facebook.com/docs/reference/api. + */ +@interface FBProfilePictureView : UIView + +/*! + @abstract + The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + */ +@property (copy, nonatomic) NSString *profileID; + +/*! + @abstract + The cropping to use for the profile picture. + */ +@property (nonatomic) FBProfilePictureCropping pictureCropping; + +/*! + @abstract + Initializes and returns a profile view object. + */ +- (instancetype)init; + + +/*! + @abstract + Initializes and returns a profile view object for the given Facebook ID and cropping. + + @param profileID The Facebook ID of the user, place or object for which a picture should be fetched and displayed. + @param pictureCropping The cropping to use for the profile picture. + */ +- (instancetype)initWithProfileID:(NSString *)profileID + pictureCropping:(FBProfilePictureCropping)pictureCropping; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequest.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequest.h new file mode 100644 index 0000000..308c55d --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequest.h @@ -0,0 +1,662 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBOpenGraphAction.h" +#import "FBOpenGraphObject.h" +#import "FBRequestConnection.h" +#import "FBSDKMacros.h" + +/*! The base URL used for graph requests */ +FBSDK_EXTERN NSString *const FBGraphBasePath __attribute__((deprecated)); + +// up-front decl's +@protocol FBRequestDelegate; +@class FBSession; +@class UIImage; + +/*! + @typedef FBRequestState + + @abstract + Deprecated - do not use in new code. + + @discussion + FBRequestState is retained from earlier versions of the SDK to give existing + apps time to remove dependency on this. + + @deprecated + */ +typedef NSUInteger FBRequestState __attribute__((deprecated)); + +/*! + @class FBRequest + + @abstract + The `FBRequest` object is used to setup and manage requests to the Facebook Graph API. + This class provides helper methods that simplify the connection and response handling. + + @discussion + An object is required for all authenticated uses of `FBRequest`. + Requests that do not require an unauthenticated user are also supported and + do not require an object to be passed in. + + An instance of `FBRequest` represents the arguments and setup for a connection + to Facebook. After creating an `FBRequest` object it can be used to setup a + connection to Facebook through the object. The + object is created to manage a single connection. To + cancel a connection use the instance method in the class. + + An `FBRequest` object may be reused to issue multiple connections to Facebook. + However each instance will manage one connection. + + Class and instance methods prefixed with **start** can be used to perform the + request setup and initiate the connection in a single call. + + */ +@interface FBRequest : NSObject { +@private + id _delegate; + NSString * _url; + NSString * _versionPart; + NSURLConnection * _connection; + NSMutableData * _responseText; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + FBRequestState _state; +#pragma GCC diagnostic pop + NSError * _error; + BOOL _sessionDidExpire; + id _graphObject; +} + +/*! + @methodgroup Creating a request + + @method + Calls with the default parameters. + */ +- (instancetype)init; + +/*! + @method + Calls with default parameters + except for the ones provided to this method. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Initializes an `FBRequest` object for a Graph API request call. + + @discussion + Note that this only sets properties on the `FBRequest` object. + + To send the request, initialize an object, add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled + parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. The default is value of nil implies a GET. + */ +- (instancetype)initWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + @abstract + Initialize a `FBRequest` object that will do a graph request. + + @discussion + Note that this only sets properties on the `FBRequest`. + + To send the request, initialize a , add this request, + and send <[FBRequestConnection start]>. See other methods on this + class for shortcuts to simplify this process. + + @param session The session object representing the identity of the Facebook user making + the request. A nil value indicates a request that requires no token; to + use the active session pass `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + */ +- (instancetype)initForPostWithSession:(FBSession *)session + graphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @abstract + The parameters for the request. + + @discussion + May be used to read the parameters that were automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + + `NSString` parameters are used to generate URL parameter values or JSON + parameters. `NSData` and `UIImage` parameters are added as attachments + to the HTTP body and referenced by name in the URL and/or JSON. + */ +@property (nonatomic, retain, readonly) NSMutableDictionary *parameters; + +/*! + @abstract + The session object to use for the request. + + @discussion + May be used to read the session that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) FBSession *session; + +/*! + @abstract + The Graph API endpoint to use for the request, for example "me". + + @discussion + May be used to read the Graph API endpoint that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *graphPath; + +/*! + @abstract + The HTTPMethod to use for the request, for example "GET" or "POST". + + @discussion + May be used to read the HTTP method that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, copy) NSString *HTTPMethod; + +/*! + @abstract + The graph object to post with the request. + + @discussion + May be used to read the graph object that was automatically set during + the object initiliazation. Make any required modifications prior to + sending the request. + */ +@property (nonatomic, retain) id graphObject; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + Overrides the default version for a single request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. Sometimes it is preferable to explicitly set the version for a request, which can be + accomplished in one of two ways. The first is to call this method and set an override version part. The second + is approach is to include the version part in the api path, for example @"v2.0/me/friends" + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Starts a connection to the Facebook API. + + @discussion + This is used to start an API call to Facebook and call the block when the + request completes with a success, error, or cancel. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + The handler will be invoked on the main thread. + */ +- (FBRequestConnection *)startWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @methodgroup FBRequestConnection start methods + + @abstract + These methods start an . + + @discussion + These methods simplify the process of preparing a request and starting + the connection. The methods handle initializing an `FBRequest` object, + initializing a object, adding the `FBRequest` + object to the to the , and finally starting the + connection. + */ + +/*! + @methodgroup FBRequest factory methods + + @abstract + These methods initialize a `FBRequest` for common scenarios. + + @discussion + These simplify the process of preparing a request to send. These + initialize a `FBRequest` based on strongly typed parameters that are + specific to the scenario. + + These method do not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + */ + +// request +// +// Summary: +// Helper methods used to create common request objects which can be used to create single or batch connections +// +// session: - the session object representing the identity of the +// Facebook user making the request; nil implies an +// unauthenticated request; default=nil + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me" endpoint, using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's identity. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an object representing the + user's identity. + + Note you may change the session property after construction if a session other than + the active session is preferred. + */ ++ (FBRequest *)requestForMe; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "me/friends" endpoint using the active session. + + @discussion + Simplifies preparing a request to retrieve the user's friends. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing the + user's friends. + */ ++ (FBRequest *)requestForMyFriends; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to upload a photo to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a photo. + + To post a photo to a specific album, get the `FBRequest` returned from this method + call, then modify the request parameters by adding the album ID to an "album" key. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param photo A `UIImage` for the photo to upload. + */ ++ (FBRequest *)requestForUploadPhoto:(UIImage *)photo; + +/*! + + @method + + @abstract + Creates a request representing a Graph API call to upload a video to the app's album using the active session. + + @discussion + Simplifies preparing a request to post a video. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param filePath A `NSString` for the video file to upload. + */ ++ (FBRequest *)requestForUploadVideo:(NSString *)filePath; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message; + +/*! + @method + + @abstract + Creates a request representing a status update. + + @discussion + Simplifies preparing a request to post a status update. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + */ ++ (FBRequest *)requestForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags; + +/*! + @method + + @abstract + Creates a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies preparing a request to search for places near a coordinate. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + A successful Graph API call will return an array of objects representing + the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + */ ++ (FBRequest *)requestForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText; + +/*! + @method + + @abstract + Creates a request representing the Graph API call to retrieve a Custom Audience "thirdy party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBRequest *)requestForCustomAudienceThirdPartyID:(FBSession *)session; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + */ ++ (FBRequest *)requestForGraphPath:(NSString *)graphPath; + +/*! + @method + + @abstract + Creates request representing a DELETE to a object. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object This can be an NSString, NSNumber or NSDictionary representing an object to delete + */ ++ (FBRequest *)requestForDeleteObject:(id)object; + +/*! + @method + + @abstract + Creates a request representing a POST for a graph object. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `requestForPostOpenGraphObject:` + */ ++ (FBRequest *)requestForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to make a Graph API call for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + */ ++ (FBRequest *)requestWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + */ ++ (FBRequest *)requestForPostOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to create a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description to be associated with the object. + @param objectProperties Any additional properties for the Open Graph object. + */ ++ (FBRequest *)requestForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param object The Open Graph object to update the existing object with. + */ ++ (FBRequest *)requestForUpdateOpenGraphObject:(id)object; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to update a user owned + Open Graph object for the active session. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The updated description of the Open Graph object. + @param objectProperties Any additional properties to update for the Open Graph object. + */ ++ (FBRequest *)requestForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties; + +/*! + @method + + @abstract + Returns a newly initialized request object that can be used to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the image property for an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call. + + This method does not initialize an object. To initiate the API + call first instantiate an object, add the request to this object, + then call the `start` method on the connection instance. + + @param image A `UIImage` for the image to upload. + */ ++ (FBRequest *)requestForUploadStagingResourceWithImage:(UIImage *)image; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h new file mode 100644 index 0000000..d7b7b03 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBRequestConnection.h @@ -0,0 +1,762 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBGraphObject.h" +#import "FBSDKMacros.h" + +// up-front decl's +@class FBRequest; +@class FBRequestConnection; +@class FBSession; +@class UIImage; + + +/*! + @attribute beta true + + @typedef FBRequestConnectionErrorBehavior enum + + @abstract Describes what automatic error handling behaviors to provide (if any). + + @discussion This is a bitflag enum that can be composed of different values. + + See FBError.h and FBErrorUtility.h for error category and user message details. + */ +typedef NS_OPTIONS(NSUInteger, FBRequestConnectionErrorBehavior) { + /*! The default behavior of none */ + FBRequestConnectionErrorBehaviorNone = 0, + + /*! This will retry any requests whose error category is classified as `FBErrorCategoryRetry`. + If the retry fails, the normal handler is invoked. */ + FBRequestConnectionErrorBehaviorRetry = 1, + + /*! This will automatically surface any SDK provided userMessage (at most one), after + retry attempts, but before any reconnects are tried. The alert will have one button + whose text can be localized with the key "FBE:AlertMessageButton". + + You should not display your own alert views in your request handler when specifying this + behavior. + */ + FBRequestConnectionErrorBehaviorAlertUser = 2, + + /*! This will automatically reconnect a session if the request failed due to an invalid token + that would otherwise close the session (such as an expired token or password change). Note + this will NOT reconnect a session if the user had uninstalled the app, or if the user had + disabled the app's slider in their privacy settings (in cases of iOS 6 system auth). + If the session is reconnected, this will transition the session state to FBSessionStateTokenExtended + which will invoke any state change handlers. Otherwise, the session is closed as normal. + + This behavior should not be used if the FBRequestConnection contains multiple + session instances. Further, when this behavior is used, you must not request new permissions + for the session until the connection is completed. + + Lastly, you should avoid using additional FBRequestConnections with the same session because + that will be subject to race conditions. + */ + FBRequestConnectionErrorBehaviorReconnectSession = 4, +}; + +/*! + Normally requests return JSON data that is parsed into a set of `NSDictionary` + and `NSArray` objects. + + When a request returns a non-JSON response, that response is packaged in + a `NSDictionary` using FBNonJSONResponseProperty as the key and the literal + response as the value. + */ +FBSDK_EXTERN NSString *const FBNonJSONResponseProperty; + +/*! + @typedef FBRequestHandler + + @abstract + A block that is passed to addRequest to register for a callback with the results of that + request once the connection completes. + + @discussion + Pass a block of this type when calling addRequest. This will be called once + the request completes. The call occurs on the UI thread. + + @param connection The `FBRequestConnection` that sent the request. + + @param result The result of the request. This is a translation of + JSON data to `NSDictionary` and `NSArray` objects. This + is nil if there was an error. + + @param error The `NSError` representing any error that occurred. + + */ +typedef void (^FBRequestHandler)(FBRequestConnection *connection, + id result, + NSError *error); + +/*! + @protocol + + @abstract + The `FBRequestConnectionDelegate` protocol defines the methods used to receive network + activity progress information from a . + */ +@protocol FBRequestConnectionDelegate + +@optional + +/*! + @method + + @abstract + Tells the delegate the request connection will begin loading + + @discussion + If the is created using one of the convenience factory methods prefixed with + start, the object returned from the convenience method has already begun loading and this method + will not be called when the delegate is set. + + @param connection The request connection that is starting a network request + @param isCached YES if the request can be fulfilled using cached data, otherwise NO indicating + the result will require a network request. + */ +- (void)requestConnectionWillBeginLoading:(FBRequestConnection *)connection + fromCache:(BOOL)isCached; + +/*! + @method + + @abstract + Tells the delegate the request connection finished loading + + @discussion + If the request connection completes without a network error occuring then this method is called. + Invocation of this method does not indicate success of every made, only that the + request connection has no further activity. Use the error argument passed to the FBRequestHandler + block to determine success or failure of each . + + This method is invoked after the completion handler for each . + + @param connection The request connection that successfully completed a network request + @param isCached YES if the request was fulfilled using cached data, otherwise NO indicating + a network request was completed. + */ +- (void)requestConnectionDidFinishLoading:(FBRequestConnection *)connection + fromCache:(BOOL)isCached; + +/*! + @method + + @abstract + Tells the delegate the request connection failed with an error + + @discussion + If the request connection fails with a network error then this method is called. The `error` + argument specifies why the network connection failed. The `NSError` object passed to the + FBRequestHandler block may contain additional information. + + This method is invoked after the completion handler for each and only if a network + request was made. If the request was fulfilled using cached data, this method is not called. + + @param connection The request connection that successfully completed a network request + @param error The `NSError` representing the network error that occurred, if any. May be nil + in some circumstances. Consult the `NSError` for the for reliable + failure information. + */ +- (void)requestConnection:(FBRequestConnection *)connection + didFailWithError:(NSError *)error; + +/*! + @method + + @abstract + Tells the delegate the request connection is going to retry some network operations + + @discussion + If some fail, may create a new instance to retry the failed + requests. This method is called before the new instance is started. You must set the delegate + property on `retryConnection` to continue to receive progress information. If a delegate is + set on `retryConnection` then -requestConnectionWillBeginLoading: will be invoked. + + This method is invoked after the completion handler for each and only if a network + request was made. If the request was fulfilled using cached data, this method is not called. + + @param connection The request connection that successfully completed a network request + @param retryConnection The new request connection that will retry the failed s + */ +- (void) requestConnection:(FBRequestConnection *)connection +willRetryWithRequestConnection:(FBRequestConnection *)retryConnection; + +/*! + @method + + @abstract + Tells the delegate how much data has been sent and is planned to send to the remote host + + @discussion + The byte count arguments refer to the aggregated objects, not a particular . + + Like `NSURLConnection`, the values may change in unexpected ways if data needs to be resent. + + @param connection The request connection transmitting data to a remote host + @param bytesWritten The number of bytes sent in the last transmission + @param totalBytesWritten The total number of bytes sent to the remote host + @param totalBytesExpectedToWrite The total number of bytes expected to send to the remote host + */ +- (void)requestConnection:(FBRequestConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; + +@end + +/*! + @class FBRequestConnection + + @abstract + The `FBRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBRequestConnection : NSObject + +/*! + @methodgroup Creating a request + */ + +/*! + @method + + Calls with a default timeout of 180 seconds. + */ +- (instancetype)init; + +/*! + @method + + @abstract + `FBRequestConnection` objects are used to issue one or more requests as a single + request/response connection with Facebook. + + @discussion + For a single request, the usual method for creating an `FBRequestConnection` + object is to call one of the **start* ** methods on . However, it is + allowable to init an `FBRequestConnection` object directly, and call + to add one or more request objects to the + connection, before calling start. + + Note that if requests are part of a batch, they must have an open + FBSession that has an access token associated with it. Alternatively a default App ID + must be set either in the plist or through an explicit call to <[FBSession defaultAppID]>. + + @param timeout The `NSTimeInterval` (seconds) to wait for a response before giving up. + */ + +- (instancetype)initWithTimeout:(NSTimeInterval)timeout; + +// properties + +/*! + @abstract + The request that will be sent to the server. + + @discussion + This property can be used to create a `NSURLRequest` without using + `FBRequestConnection` to send that request. It is legal to set this property + in which case the provided `NSMutableURLRequest` will be used instead. However, + the `NSMutableURLRequest` must result in an appropriate response. Furthermore, once + this property has been set, no more objects can be added to this + `FBRequestConnection`. + */ +@property (nonatomic, retain, readwrite) NSMutableURLRequest *urlRequest; + +/*! + @abstract + The raw response that was returned from the server. (readonly) + + @discussion + This property can be used to inspect HTTP headers that were returned from + the server. + + The property is nil until the request completes. If there was a response + then this property will be non-nil during the FBRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *urlResponse; + +/*! + @attribute beta true + + @abstract Set the automatic error handling behaviors. + @discussion This must be set before any requests are added. + + When using retry behaviors, note the FBRequestConnection instance + passed to the FBRequestHandler may be a different instance that the + one the requests were originally started on. + */ +@property (nonatomic, assign) FBRequestConnectionErrorBehavior errorBehavior; + +/*! + @abstract + The delegate object that receives updates. + */ +@property (nonatomic, assign) id delegate; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + + @param request A request to be included in the round-trip when start is called. + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + The handler will be invoked on the main thread. + + @param name An optional name for this request. This can be used to feed + the results of one request to the input of another in the same + `FBRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this connection. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. This request can be named + to allow for using the request's response in a subsequent request. + + @param request A request to be included in the round-trip when start is called. + + @param handler A handler to call back when the round-trip completes or times out. + + @param batchParameters The optional dictionary of parameters to include for this request + as described in [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + Examples include "depends_on", "name", or "omit_response_on_success". + */ +- (void)addRequest:(FBRequest *)request + completionHandler:(FBRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion + Errors are reported via the handler callback, even in cases where no + communication is attempted by the implementation of `FBRequestConnection`. In + such cases multiple error conditions may apply, and if so the following + priority (highest to lowest) is used: + + - `FBRequestConnectionInvalidRequestKey` -- this error is reported when an + cannot be encoded for transmission. + + - `FBRequestConnectionInvalidBatchKey` -- this error is reported when any + request in the connection cannot be encoded for transmission with the batch. + In this scenario all requests fail. + + This method cannot be called twice for an `FBRequestConnection` instance. + */ +- (void)start; + +/*! + @method + + @abstract + Signals that a connection should be logically terminated as the + application is no longer interested in a response. + + @discussion + Synchronously calls any handlers indicating the request was cancelled. Cancel + does not guarantee that the request-related processing will cease. It + does promise that all handlers will complete before the cancel returns. A call to + cancel prior to a start implies a cancellation of all requests associated + with the connection. + */ +- (void)cancel; + +/*! + @method + + @abstract + Overrides the default version for a batch request + + @discussion + The SDK automatically prepends a version part, such as "v2.0" to API paths in order to simplify API versioning + for applications. If you want to override the version part while using batch requests on the connection, call + this method to set the version for the batch request. + + @param version This is a string in the form @"v2.0" which will be used for the version part of an API path + */ +- (void)overrideVersionPartWith:(NSString *)version; + +/*! + @method + + @abstract + Simple method to make a graph API request for user info (/me), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMeWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request for user friends (/me/friends), creates an + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForMyFriendsWithCompletionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a photo. The request + uses the active session represented by `[FBSession activeSession]`. + + @param photo A `UIImage` for the photo to upload. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUploadPhoto:(UIImage *)photo + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API post of a status update. The request + uses the active session represented by `[FBSession activeSession]`. + + @param message The message to post. + @param place The place to checkin with, or nil. Place may be an fbid or a + graph object representing a place. + @param tags Array of friends to tag in the status update, each element + may be an fbid or a graph object representing a user. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostStatusUpdate:(NSString *)message + place:(id)place + tags:(id)tags + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing a Graph API call to the "search" endpoint + for a given location using the active session. + + @discussion + Simplifies starting a request to search for places near a coordinate. + + This method creates the necessary object and initializes and + starts an object. A successful Graph API call will + return an array of objects representing the nearby locations. + + @param coordinate The search coordinates. + + @param radius The search radius in meters. + + @param limit The maxiumum number of results to return. It is + possible to receive fewer than this because of the + radius and because of server limits. + + @param searchText The text to use in the query to narrow the set of places + returned. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPlacesSearchAtCoordinate:(CLLocationCoordinate2D)coordinate + radiusInMeters:(NSInteger)radius + resultsLimit:(NSInteger)limit + searchText:(NSString *)searchText + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request representing the Graph API call to retrieve a Custom Audience "third party ID" for the app's Facebook user. + Callers will send this ID back to their own servers, collect up a set to create a Facebook Custom Audience with, + and then use the resultant Custom Audience to target ads. + + @param session The FBSession to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the activeSession is used. + + @discussion + This method will throw an exception if <[FBSettings defaultAppID]> is `nil`. The appID won't be nil when the pList + includes the appID, or if it's explicitly set. + + The JSON in the request's response will include an "custom_audience_third_party_id" key/value pair, with the value being the ID retrieved. + This ID is an encrypted encoding of the Facebook user's ID and the invoking Facebook app ID. + Multiple calls with the same user will return different IDs, thus these IDs cannot be used to correlate behavior + across devices or applications, and are only meaningful when sent back to Facebook for creating Custom Audiences. + + The ID retrieved represents the Facebook user identified in the following way: if the specified session (or activeSession if the specified + session is `nil`) is open, the ID will represent the user associated with the activeSession; otherwise the ID will represent the user logged into the + native Facebook app on the device. If there is no native Facebook app, no one is logged into it, or the user has opted out + at the iOS level from ad tracking, then a `nil` ID will be returned. + + This method returns `nil` if either the user has opted-out (via iOS) from Ad Tracking, the app itself has limited event usage + via the `[FBAppEvents setLimitEventUsage]` flag, or a specific Facebook user cannot be identified. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForCustomAudienceThirdPartyID:(FBSession *)session + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to make a graph API request, creates an object for HTTP GET, + then uses an object to start the connection with Facebook. The + request uses the active session represented by `[FBSession activeSession]`. + + See + + @param graphPath The Graph API endpoint to use for the request, for example "me". + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to delete an object using the graph API, creates an object for + HTTP DELETE, then uses an object to start the connection with Facebook. + The request uses the active session represented by `[FBSession activeSession]`. + + @param object The object to delete, may be an NSString or NSNumber representing an fbid or an NSDictionary with an id property + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForDeleteObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Simple method to post an object using the graph API, creates an object for + HTTP POST, then uses to start a connection with Facebook. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param graphObject An object or open graph action to post. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + + @discussion This method is typically used for posting an open graph action. If you are only + posting an open graph object (without an action), consider using `startForPostOpenGraphObject:completionHandler:` + */ ++ (FBRequestConnection *)startForPostWithGraphPath:(NSString *)graphPath + graphObject:(id)graphObject + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` object for a Graph API call, instantiate an + object, add the request to the newly created + connection and finally start the connection. Use this method for + specifying the request parameters and HTTP Method. The request uses + the active session represented by `[FBSession activeSession]`. + + @param graphPath The Graph API endpoint to use for the request, for example "me". + + @param parameters The parameters for the request. A value of nil sends only the automatically handled parameters, for example, the access token. The default is nil. + + @param HTTPMethod The HTTP method to use for the request. A nil value implies a GET. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to create. Some common expected fields include "title", "image", "url", etc. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for creating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param type The fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name) + @param title The title of the Open Graph object. + @param image The link to an image to be associated with the Open Graph object. + @param url The url to be associated with the Open Graph object. + @param description The description for the object. + @param objectProperties Any additional properties for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForPostOpenGraphObjectWithType:(NSString *)type + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param object The Open Graph object to update the existing object with. + + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObject:(id)object + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Creates an `FBRequest` for updating a user owned Open Graph object, instantiate a + object, add the request to the newly created + connection and finally start the connection. The request uses + the active session represented by `[FBSession activeSession]`. + + @param objectId The id of the Open Graph object to update. + @param title The updated title of the Open Graph object. + @param image The updated link to an image to be associated with the Open Graph object. + @param url The updated url to be associated with the Open Graph object. + @param description The object's description. + @param objectProperties Any additional properties to update for the Open Graph object. + @param handler The handler block to call when the request completes with a success, error, or cancel action. + */ ++ (FBRequestConnection *)startForUpdateOpenGraphObjectWithId:(id)objectId + title:(NSString *)title + image:(id)image + url:(id)url + description:(NSString *)description + objectProperties:(NSDictionary *)objectProperties + completionHandler:(FBRequestHandler)handler; + +/*! + @method + + @abstract + Starts a request connection to upload an image + to create a staging resource. Staging resources allow you to post binary data + such as images, in preparation for a post of an open graph object or action + which references the image. The URI returned when uploading a staging resource + may be passed as the value for the image property of an open graph object or action. + + @discussion + This method simplifies the preparation of a Graph API call be creating the FBRequest + object and starting the request connection with a single method + + @param image A `UIImage` for the image to upload. + @param handler The handler block to call when the request completes. + */ ++ (FBRequestConnection *)startForUploadStagingResourceWithImage:(UIImage *)image + completionHandler:(FBRequestHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h new file mode 100644 index 0000000..2faed4e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSDKMacros.h @@ -0,0 +1,25 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifdef __cplusplus +#define FBSDK_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define FBSDK_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define FBSDK_STATIC_INLINE static inline diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSession.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSession.h new file mode 100644 index 0000000..870ab21 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSession.h @@ -0,0 +1,883 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import +#import + +#import "FBSDKMacros.h" + +// up-front decl's +@class FBAccessTokenData; +@class FBSession; +@class FBSessionTokenCachingStrategy; + +#define FB_SESSIONSTATETERMINALBIT (1 << 8) + +#define FB_SESSIONSTATEOPENBIT (1 << 9) + +/* + * Constants used by NSNotificationCenter for active session notification + */ + +/*! NSNotificationCenter name indicating that a new active session was set */ +FBSDK_EXTERN NSString *const FBSessionDidSetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that an active session was unset */ +FBSDK_EXTERN NSString *const FBSessionDidUnsetActiveSessionNotification; + +/*! NSNotificationCenter name indicating that the active session is open */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeOpenActiveSessionNotification; + +/*! NSNotificationCenter name indicating that there is no longer an open active session */ +FBSDK_EXTERN NSString *const FBSessionDidBecomeClosedActiveSessionNotification; + +/*! + @typedef FBSessionState enum + + @abstract Passed to handler block each time a session state changes + + @discussion A typical `FBSession` lifecycle will start with `FBSessionStateCreated`. If a cached + token is available, it will transition to `FBSessionStateCreatedTokenLoaded`. When attempting to + open a session, it will become `FBSessionStateCreatedOpening` internally before going to + `FBSessionStateOpen` or `FBSessionStateClosedLoginFailed`. From `FBSessionStateOpen` it can + go to `FBSessionStateOpenTokenExtended` (when more permissions were granted) or `FBSessionStateClosed`. + */ +typedef NS_ENUM(NSUInteger, FBSessionState) { + /*! One of two initial states indicating that no valid cached token was found */ + FBSessionStateCreated = 0, + /*! One of two initial session states indicating that a cached token was loaded; + when a session is in this state, a call to open* will result in an open session, + without UX or app-switching*/ + FBSessionStateCreatedTokenLoaded = 1, + /*! One of three pre-open session states indicating that an attempt to open the session + is underway*/ + FBSessionStateCreatedOpening = 2, + + /*! Open session state indicating user has logged in or a cached token is available */ + FBSessionStateOpen = 1 | FB_SESSIONSTATEOPENBIT, + /*! Open session state indicating token has been extended, or the user has granted additional permissions */ + FBSessionStateOpenTokenExtended = 2 | FB_SESSIONSTATEOPENBIT, + + /*! Closed session state indicating that a login attempt failed */ + FBSessionStateClosedLoginFailed = 1 | FB_SESSIONSTATETERMINALBIT, // NSError obj w/more info + /*! Closed session state indicating that the session was closed, but the users token + remains cached on the device for later use */ + FBSessionStateClosed = 2 | FB_SESSIONSTATETERMINALBIT, // " +}; + +/*! helper macro to test for states that imply an open session */ +#define FB_ISSESSIONOPENWITHSTATE(state) (0 != (state & FB_SESSIONSTATEOPENBIT)) + +/*! helper macro to test for states that are terminal */ +#define FB_ISSESSIONSTATETERMINAL(state) (0 != (state & FB_SESSIONSTATETERMINALBIT)) + +/*! + @typedef FBSessionLoginBehavior enum + + @abstract + Passed to open to indicate whether Facebook Login should allow for fallback to be attempted. + + @discussion + Facebook Login authorizes the application to act on behalf of the user, using the user's + Facebook account. Usually a Facebook Login will rely on an account maintained outside of + the application, by the native Facebook application, the browser, or perhaps the device + itself. This avoids the need for a user to enter their username and password directly, and + provides the most secure and lowest friction way for a user to authorize the application to + interact with Facebook. If a Facebook Login is not possible, a fallback Facebook Login may be + attempted, where the user is prompted to enter their credentials in a web-view hosted directly + by the application. + + The `FBSessionLoginBehavior` enum specifies whether to allow fallback, disallow fallback, or + force fallback login behavior. Most applications will use the default, which attempts a normal + Facebook Login, and only falls back if needed. In rare cases, it may be preferable to disallow + fallback Facebook Login completely, or to force a fallback login. + */ +typedef NS_ENUM(NSUInteger, FBSessionLoginBehavior) { + /*! Attempt Facebook Login, ask user for credentials if necessary */ + FBSessionLoginBehaviorWithFallbackToWebView = 0, + /*! Attempt Facebook Login, no direct request for credentials will be made */ + FBSessionLoginBehaviorWithNoFallbackToWebView = 1, + /*! Only attempt WebView Login; ask user for credentials */ + FBSessionLoginBehaviorForcingWebView = 2, + /*! Attempt Facebook Login, prefering system account and falling back to fast app switch if necessary */ + FBSessionLoginBehaviorUseSystemAccountIfPresent = 3, + /*! Attempt only to login with Safari */ + FBSessionLoginBehaviorForcingSafari = 4, +}; + +/*! + @typedef FBSessionDefaultAudience enum + + @abstract + Passed to open to indicate which default audience to use for sessions that post data to Facebook. + + @discussion + Certain operations such as publishing a status or publishing a photo require an audience. When the user + grants an application permission to perform a publish operation, a default audience is selected as the + publication ceiling for the application. This enumerated value allows the application to select which + audience to ask the user to grant publish permission for. + */ +typedef NS_ENUM(NSUInteger, FBSessionDefaultAudience) { + /*! No audience needed; this value is useful for cases where data will only be read from Facebook */ + FBSessionDefaultAudienceNone = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSessionDefaultAudienceOnlyMe = 10, + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSessionDefaultAudienceFriends = 20, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSessionDefaultAudienceEveryone = 30, +}; + +/*! + @typedef FBSessionLoginType enum + + @abstract + Used as the type of the loginType property in order to specify what underlying technology was used to + login the user. + + @discussion + The FBSession object is an abstraction over five distinct mechanisms. This enum allows an application + to test for the mechanism used by a particular instance of FBSession. Usually the mechanism used for a + given login does not matter, however for certain capabilities, the type of login can impact the behavior + of other Facebook functionality. + */ +typedef NS_ENUM(NSUInteger, FBSessionLoginType) { + /*! A login type has not yet been established */ + FBSessionLoginTypeNone = 0, + /*! A system integrated account was used to log the user into the application */ + FBSessionLoginTypeSystemAccount = 1, + /*! The Facebook native application was used to log the user into the application */ + FBSessionLoginTypeFacebookApplication = 2, + /*! Safari was used to log the user into the application */ + FBSessionLoginTypeFacebookViaSafari = 3, + /*! A web view was used to log the user into the application */ + FBSessionLoginTypeWebView = 4, + /*! A test user was used to create an open session */ + FBSessionLoginTypeTestUser = 5, +}; + +/*! + @typedef + + @abstract Block type used to define blocks called by for state updates + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionStateHandler)(FBSession *session, + FBSessionState status, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession requestNewReadPermissions:completionHandler:]> + and <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + + Requesting additional permissions inside this handler (such as by calling + `requestNewPublishPermissions`) should be avoided because it is a poor user + experience and its behavior may vary depending on the login type. You should + request the permissions closer to the operation that requires it (e.g., when + the user performs some action). + */ +typedef void (^FBSessionRequestPermissionResultHandler)(FBSession *session, + NSError *error); + +/*! + @typedef + + @abstract Block type used to define blocks called by <[FBSession reauthorizeWithPermissions]>. + + @discussion You should use the preferred FBSessionRequestPermissionHandler typedef rather than + this synonym, which has been deprecated. + */ +typedef FBSessionRequestPermissionResultHandler FBSessionReauthorizeResultHandler __attribute__((deprecated)); + +/*! + @typedef + + @abstract Block type used to define blocks called for system credential renewals. + */ +typedef void (^FBSessionRenewSystemCredentialsHandler)(ACAccountCredentialRenewResult result, NSError *error) ; + +/*! + @class FBSession + + @abstract + The `FBSession` object is used to authenticate a user and manage the user's session. After + initializing a `FBSession` object the Facebook App ID and desired permissions are stored. + Opening the session will initiate the authentication flow after which a valid user session + should be available and subsequently cached. Closing the session can optionally clear the + cache. + + If an request requires user authorization then an `FBSession` object should be used. + + + @discussion + Instances of the `FBSession` class provide notification of state changes in the following ways: + + 1. Callers of certain `FBSession` methods may provide a block that will be called + back in the course of state transitions for the session (e.g. login or session closed). + + 2. The object supports Key-Value Observing (KVO) for property changes. + */ +@interface FBSession : NSObject + +/*! + @methodgroup Creating a session + */ + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with default values for the parameters + to . + */ +- (instancetype)init; + +/*! + @method + + @abstract + Returns a newly initialized Facebook session with the specified permissions and other + default values for parameters to . + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + + */ +- (instancetype)initWithPermissions:(NSArray *)permissions; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +/*! + @method + + @abstract + Following are the descriptions of the arguments along with their + defaults when ommitted. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. + @param defaultAudience Most applications use FBSessionDefaultAudienceNone here, only specifying an audience when using reauthorize to request publish permissions. + @param appID The Facebook App ID for the session. If nil is passed in the default App ID will be obtained from a call to <[FBSession defaultAppID]>. The default is nil. + @param urlSchemeSuffix The URL Scheme Suffix to be used in scenarious where multiple iOS apps use one Facebook App ID. A value of nil indicates that this information should be pulled from [FBSettings defaultUrlSchemeSuffix]. The default is nil. + @param tokenCachingStrategy Specifies a key name to use for cached token information in NSUserDefaults, nil + indicates a default value of @"FBAccessTokenInformationKey". + + @discussion + It is required that any single permission request request (including initial log in) represent read-only permissions + or publish permissions only; not both. The permissions passed here should reflect this requirement. If publish permissions + are used, then the audience must also be specified. + */ +- (instancetype)initWithAppID:(NSString *)appID + permissions:(NSArray *)permissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + urlSchemeSuffix:(NSString *)urlSchemeSuffix + tokenCacheStrategy:(FBSessionTokenCachingStrategy *)tokenCachingStrategy; + +// instance readonly properties + +/*! @abstract Indicates whether the session is open and ready for use. */ +@property (readonly) BOOL isOpen; + +/*! @abstract Detailed session state */ +@property (readonly) FBSessionState state; + +/*! @abstract Identifies the Facebook app which the session object represents. */ +@property (readonly, copy) NSString *appID; + +/*! @abstract Identifies the URL Scheme Suffix used by the session. This is used when multiple iOS apps share a single Facebook app ID. */ +@property (readonly, copy) NSString *urlSchemeSuffix; + +/*! @abstract The access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSString *accessToken +__attribute__((deprecated)); + +/*! @abstract The expiration date of the access token for the session object. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly, copy) NSDate *expirationDate +__attribute__((deprecated)); + +/*! @abstract The permissions granted to the access token during the authentication flow. */ +@property (readonly, copy) NSArray *permissions; + +/*! @abstract Specifies the login type used to authenticate the user. + @discussion Deprecated. Use the `accessTokenData` property. */ +@property(readonly) FBSessionLoginType loginType +__attribute__((deprecated)); + +/*! @abstract Gets the FBAccessTokenData for the session */ +@property (readonly, copy) FBAccessTokenData *accessTokenData; + +/*! + @abstract + Returns a collection of permissions that have been declined by the user for this + given session instance. + + @discussion + A "declined" permission is one that had been requested but was either skipped or removed by + the user during the login flow. Note that once the permission has been granted (either by + requesting again or detected by a permissions refresh), it will be removed from this collection. + */ +@property (readonly, copy) NSArray *declinedPermissions; + +/*! + @abstract The presenting view controller passed to the `open...` methods + @discussion You can use this property to clear out weak references when they are no longer needed. + */ +@property (nonatomic, assign) UIViewController *fromViewController; + +/*! + @methodgroup Instance methods + */ + +/*! + @method + + @abstract Opens a session for the Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + Open may be called at most once and must be called after the `FBSession` is initialized. Open must + be called before the session is closed. Calling an open method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param handler A block to call with the state changes. The default is nil. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler fromViewController:(UIViewController *)fromViewController; + +/*! + @deprecated use openWithCompletionHandler:fromViewController: instead + */ +- (void)openWithCompletionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openWithCompletionHandler:fromViewController: instead"))); + + +/*! + @method + + @abstract Logs a user on to Facebook. + + @discussion + A session may not be used with and other classes in the SDK until it is open. If, prior + to calling open, the session is in the state, then no UX occurs, and + the session becomes available for use. If the session is in the state, prior + to calling open, then a call to open causes login UX to occur, either via the Facebook application + or via mobile Safari. + + The method may be called at most once and must be called after the `FBSession` is initialized. It must + be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + @param behavior Controls whether to allow, force, or prohibit Facebook Login or Inline Facebook Login. The default + is to allow Facebook Login, with fallback to Inline Facebook Login. + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler A block to call with session state changes. The default is nil. + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openWithBehavior:fromViewControllercompletionHandler instead + */ +- (void)openWithBehavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openWithBehavior:fromViewControllercompletionHandler: instead"))); + +/*! + @method + + @abstract Imports an existing access token and opens the session with it. + + @discussion + The method attempts to open the session using an existing access token. No UX will occur. If + successful, the session with be in an Open state and the method will return YES; otherwise, NO. + + The method may be called at most once and must be called after the `FBSession` is initialized (see below). + It must be called before the session is closed. Calling the method at an invalid time will result in + an exception. The open session methods may be passed a block that will be called back when the session + state changes. The block will be released when the session is closed. + + The initialized session must not have already been initialized from a cache (for example, you could use + the `[FBSessionTokenCachingStrategy nullCacheInstance]` instance). + + @param accessTokenData The token data. See `FBAccessTokenData` for construction methods. + @param handler A block to call with session state changes. The default is nil. + */ +- (BOOL)openFromAccessTokenData:(FBAccessTokenData *)accessTokenData completionHandler:(FBSessionStateHandler) handler; + +/*! + @abstract + Closes the local in-memory session object, but does not clear the persisted token cache. + */ +- (void)close; + +/*! + @abstract + Closes the in-memory session, and clears any persisted cache related to the session. + */ +- (void)closeAndClearTokenInformation; + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. The default is nil. + @param behavior Controls whether to allow, force, or prohibit Facebook Login. The default + is to allow Facebook Login and fall back to Inline Facebook Login if needed. + @param handler A block to call with session state changes. The default is nil. + + @discussion Methods and properties that specify permissions without a read or publish + qualification are deprecated; use of a read-qualified or publish-qualified alternative is preferred + (e.g. reauthorizeWithReadPermissions or reauthorizeWithPublishPermissions) + */ +- (void)reauthorizeWithPermissions:(NSArray *)permissions + behavior:(FBSessionLoginBehavior)behavior + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewReadPermissions:completionHandler:]>. Consider + using <[FBSession requestNewReadPermissions:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Reauthorizes the session, with additional permissions. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion This method is a deprecated alias of <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>. + Consider using <[FBSession requestNewPublishPermissions:defaultAudience:completionHandler:]>, which is preferred for readability. + */ +- (void)reauthorizeWithPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionReauthorizeResultHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + Requests new or additional read permissions for the session. + + @param readPermissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewReadPermissions:(NSArray *)readPermissions + completionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + Requests new or additional write permissions for the session. + + @param writePermissions An array of strings representing the permissions to request during the + authentication flow. + + @param defaultAudience Specifies the audience for posts. + + @param handler A block to call with session state changes. The default is nil. + + @discussion The handler, if non-nil, is called once the operation has completed or failed. This is in contrast to the + state completion handler used in <[FBSession openWithCompletionHandler:]> (and other `open*` methods) which is called + for each state-change for the session. + */ +- (void)requestNewPublishPermissions:(NSArray *)writePermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + completionHandler:(FBSessionRequestPermissionResultHandler)handler; +/*! + @abstract Refreshes the current permissions for the session. + @param handler Called after completion of the refresh. + @discussion This will update the sessions' permissions array from the server. This can be + useful if you want to make sure the local permissions are up to date. + */ +- (void)refreshPermissionsWithCompletionHandler:(FBSessionRequestPermissionResultHandler)handler; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. It should be invoked during + the Facebook Login flow and will update the session information based on the incoming URL. + + @param url The URL as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + */ +- (BOOL)handleOpenURL:(NSURL *)url; + +/*! + @abstract + A helper method that is used to provide an implementation for + [UIApplicationDelegate applicationDidBecomeActive:] to properly resolve session state for + the Facebook Login flow, specifically to support app-switch login. + */ +- (void)handleDidBecomeActive; + +/*! + @abstract + Assign the block to be invoked for session state changes. + + @param stateChangeHandler the handler block. + + @discussion + This will overwrite any state change handler that was already assigned. Typically, + you should only use this setter if you were unable to assign a state change handler explicitly. + One example of this is if you are not opening the session (e.g., using the `open*`) + but still want to assign a `FBSessionStateHandler` block. This can happen when the SDK + opens a session from an app link. + */ +- (void)setStateChangeHandler:(FBSessionStateHandler)stateChangeHandler; + +/*! + @abstract + Returns true if the specified permission has been granted to this session. + + @param permission the permission to verify. + + @discussion + This is a convenience helper for checking if `pemission` is inside the permissions array. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @methodgroup Class methods + */ + +/*! + @abstract + This is the simplest method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + Note, if there is not a cached token available, this method will present UI to the user in order to + open the session via explicit login by the user. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be disirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @discussion + Returns YES if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI fromViewController:(UIViewController *)fromViewController; + +/*! + @deprecated use openActiveSessionWithAllowLoginUI:fromViewController: instead + */ ++ (BOOL)openActiveSessionWithAllowLoginUI:(BOOL)allowLoginUI +__attribute__ ((deprecated("use openActiveSessionWithAllowLoginUI:fromViewController: instead"))); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param permissions An array of strings representing the permissions to request during the + authentication flow. A value of nil indicates basic permissions. A nil value specifies + default permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + It is required that initial permissions requests represent read-only permissions only. If publish + permissions are needed, you may use reauthorizeWithPermissions to specify additional permissions as + well as an audience. Use of this method will result in a legacy fast-app-switch Facebook Login due to + the requirement to separate read and publish permissions for newer applications. Methods and properties + that specify permissions without a read or publish qualification are deprecated; use of a read-qualified + or publish-qualified alternative is preferred. + */ ++ (BOOL)openActiveSessionWithPermissions:(NSArray *)permissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__((deprecated)); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param readPermissions An array of strings representing the read permissions to request during the + authentication flow. It is not allowed to pass publish permissions to this method. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openActiveSessionWithReadPermissions:allowLoginUI:fromViewController:completionHandler: instead + */ ++ (BOOL)openActiveSessionWithReadPermissions:(NSArray *)readPermissions + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openActiveSessionWithReadPermissions:allowLoginUI:fromViewController:completionHandler: instead"))); + +/*! + @abstract + This is a simple method for opening a session with Facebook. Using sessionOpen logs on a user, + and sets the static activeSession which becomes the default session object for any Facebook UI widgets + used by the application. This session becomes the active session, whether open succeeds or fails. + + @param publishPermissions An array of strings representing the publish permissions to request during the + authentication flow. + + @param defaultAudience Anytime an app publishes on behalf of a user, the post must have an audience (e.g. me, my friends, etc.) + The default audience is used to notify the user of the cieling that the user agrees to grant to the app for the provided permissions. + + @param allowLoginUI Sometimes it is useful to attempt to open a session, but only if + no login UI will be required to accomplish the operation. For example, at application startup it may not + be desirable to transition to login UI for the user, and yet an open session is desired so long as a cached + token can be used to open the session. Passing NO to this argument, assures the method will not present UI + to the user in order to open the session. + + @param fromViewController The view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + + @param handler Many applications will benefit from notification when a session becomes invalid + or undergoes other state transitions. If a block is provided, the FBSession + object will call the block each time the session changes state. + + @discussion + Returns true if the session was opened synchronously without presenting UI to the user. This occurs + when there is a cached token available from a previous run of the application. If NO is returned, this indicates + that the session was not immediately opened, via cache. However, if YES was passed as allowLoginUI, then it is + possible that the user will login, and the session will become open asynchronously. The primary use for + this return value is to switch-on facebook capabilities in your UX upon startup, in the case where the session + is opened via cache. + + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + fromViewController:(UIViewController *)fromViewController + completionHandler:(FBSessionStateHandler)handler; + +/*! + @deprecated use openActiveSessionWithPublishPermissions:defaultAudience:allowLoginUI:fromViewController:completionHandler instead + */ ++ (BOOL)openActiveSessionWithPublishPermissions:(NSArray *)publishPermissions + defaultAudience:(FBSessionDefaultAudience)defaultAudience + allowLoginUI:(BOOL)allowLoginUI + completionHandler:(FBSessionStateHandler)handler +__attribute__ ((deprecated("use openActiveSessionWithPublishPermissions:defaultAudience:allowLoginUI:fromViewController:completionHandler: instead"))); + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @discussion + If sessionOpen* is called, the resulting `FBSession` object also becomes the activeSession. If another + session was active at the time, it is closed automatically. If activeSession is called when no session + is active, a session object is instatiated and returned; in this case open must be called on the session + in order for it to be useable for communication with Facebook. + */ ++ (FBSession *)activeSession; + +/*! + @abstract + An application may get or set the current active session. Certain high-level components in the SDK + will use the activeSession to set default session (e.g. `FBLoginView`, `FBFriendPickerViewController`) + + @param session The FBSession object to become the active session + + @discussion + If an application prefers the flexibilility of directly instantiating a session object, an active + session can be set directly. + */ ++ (FBSession *)setActiveSession:(FBSession *)session; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultAppID]. + + @param appID The default Facebook App ID to use for methods. + */ ++ (void)setDefaultAppID:(NSString *)appID __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default Facebook App ID to use for sessions. If not explicitly + set, the default will be read from the application's plist. The app ID may be + overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultAppID]. + */ ++ (NSString *)defaultAppID __attribute__((deprecated)); + +/*! + @method + + @abstract Set the default url scheme suffix to use for sessions. The url + scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings setDefaultUrlSchemeSuffix]. + + @param urlSchemeSuffix The default url scheme suffix to use for methods. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist. The + url scheme suffix may be overridden on a per session basis. + + @discussion This method has been deprecated in favor of [FBSettings defaultUrlSchemeSuffix]. + */ ++ (NSString *)defaultUrlSchemeSuffix __attribute__((deprecated)); + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device Facebook account store. + + @param handler The completion handler to call when the renewal is completed. The handler will be + invoked on the main thread. + + @discussion This can be used to explicitly renew account credentials on iOS 6 devices and is provided + as a convenience wrapper around `[ACAccountStore renewCredentialsForAccount:completion]`. Note the + method will not issue the renewal call if the the Facebook account has not been set on the device, or + if access had not been granted to the account (though the handler wil receive an error). + + This is safe to call (and will surface an error to the handler) on versions of iOS before 6 or if the user + logged in via Safari or Facebook SSO. + */ ++ (void)renewSystemCredentials:(FBSessionRenewSystemCredentialsHandler)handler; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h new file mode 100644 index 0000000..f70b61e --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSessionTokenCachingStrategy.h @@ -0,0 +1,167 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBAccessTokenData.h" +#import "FBSDKMacros.h" + +/*! + @class + + @abstract + The `FBSessionTokenCachingStrategy` class is responsible for persisting and retrieving cached data related to + an object, including the user's Facebook access token. + + @discussion + `FBSessionTokenCachingStrategy` is designed to be instantiated directly or used as a base class. Usually default + token caching behavior is sufficient, and you do not need to interface directly with `FBSessionTokenCachingStrategy` objects. + However, if you need to control where or how `FBSession` information is cached, then you may take one of two approaches. + + The first and simplest approach is to instantiate an instance of `FBSessionTokenCachingStrategy`, and then pass + the instance to `FBSession` class' `init` method. This enables your application to control the key name used in + the iOS Keychain to store session information. You may consider this approach if you plan to cache session information + for multiple users. + + The second and more advanced approached is to derive a custom class from `FBSessionTokenCachingStrategy`, which will + be responsible for caching behavior of your application. This approach is useful if you need to change where the + information is cached, for example if you prefer to use the filesystem or make a network connection to fetch and + persist cached tokens. Inheritors should override the cacheTokenInformation, fetchTokenInformation, and clearToken methods. + Doing this enables your application to implement any token caching scheme, including no caching at all (see + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Direct use of `FBSessionTokenCachingStrategy`is an advanced technique. Most applications use objects without + passing an `FBSessionTokenCachingStrategy`, which yields default caching to the iOS Keychain. + */ +@interface FBSessionTokenCachingStrategy : NSObject + +/*! + @abstract Initializes and returns an instance + */ +- (instancetype)init; + +/*! + @abstract + Initializes and returns an instance + + @param tokenInformationKeyName Specifies a key name to use for cached token information in the iOS Keychain, nil + indicates a default value of @"FBAccessTokenInformationKey" + */ +- (instancetype)initWithUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract + Called by (and overridden by inheritors), in order to cache token information. + + @param tokenInformation Dictionary containing token information to be cached by the method + @discussion You should favor overriding this instead of `cacheFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + */ +- (void)cacheTokenInformation:(NSDictionary *)tokenInformation; + +/*! + @abstract Cache the supplied token. + @param accessToken The token instance. + @discussion This essentially wraps a call to `cacheTokenInformation` so you should + override this when providing a custom token caching strategy. + */ +- (void)cacheFBAccessTokenData:(FBAccessTokenData *)accessToken; + +/*! + @abstract + Called by (and overridden by inheritors), in order to fetch cached token information + + @discussion + An overriding implementation should only return a token if it + can also return an expiration date, otherwise return nil. + You should favor overriding this instead of `fetchFBAccessTokenData` only if you intend + to cache additional data not captured by the FBAccessTokenData type. + + */ +- (NSDictionary *)fetchTokenInformation; + +/*! + @abstract + Fetches the cached token instance. + + @discussion + This essentially wraps a call to `fetchTokenInformation` so you should + override this when providing a custom token caching strategy. + + In order for an `FBSession` instance to be able to use a cached token, + the token must be not be expired (see `+isValidTokenInformation:`) and + must also contain all permissions in the initialized session instance. + */ +- (FBAccessTokenData *)fetchFBAccessTokenData; + +/*! + @abstract + Called by (and overridden by inheritors), in order delete any cached information for the current token + */ +- (void)clearToken; + +/*! + @abstract + Helper function called by the SDK as well as apps, in order to fetch the default strategy instance. + */ ++ (FBSessionTokenCachingStrategy *)defaultInstance; + +/*! + @abstract + Helper function to return a FBSessionTokenCachingStrategy instance that does not perform any caching. + */ ++ (FBSessionTokenCachingStrategy *)nullCacheInstance; + +/*! + @abstract + Helper function called by the SDK as well as application code, used to determine whether a given dictionary + contains the minimum token information usable by the . + + @param tokenInformation Dictionary containing token information to be validated + */ ++ (BOOL)isValidTokenInformation:(NSDictionary *)tokenInformation; + +@end + +// The key to use with token information dictionaries to get and set the token value +FBSDK_EXTERN NSString *const FBTokenInformationTokenKey; + +// The to use with token information dictionaries to get and set the expiration date +FBSDK_EXTERN NSString *const FBTokenInformationExpirationDateKey; + +// The to use with token information dictionaries to get and set the refresh date +FBSDK_EXTERN NSString *const FBTokenInformationRefreshDateKey; + +// The key to use with token information dictionaries to get the related user's fbid +FBSDK_EXTERN NSString *const FBTokenInformationUserFBIDKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via Facebook Login +FBSDK_EXTERN NSString *const FBTokenInformationIsFacebookLoginKey; + +// The key to use with token information dictionaries to determine whether the token was fetched via the OS +FBSDK_EXTERN NSString *const FBTokenInformationLoginTypeLoginKey; + +// The key to use with token information dictionaries to get the latest known permissions +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsKey; + +// The key to use with token information dictionaries to get the latest known declined permissions +FBSDK_EXTERN NSString *const FBTokenInformationDeclinedPermissionsKey; + +// The key to use with token information dictionaries to get the date the permissions were last refreshed. +FBSDK_EXTERN NSString *const FBTokenInformationPermissionsRefreshDateKey; + +// The key to use with token information dictionaries to get the id of the creator app +FBSDK_EXTERN NSString *const FBTokenInformationAppIDKey; diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSettings.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSettings.h new file mode 100644 index 0000000..7e40343 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBSettings.h @@ -0,0 +1,308 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#import "FBSDKMacros.h" + +/* + * Constants defining logging behavior. Use with <[FBSettings setLoggingBehavior]>. + */ + +/*! Log requests from FBRequest* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBRequests; + +/*! Log requests from FBURLConnection* classes */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorFBURLConnections; + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAccessTokens; + +/*! Log session state transitions. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorSessionStateTransitions; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBAppEvents interactions */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorCacheErrors; + +/*! Log errors from SDK UI controls */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorUIControlErrors; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBLoggingBehaviorDeveloperErrors; + +/*! + @typedef + + @abstract A list of beta features that can be enabled for the SDK. Beta features are for evaluation only, + and are therefore only enabled for DEBUG builds. Beta features should not be enabled + in release builds. + */ +typedef NS_ENUM(NSUInteger, FBBetaFeatures) { + /*! Default value indicating no beta features */ + FBBetaFeaturesNone = 0, +}; + +/*! + @typedef + + @abstract Indicates if this app should be restricted + */ +typedef NS_ENUM(NSUInteger, FBRestrictedTreatment) { + /*! The default treatment indicating the app is not restricted. */ + FBRestrictedTreatmentNO = 0, + + /*! Indicates the app is restricted. */ + FBRestrictedTreatmentYES = 1 +}; + +/*! + @class FBSettings + + @abstract Allows configuration of SDK behavior. +*/ +@interface FBSettings : NSObject + +/*! + @method + + @abstract Retrieve the current iOS SDK version. + + */ ++ (NSString *)sdkVersion; + +/*! + @method + + @abstract Retrieve the current Facebook SDK logging behavior. + + */ ++ (NSSet *)loggingBehavior; + +/*! + @method + + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBLogBehavior*, and can be constructed with, e.g., [NSSet initWithObjects:]. + + @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging + behavior is reset to the default set of enabled behaviors. Set in an empty set in order to disable all logging. + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! + @method + + @abstract + This method is deprecated -- App Events favors using bundle identifiers to this. + */ ++ (NSString *)appVersion __attribute__ ((deprecated("App Events favors use of bundle identifiers for version identification."))); + +/*! + @method + + @abstract + This method is deprecated -- App Events favors using bundle identifiers to this. + @param appVersion deprecated + */ ++ (void)setAppVersion:(NSString *)appVersion __attribute__ ((deprecated("App Events favors use of bundle identifiers for version identification."))); + +/*! + @method + + @abstract Retrieve the Client Token that has been set via [FBSettings setClientToken] + */ ++ (NSString *)clientToken; + +/*! + @method + + @abstract Sets the Client Token for the Facebook App. This is needed for certain API calls when made anonymously, + without a user-based Session. + + @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security + section of the Advanced tab of the Facebook App settings found at + + */ ++ (void)setClientToken:(NSString *)clientToken; + +/*! + @method + + @abstract Set the default Facebook Display Name to be used by the SDK. This should match + the Display Name that has been set for the app with the corresponding Facebook App ID, in + the Facebook App Dashboard + + @param displayName The default Facebook Display Name to be used by the SDK. + */ ++ (void)setDefaultDisplayName:(NSString *)displayName; + +/*! + @method + + @abstract Get the default Facebook Display Name used by the SDK. If not explicitly + set, the default will be read from the application's plist. + */ ++ (NSString *)defaultDisplayName; + +/*! + @method + + @abstract Set the default Facebook App ID to use for sessions. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + + @param appID The default Facebook App ID to be used by the SDK. + */ ++ (void)setDefaultAppID:(NSString *)appID; + +/*! + @method + + @abstract Get the default Facebook App ID used by the SDK. If not explicitly + set, the default will be read from the application's plist. The SDK allows the appID + to be overridden per instance in certain cases (e.g. per instance of FBSession) + */ ++ (NSString *)defaultAppID; + +/*! + @method + + @abstract Set the default url scheme suffix used by the SDK. + + @param urlSchemeSuffix The default url scheme suffix to be used by the SDK. + */ ++ (void)setDefaultUrlSchemeSuffix:(NSString *)urlSchemeSuffix; + +/*! + @method + + @abstract Get the default url scheme suffix used for sessions. If not + explicitly set, the default will be read from the application's plist value for 'FacebookUrlSchemeSuffix'. + */ ++ (NSString *)defaultUrlSchemeSuffix; + +/*! + @method + + @abstract Set the bundle name from the SDK will try and load overrides of images and text + + @param bundleName The name of the bundle (MyFBBundle). + */ ++ (void)setResourceBundleName:(NSString *)bundleName; + +/*! + @method + + @abstract Get the name of the bundle to override the SDK images and text + */ ++ (NSString *)resourceBundleName; + +/*! + @method + + @abstract Set the subpart of the facebook domain (e.g. @"beta") so that requests will be sent to graph.beta.facebook.com + + @param facebookDomainPart The domain part to be inserted into facebook.com + */ ++ (void)setFacebookDomainPart:(NSString *)facebookDomainPart; + +/*! + @method + + @abstract Get the Facebook domain part + */ ++ (NSString *)facebookDomainPart; + +/*! + @method + + @abstract Enables the specified beta features. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeatures The beta features to enable (expects a bitwise OR of FBBetaFeatures) + */ ++ (void)enableBetaFeatures:(NSUInteger)betaFeatures; + +/*! + @method + + @abstract Enables a beta feature. Beta features are for evaluation only, + and are therefore only enabled for debug builds. Beta features should not be enabled + in release builds. + + @param betaFeature The beta feature to enable. + */ ++ (void)enableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Disables a beta feature. + + @param betaFeature The beta feature to disable. + */ ++ (void)disableBetaFeature:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract Determines whether a beta feature is enabled or not. + + @param betaFeature The beta feature to check. + + @return YES if the beta feature is enabled, NO if not. + */ ++ (BOOL)isBetaFeatureEnabled:(FBBetaFeatures)betaFeature; + +/*! + @method + + @abstract + Gets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + */ ++ (BOOL)limitEventAndDataUsage; + +/*! + @method + + @abstract + Sets whether data such as that generated through FBAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions. Defaults to NO. This value is stored on the device and persists across app launches. + + @param limitEventAndDataUsage The desired value. + */ ++ (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; + +/*! + @deprecated legacy Graph API 1.0 has been deprecated. This will always return NO. +*/ ++ (BOOL)isPlatformCompatibilityEnabled __attribute__ ((deprecated("legacy Graph API 1.0 has been deprecated. This will always return NO."))); + +/*! + @deprecated legacy Graph API 1.0 has been deprecated. This will be a no-op. +*/ ++ (void)enablePlatformCompatibility:(BOOL)enable __attribute__ ((deprecated("legacy Graph API 1.0 has been deprecated. This will be a no-op."))); + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h new file mode 100644 index 0000000..7b828a8 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBLinkShareParams.h" + +/*! + @class FBShareDialogParams + + @abstract Deprecated. Use `FBLinkShareParams` instead. + */ +__attribute__((deprecated)) +@interface FBShareDialogParams : FBLinkShareParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h new file mode 100644 index 0000000..a7f0b75 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBShareDialogPhotoParams.h @@ -0,0 +1,29 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPhotoParams.h" + +/*! + @class FBShareDialogPhotoParams + + @abstract Deprecated. Use `FBPhotoParams` instead. +*/ +__attribute__((deprecated)) +@interface FBShareDialogPhotoParams : FBPhotoParams + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTaggableFriendPickerViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTaggableFriendPickerViewController.h new file mode 100644 index 0000000..a6f314a --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTaggableFriendPickerViewController.h @@ -0,0 +1,43 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBPeoplePickerViewController.h" + +/*! + @class + + @abstract + The `FBTaggableFriendPickerViewController` class creates a controller object that + manages the user interface for displaying and selecting taggable Facebook friends. + + @discussion + When the `FBTaggableFriendPickerViewController` view loads it creates a `UITableView` + object where the taggable friends will be displayed. You can access this view through + the `tableView` property. The taggalb e friend display can be sorted by first name or + last name. Taggable friends' names can be displayed with the first name first or the + last name first. + + The `FBTaggableFriendPickerViewController` does not support the `fieldsForRequest` + property, as there are no other fields that may be requested from the Graph API. + + The `delegate` property may be set to an object that conforms to the + protocol. The graph object passed to the delegate conforms to the protocol. + */ +@interface FBTaggableFriendPickerViewController : FBPeoplePickerViewController + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h new file mode 100644 index 0000000..74ba8a7 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestSession.h @@ -0,0 +1,145 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBSession.h" + +#import "FBSDKMacros.h" + +#if defined(DEBUG) && !defined(SAFE_TO_USE_FBTESTSESSION) +#define SAFE_TO_USE_FBTESTSESSION +#endif + +#if !defined(SAFE_TO_USE_FBTESTSESSION) +#pragma message ("warning: using FBTestSession, which is designed for unit-testing uses only, in non-DEBUG code -- ensure this is what you really want") +#endif + +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a second unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kSecondTestUserTag; +/*! + Consider using this tag to pass to sessionWithSharedUserWithPermissions:uniqueUserTag: when + you need a third unique test user in a test case. Using the same tag each time reduces + the proliferation of test users. + */ +FBSDK_EXTERN NSString *kThirdTestUserTag; + +/*! + @class FBTestSession + + @abstract Deprecated in favor of `FBTestUserSession` + and `FBTestUsersManager` + + @discussion + Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing unit tests. It is not designed for use in + production application code. + + The main use case for this class is using sessionForUnitTestingWithPermissions:mode: + to create a session for a test user. Two modes are supported. In "shared" mode, an attempt + is made to find an existing test user that has the required permissions and, if it is not + currently in use by another FBTestSession, just use that user. If no such user is available, + a new one is created with the required permissions. In "private" mode, designed for + scenarios which require a new user in a known clean state, a new test user will always be + created, and it will be automatically deleted when the FBTestSession is closed. + + Note that the shared test user functionality depends on a naming convention for the test users. + It is important that any testing of functionality which will mutate the permissions for a + test user NOT use a shared test user, or this scheme will break down. If a shared test user + seems to be in an invalid state, it can be deleted manually via the Web interface at + https://developers.facebook.com/apps/APP_ID/permissions?role=test+users. + */ +__attribute__ ((deprecated("use FBTestUsersManager and FBTestUserSession instead"))) +@interface FBTestSession : FBSession + +/// The app access token (composed of app ID and secret) to use for accessing test users. +@property (readonly, copy) NSString *appAccessToken; +/// The ID of the test user associated with this session. +@property (readonly, copy) NSString *testUserID; +/// The name of the test user associated with this session. +@property (readonly, copy) NSString *testUserName; +/// The App ID of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppID; +/// The App Secret of the test app as configured in the plist. +@property (readonly, copy) NSString *testAppSecret; +/*! + @abstract Flag to disable reuathorize calls. + @discussion + Defaults to NO. If set to YES, reauthorize calls will fail with a nil token + as if the user had cancelled it reauthorize. +*/ +@property (assign) BOOL disableReauthorize; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). Calling this method multiple times may return sessions with the same user. If this is not + desired, use the variant sessionWithSharedUserWithPermissions:uniqueUserTag:. + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which uses a shared test user with the right permissions, + creating one if necessary on open (but not deleting it on close, so it can be re-used in later + tests). + + This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + + @param uniqueUserTag a string which will be used to make this user unique among other + users with the same permissions. Useful for tests which require two or more users to interact + with each other, and which therefore must have sessions associated with different users. For + this case, consider using kSecondTestUserTag and kThirdTestUserTag so these users can be shared + with other, similar, tests. + */ ++ (instancetype)sessionWithSharedUserWithPermissions:(NSArray *)permissions + uniqueUserTag:(NSString *)uniqueUserTag; + +/*! + @abstract + Constructor helper to create a session for use in unit tests + + @discussion + This method creates a session object which creates a test user on open, and destroys the user on + close; This method should not be used in application code -- but is useful for creating unit tests + that use the Facebook SDK. + + @param permissions array of strings naming permissions to authorize; nil indicates + a common default set of permissions should be used for unit testing + */ ++ (instancetype)sessionWithPrivateUserWithPermissions:(NSArray *)permissions; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUserSession.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUserSession.h new file mode 100644 index 0000000..c659550 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUserSession.h @@ -0,0 +1,55 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBAccessTokenData.h" +#import "FBSession.h" + +/*! + @class FBTestUserSession + @abstract a "headless" (no UI) `FBSession` subclass that requires a token and is used for testing. + + @discussion This will generally be used with `FBTestUsersManager` to help exercise + integration tests with Facebook. Use the class method `sessionWithAccessTokenData:` to construct + instances. + + Note the supplied token data is not read until the session instance is "opened" (i.e., it will + never be in a "TokenLoaded" state) and uses + `[FBSessionTokenCachingStrategy nullCacheInstance]`. + + Furthermore, reauthorization calls will succeed as a no-op (no new permissions added). You may toggle + the `treatReauthorizeAsCancellation` property to get cancellation treatment. +*/ +@interface FBTestUserSession : FBSession + +/*! + @abstract returns an instance + @discussion This should be used in place of any init methods. +*/ ++ (instancetype)sessionWithAccessTokenData:(FBAccessTokenData *)tokenData; + +/*! + @abstract Flag to treat reauthorize calls as cancelled. + @discussion + Defaults to NO. If set to YES, reauthorize calls will receive a nil token + as if the user had cancelled the reauthorize. + */ +@property (nonatomic, assign) BOOL treatReauthorizeAsCancellation; + +/*! + @abstract Flag to force extending a token expiration at the next opportunity. +*/ +@property (nonatomic, assign) BOOL forceAccessTokenExtension; +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUsersManager.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUsersManager.h new file mode 100644 index 0000000..7b6ad73 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTestUsersManager.h @@ -0,0 +1,88 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBAccessTokenData; + +/*! + @typedef + + @abstract Callback block for returning an array of `FBAccessTokenData` (and possibly `NSNull` instances); or an error. + */ +typedef void (^FBTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; + +/*! + @typedef + + @abstract Callback block for removing a test user. + */ +typedef void (^FBTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; + + +/*! + @class FBTestUsersManager + @abstract Provides methods for managing test accounts for testing Facebook integration. + + @discussion Facebook allows developers to create test accounts for testing their applications' + Facebook integration (see https://developers.facebook.com/docs/test_users/). This class + simplifies use of these accounts for writing tests. It is not designed for use in + production application code. + + This class will make Graph API calls on behalf of your app to manage test accounts and requires + an app id and app secret. You will typically use this class to write unit or integration tests. + Make sure you NEVER include your app secret in your production app. +*/ +@interface FBTestUsersManager : NSObject + +/*! + @abstract construct or return the shared instance + @param appId the Facebook app id + @param appSecret the Facebook app secret +*/ ++ (instancetype)sharedInstanceForAppId:(NSString *)appId appSecret:(NSString *)appSecret; + +/*! + @abstract retrieve `FBAccessTokenData` instances for test accounts with the specific permissions. + @param arraysOfPermissions an array of permissions arrays, such as @[ @[@"email"], @[@"user_birthday"]] + if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested arrays + such as @[ @[], @[] ] if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ @[] ] + for fetching a single test user. + @param createIfNotFound if YES, new test accounts are created if no test accounts existed that fit the permissions + requirement + @param handler the callback to invoke which will return an array of `FBAccessTokenData` instances or an `NSError`. + If param `createIfNotFound` is NO, the array may contain `[NSNull null]` instances. + + @discussion If you are requesting test accounts with differing number of permissions, try to order + `arrayOfPermissionsArrays` so that the most number of permissions come first to minimize creation of new + test accounts. + */ +- (void)requestTestAccountTokensWithArraysOfPermissions:(NSArray *)arraysOfPermissions + createIfNotFound:(BOOL)createIfNotFound + completionHandler:(FBTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract add a test account with the specified permissions +*/ +- (void)addTestAccountWithPermissions:(NSArray *)permissions + completionHandler:(FBTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract remove a test account for the given user id +*/ +- (void)removeTestAccount:(NSString *)userId completionHandler:(FBTestUsersManagerRemoveTestAccountHandler)handler; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h new file mode 100644 index 0000000..4a92bf9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBTooltipView.h @@ -0,0 +1,137 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/*! + @typedef FBTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBTooltipViewArrowDirection) { + /*! View is located above given point, arrow is pointing down. */ + FBTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBTooltipColorStyle) { + /*! Light blue background, white text, faded blue close button. */ + FBTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBTooltipView + + @abstract + Tooltip bubble with text in it used to display tips for UI elements, + with a pointed arrow (to refer to the UI element). + + @discussion + The tooltip fades in and will automatically fade out. See `displayDuration`. + */ +@interface FBTooltipView : UIView + +/*! + @abstract Gets or sets the amount of time in seconds the tooltip should be displayed. + + @discussion Set this to zero to make the display permanent until explicitly dismissed. + Defaults to six seconds. +*/ +@property (nonatomic, assign) CFTimeInterval displayDuration; + +/*! + @abstract Gets or sets the color style after initialization. + + @discussion Defaults to value passed to -initWithTagline:message:colorStyle:. + */ +@property (nonatomic, assign) FBTooltipColorStyle colorStyle; + +/*! + @abstract Gets or sets the message. +*/ +@property (nonatomic, copy) NSString *message; + +/*! + @abstract Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). +*/ +@property (nonatomic, copy) NSString *tagline; + +/*! + @abstract + Designated initializer. + + @param tagline First part of the label, that will be highlighted with different color. Can be nil. + + @param message Main message to display. + + @param colorStyle Color style to use for tooltip. + + @discussion + If you need to show a tooltip for login, consider using the `FBLoginTooltipView` view. + + @see FBLoginTooltipView + */ +- (id)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBTooltipColorStyle)colorStyle; + +/*! + @abstract + Show tooltip at the top or at the bottom of given view. + Tooltip will be added to anchorView.window.rootViewController.view + + @param anchorView view to show at, must be already added to window view hierarchy, in order to decide + where tooltip will be shown. (If there's not enough space at the top of the anchorView in window bounds - + tooltip will be shown at the bottom of it) + + @discussion + Use this method to present the tooltip with automatic positioning or + use -presentInView:withArrowPosition:direction: for manual positioning + If anchorView is nil or has no window - this method does nothing. + */ +- (void)presentFromView:(UIView *)anchorView; + +/*! + @abstract + Adds tooltip to given view, with given position and arrow direction. + + @param view View to be used as superview. + + @param arrowPosition Point in view's cordinates, where arrow will be pointing + + @param arrowDirection whenever arrow should be pointing up (message bubble is below the arrow) or + down (message bubble is above the arrow). + */ +- (void)presentInView:(UIView *)view withArrowPosition:(CGPoint)arrowPosition direction:(FBTooltipViewArrowDirection)arrowDirection; + +/*! + @abstract + Remove tooltip manually. + + @discussion + Calling this method isn't necessary - tooltip will dismiss itself automatically after the `displayDuration`. + */ +- (void)dismiss; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h new file mode 100644 index 0000000..5df08e7 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBUserSettingsViewController.h @@ -0,0 +1,128 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FBSession.h" +#import "FBViewController.h" + +/*! + @protocol + + @abstract + The `FBUserSettingsDelegate` protocol defines the methods called by a . + */ +@protocol FBUserSettingsDelegate + +@optional + +/*! + @abstract + Called when the view controller will log the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillLogUserOut:(id)sender; + +/*! + @abstract + Called after the view controller logged the user out in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserOut:(id)sender; + +/*! + @abstract + Called when the view controller will log the user in in response to a button press. + Note that logging in can fail for a number of reasons, so there is no guarantee that this + will be followed by a call to loginViewControllerDidLogUserIn:. Callers wanting more granular + notification of the session state changes can use KVO or the NSNotificationCenter to observe them. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerWillAttemptToLogUserIn:(id)sender; + +/*! + @abstract + Called after the view controller successfully logged the user in in response to a button press. + + @param sender The view controller sending the message. + */ +- (void)loginViewControllerDidLogUserIn:(id)sender; + +/*! + @abstract + Called if the view controller encounters an error while trying to log a user in. + + @param sender The view controller sending the message. + @param error The error encountered. + @discussion See https://developers.facebook.com/docs/technical-guides/iossdk/errors/ + for error handling best practices. + */ +- (void)loginViewController:(id)sender receivedError:(NSError *)error; + +@end + + +/*! + @class FBUserSettingsViewController + + @abstract + The `FBUserSettingsViewController` class provides a user interface exposing a user's + Facebook-related settings. Currently, this is limited to whether they are logged in or out + of Facebook. + + Because of the size of some graphics used in this view, its resources are packaged as a separate + bundle. In order to use `FBUserSettingsViewController`, drag the `FBUserSettingsViewResources.bundle` + from the SDK directory into your Xcode project. + */ +@interface FBUserSettingsViewController : FBViewController + +/*! + @abstract + The permissions to request if the user logs in via this view. + */ +@property (nonatomic, copy) NSArray *permissions __attribute__((deprecated)); + +/*! + @abstract + The read permissions to request if the user logs in via this view. + + @discussion + Note, that if read permissions are specified, then publish permissions should not be specified. + */ +@property (nonatomic, copy) NSArray *readPermissions; + +/*! + @abstract + The publish permissions to request if the user logs in via this view. + + @discussion + Note, that a defaultAudience value of FBSessionDefaultAudienceOnlyMe, FBSessionDefaultAudienceEveryone, or + FBSessionDefaultAudienceFriends should be set if publish permissions are specified. Additionally, when publish + permissions are specified, then read should not be specified. + */ +@property (nonatomic, copy) NSArray *publishPermissions; + +/*! + @abstract + The default audience to use, if publish permissions are requested at login time. + */ +@property (nonatomic, assign) FBSessionDefaultAudience defaultAudience; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBViewController.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBViewController.h new file mode 100644 index 0000000..fa33d21 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBViewController.h @@ -0,0 +1,118 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBViewController; + +/*! + @typedef FBModalCompletionHandler + + @abstract + A block that is passed to [FBViewController presentModallyInViewController:animated:handler:] + and called when the view controller is dismissed via either Done or Cancel. + + @param sender The that is being dismissed. + + @param donePressed If YES, Done was pressed. If NO, Cancel was pressed. + */ +typedef void (^FBModalCompletionHandler)(FBViewController *sender, BOOL donePressed); + +/*! + @protocol + + @abstract + The `FBViewControllerDelegate` protocol defines the methods called when the Cancel or Done + buttons are pressed in a . + */ +@protocol FBViewControllerDelegate + +@optional + +/*! + @abstract + Called when the Cancel button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerCancelWasPressed:(id)sender; + +/*! + @abstract + Called when the Done button is pressed on a modally-presented . + + @param sender The view controller sending the message. + */ +- (void)facebookViewControllerDoneWasPressed:(id)sender; + +@end + + +/*! + @class FBViewController + + @abstract + The `FBViewController` class is a base class encapsulating functionality common to several + other view controller classes. Specifically, it provides UI when a view controller is presented + modally, in the form of optional Cancel and Done buttons. + */ +@interface FBViewController : UIViewController + +/*! + @abstract + The Cancel button to display when presented modally. If nil, no Cancel button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *cancelButton; + +/*! + @abstract + The Done button to display when presented modally. If nil, no Done button is displayed. + If this button is provided, its target and action will be redirected to internal handlers, replacing + any previous target that may have been set. + */ +@property (nonatomic, retain) IBOutlet UIBarButtonItem *doneButton; + +/*! + @abstract + The delegate that will be called when Cancel or Done is pressed. Derived classes may specify + derived types for their delegates that provide additional functionality. + */ +@property (nonatomic, assign) IBOutlet id delegate; + +/*! + @abstract + The view into which derived classes should put their subviews. This view will be resized correctly + depending on whether or not a toolbar is displayed. + */ +@property (nonatomic, readonly, retain) UIView *canvasView; + +/*! + @abstract + Provides a wrapper that presents the view controller modally and automatically dismisses it + when either the Done or Cancel button is pressed. + + @param viewController The view controller that is presenting this view controller. + @param animated If YES, presenting and dismissing the view controller is animated. + @param handler The block called when the Done or Cancel button is pressed. + */ +- (void)presentModallyFromViewController:(UIViewController *)viewController + animated:(BOOL)animated + handler:(FBModalCompletionHandler)handler; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h new file mode 100644 index 0000000..5fdcedd --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FBWebDialogs.h @@ -0,0 +1,236 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBFrictionlessRecipientCache; +@class FBSession; +@protocol FBWebDialogsDelegate; + +/*! + @typedef NS_ENUM (NSUInteger, FBWebDialogResult) + + @abstract + Passed to a handler to indicate the result of a dialog being displayed to the user. + + @discussion Note `FBWebDialogResultDialogCompleted` is also used for cancelled operations. +*/ +typedef NS_ENUM(NSUInteger, FBWebDialogResult) { + /*! Indicates that the dialog action completed successfully. Note, that cancel operations represent completed dialog operations. + The url argument may be used to distinguish between success and user-cancelled cases */ + FBWebDialogResultDialogCompleted = 0, + /*! Indicates that the dialog operation was not completed. This occurs in cases such as the closure of the web-view using the X in the upper left corner. */ + FBWebDialogResultDialogNotCompleted +}; + +/*! + @typedef + + @abstract Defines a handler that will be called in response to the web dialog + being dismissed + */ +typedef void (^FBWebDialogHandler)( + FBWebDialogResult result, + NSURL *resultURL, + NSError *error); + +/*! + @class FBWebDialogs + + @abstract + Provides methods to display web based dialogs to the user. +*/ +@interface FBWebDialogs : NSObject + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook web dialog (https://developers.facebook.com/docs/reference/dialogs/ ) + such as feed or apprequest. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present, or returns NO, if not. + + @param dialog Represents the dialog or method name, such as @"feed" + + @param parameters A dictionary of parameters to be passed to the dialog + + @param handler An optional handler that will be called when the dialog is dismissed. Note, + that if the method returns NO, the handler is not called. May be nil. + + @param delegate An optional delegate to allow for advanced processing of web based + dialogs. See 'FBWebDialogsDelegate' for more details. + */ ++ (void)presentDialogModallyWithSession:(FBSession *)session + dialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + delegate:(id)delegate; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +/*! + @abstract + Presents a Facebook apprequest dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param message The required message for the dialog. + + @param title An optional title for the dialog. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + + @param friendCache An optional cache object used to enable frictionless sharing for a known set of friends. The + cache instance should be preserved for the life of the session and reused for multiple calls to the present method. + As the users set of friends enabled for frictionless sharing changes, this method auto-updates the cache. + */ ++ (void)presentRequestsDialogModallyWithSession:(FBSession *)session + message:(NSString *)message + title:(NSString *)title + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler + friendCache:(FBFrictionlessRecipientCache *)friendCache; + +/*! + @abstract + Presents a Facebook feed dialog. + + @param session Represents the session to use for the dialog. May be nil, which uses + the active session if present. + + @param parameters A dictionary of additional parameters to be passed to the dialog. May be nil + + @param handler An optional handler that will be called when the dialog is dismissed. May be nil. + */ ++ (void)presentFeedDialogModallyWithSession:(FBSession *)session + parameters:(NSDictionary *)parameters + handler:(FBWebDialogHandler)handler; + +@end + +/*! + @protocol + + @abstract + The `FBWebDialogsDelegate` protocol enables the plugging of advanced behaviors into + the presentation flow of a Facebook web dialog. Advanced uses include modification + of parameters and application-level handling of links on the dialog. The + `FBFrictionlessRequestFriendCache` class implements this protocol to add frictionless + behaviors to a presentation of the request dialog. + */ +@protocol FBWebDialogsDelegate + +@optional + +/*! + @abstract + Called prior to the presentation of a web dialog + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A mutable dictionary of parameters which will be sent to the dialog. + + @param session The session object to use with the dialog. + */ +- (void)webDialogsWillPresentDialog:(NSString *)dialog + parameters:(NSMutableDictionary *)parameters + session:(FBSession *)session; + +/*! + @abstract + Called when the user of a dialog clicks a link that would cause a transition away from the application. + Your application may handle this method, and return NO if the URL handling will be performed by the application. + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param url The url in question, which will not be handled by the SDK if this method NO + */ +- (BOOL)webDialogsDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + shouldAutoHandleURL:(NSURL *)url; + +/*! + @abstract + Called when the dialog is about to be dismissed + + @param dialog A string representing the method or dialog name of the dialog being presented. + + @param parameters A dictionary of parameters which were sent to the dialog. + + @param session The session object to use with the dialog. + + @param result A pointer to a result, which may be read or changed by the handling method as needed + + @param url A pointer to a pointer to a URL representing the URL returned by the dialog, which may be read or changed by this mehthod + + @param error A pointer to a pointer to an error object which may be read or changed by this method as needed + */ +- (void)webDialogsWillDismissDialog:(NSString *)dialog + parameters:(NSDictionary *)parameters + session:(FBSession *)session + result:(FBWebDialogResult *)result + url:(NSURL **)url + error:(NSError **)error; + +@end + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h new file mode 100644 index 0000000..c3033e2 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/FacebookSDK.h @@ -0,0 +1,143 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// core +#import "FBAccessTokenData.h" +#import "FBAppCall.h" +#import "FBAppEvents.h" +#import "FBCacheDescriptor.h" +#import "FBDialogs.h" +#import "FBError.h" +#import "FBErrorUtility.h" +#import "FBFrictionlessRecipientCache.h" +#import "FBFriendPickerViewController.h" +#import "FBGraphLocation.h" +#import "FBGraphObject.h" // + design summary for graph component-group +#import "FBGraphPlace.h" +#import "FBGraphUser.h" +#import "FBInsights.h" +#import "FBLikeControl.h" +#import "FBLoginView.h" +#import "FBNativeDialogs.h" // deprecated, use FBDialogs.h +#import "FBOpenGraphAction.h" +#import "FBOpenGraphActionShareDialogParams.h" +#import "FBOpenGraphObject.h" +#import "FBPlacePickerViewController.h" +#import "FBProfilePictureView.h" +#import "FBRequest.h" +#import "FBSession.h" +#import "FBSessionTokenCachingStrategy.h" +#import "FBSettings.h" +#import "FBShareDialogParams.h" +#import "FBShareDialogPhotoParams.h" +#import "FBTaggableFriendPickerViewController.h" +#import "FBUserSettingsViewController.h" +#import "FBWebDialogs.h" +#import "NSError+FBError.h" + +/*! + @header + + @abstract Library header, import this to import all of the public types + in the Facebook SDK + + @discussion + +//////////////////////////////////////////////////////////////////////////////// + + + Summary: this header summarizes the structure and goals of the Facebook SDK for iOS. + Goals: + * Leverage and work well with modern features of iOS (e.g. blocks, ARC, etc.) + * Patterned after best of breed iOS frameworks (e.g. naming, pattern-use, etc.) + * Common integration experience is simple & easy to describe + * Factored to enable a growing list of scenarios over time + + Notes on approaches: + 1. We use a key scenario to drive prioritization of work for a given update + 2. We are building-atop and refactoring, rather than replacing, existing iOS SDK releases + 3. We use take an incremental approach where we can choose to maintain as little or as much compatibility with the existing SDK needed + a) and so we will be developing to this approach + b) and then at push-time for a release we will decide when/what to break + on a feature by feature basis + 4. Some light but critical infrastructure is needed to support both the goals + and the execution of this change (e.g. a build/package/deploy process) + + Design points: + We will move to a more object-oriented approach, in order to facilitate the + addition of a different class of objects, such as controls and visual helpers + (e.g. FBLikeView, FBPersonView), as well as sub-frameworks to enable scenarios + such (e.g. FBOpenGraphEntity, FBLocalEntityCache, etc.) + + As we add features, it will no longer be appropriate to host all functionality + in the Facebook class, though it will be maintained for some time for migration + purposes. Instead functionality lives in related collections of classes. + +
+ @textblock
+
+               *------------* *----------*  *----------------* *---*
+  Scenario --> |FBPersonView| |FBLikeView|  | FBPlacePicker  | | F |
+               *------------* *----------*  *----------------* | a |
+               *-------------------*  *----------*  *--------* | c |
+ Component --> |   FBGraphObject   |  | FBDialog |  | FBView | | e |
+               *-------------------*  *----------*  *--------* | b |
+               *---------* *---------* *---------------------* | o |
+      Core --> |FBSession| |FBRequest| |Utilities (e.g. JSON)| | o |
+               *---------* *---------* *---------------------* * k *
+
+ @/textblock
+ 
+ + The figure above describes three layers of functionality, with the existing + Facebook on the side as a helper proxy to a subset of the overall SDK. The + layers loosely organize the SDK into *Core Objects* necessary to interface + with Facebook, higher-level *Framework Components* that feel like natural + extensions to existing frameworks such as UIKit and Foundation, but which + surface behavior broadly applicable to Facebook, and finally the + *Scenario Objects*, which provide deeper turn-key capibilities for useful + mobile scenarios. + + Use example (low barrier use case): + +
+ @textblock
+
+// log on to Facebook
+[FBSession sessionOpenWithPermissions:nil
+                    completionHandler:^(FBSession *session,
+                                        FBSessionState status,
+                                        NSError *error) {
+                        if (session.isOpen) {
+                            // request basic information for the user
+                            [FBRequestConnection startWithGraphPath:@"me"
+                                                  completionHandler:^void(FBRequestConnection *request,
+                                                                          id result,
+                                                                          NSError *error) {
+                                                      if (!error) {
+                                                          // get json from result
+                                                      }
+                                                  }];
+                        }
+                    }];
+ @/textblock
+ 
+ + */ + +#define FB_IOS_SDK_VERSION_STRING @"3.24.0" +#define FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2" + diff --git a/Vendor/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h b/Vendor/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h new file mode 100644 index 0000000..686b4ca --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Headers/NSError+FBError.h @@ -0,0 +1,78 @@ +/* + * Copyright 2010-present Facebook. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBError.h" + +/*! + @category NSError(FBError) + + @abstract + Adds additional properties to NSError to provide more information for Facebook related errors. + */ +@interface NSError (FBError) + +/*! + @abstract + Categorizes the error, if it is Facebook related, to simplify application mitigation behavior + + @discussion + In general, in response to an error connecting to Facebook, an application should, retry the + operation, request permissions, reconnect the application, or prompt the user to take an action. + The error category can be used to understand the class of error received from Facebook. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) FBErrorCategory fberrorCategory; + +/*! + @abstract + If YES indicates that a user action is required in order to successfully continue with the Facebook operation. + + @discussion + In general if fberrorShouldNotifyUser is NO, then the application has a straightforward mitigation, such as + retry the operation or request permissions from the user, etc. In some cases it is necessary for the user to + take an action before the application continues to attempt a Facebook connection. For more infomation on this + see https://developers.facebook.com/docs/reference/api/errors/ + */ +@property (readonly) BOOL fberrorShouldNotifyUser; + +/*! + @abstract + A message suitable for display to the user, describing a user action necessary to enable Facebook functionality. + Not all Facebook errors yield a message suitable for user display; however in all cases where + fberrorShouldNotifyUser is YES, this property returns a localizable message suitable for display. + + @see +[FBErrorUtility userMessageForError:] + */ +@property (readonly, copy) NSString *fberrorUserMessage; + +/*! + @abstract + A short summary of this error suitable for display to the user. + Not all Facebook errors yield a message/title suitable for user display; + However in all cases when title is available, user should be notified. + + @see +[FBErrorUtility userTitleForError:] + */ +@property (readonly, copy) NSString *fberrorUserTitle; + +/*! + @abstract + YES if this error is transient and may succeed if the initial action is retried as-is. + Application may use this information to display a "Retry" button, if user should be notified about this error. + */ +@property (readonly) BOOL fberrorIsTransient; + +@end diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings new file mode 100644 index 0000000..7fd7575 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/en.lproj/Localizable.strings differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings new file mode 100644 index 0000000..bb3ba24 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/Contents/Resources/he.lproj/Localizable.strings differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png new file mode 100644 index 0000000..9bafbb3 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png new file mode 100644 index 0000000..3c1028a Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/facebook-logo@2x.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg new file mode 100644 index 0000000..f056b80 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg new file mode 100644 index 0000000..abde7eb Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadLandscape@2x.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg new file mode 100644 index 0000000..2c16bd4 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg new file mode 100644 index 0000000..ae3e2bd Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPadPortrait@2x.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg new file mode 100644 index 0000000..f4d31c5 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg new file mode 100644 index 0000000..8eba2f1 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/loginBackgroundIPhonePortrait@2x.jpg differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png new file mode 100644 index 0000000..ba86100 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png new file mode 100644 index 0000000..5362071 Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-normal@2x.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png new file mode 100644 index 0000000..007388a Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png new file mode 100644 index 0000000..63a271b Binary files /dev/null and b/Vendor/FacebookSDK.framework/Versions/A/Resources/FBUserSettingsViewResources.bundle/images/silver-button-pressed@2x.png differ diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README b/Vendor/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README new file mode 100644 index 0000000..3ae35b4 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Resources/FacebookSDKResources.bundle.README @@ -0,0 +1,44 @@ +The FacebookSDKResources.bundle is no longer required in order to use the SDK. You may provide a bundle in cases where you need to override strings or images (e.g. internationalization, etc.) See https://developers.facebook.com/docs/reference/ios/current/constants/FBSettings#resourceBundleName for more information. + +The following is a list of keys for string localization: + +/* FBLoginView (aka FBLV) */ +"FBLV:LogOutButton" = "Log Out"; +"FBLV:LogInButton" = "Log In"; +"FBLV:LoggedInAs" = "Logged in as: %@"; +"FBLV:LoggedInUsingFacebook" = "Logged in using Facebook"; +"FBLV:LogOutAction" = "Log Out"; +"FBLV:CancelAction" = "Cancel"; + +/* FBPlacePickerViewController (FBPPVC) */ +"FBPPVC:NumWereHere" = "%@ were here"; + +/* FBError (aka FBE) */ +"FBE:ReconnectApplication" = "Please log into this app again to reconnect your Facebook account."; +"FBE:PasswordChangedDevice" = "Your Facebook password has changed. To confirm your password, open Settings > Facebook and tap your name."; +"FBE:PasswordChanged" = "Your Facebook password has changed. Please log into this app again to reconnect your Facebook account."; +"FBE:WebLogIn" = "Your Facebook account is locked. Please log into www.facebook.com to continue."; +"FBE:AppNotInstalled" = "Please log into this app again to reconnect your Facebook account."; +"FBE:GrantPermission" = "This app doesn’t have permission to do this. To change permissions, try logging into the app again."; +"FBE:Unconfirmed" = "Your Facebook account is locked. Please log into www.facebook.com to continue."; +"FBE:OAuthDevice" = "To use your Facebook account with this app, open Settings > Facebook and make sure this app is turned on."; +"FBE:DeviceError"= "Something went wrong. Please make sure you're connected to the internet and try again."; +"FBE:AlertMessageButton" = "OK"; + +Images should be placed in a directory called FacebookSDKImages in the bundle. Note that images will support @2x and -568h@2x. + +The following is a list of images supported: + +FacebookSDKImages\ + + FBDialogClose.png + + FBFriendPickerViewDefault.png + + FBLoginViewLoginButtonSmall.png + FBLoginViewLoginButtonSmallPressed.png + + FBPlacePickerViewGenericPlace.png + + FBProfilePictureViewBlankProfileSquare.png + FBProfilePictureViewBlankProfilePortrait.png diff --git a/Vendor/FacebookSDK.framework/Versions/A/Resources/Info.plist b/Vendor/FacebookSDK.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0dd599a --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + FacebookSDK + CFBundleIdentifier + com.facebook.sdk + CFBundleInfoDictionaryVersion + 1.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/Vendor/FacebookSDK.framework/Versions/Current b/Vendor/FacebookSDK.framework/Versions/Current new file mode 120000 index 0000000..044dcb9 --- /dev/null +++ b/Vendor/FacebookSDK.framework/Versions/Current @@ -0,0 +1 @@ +./A \ No newline at end of file