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..8be6aaf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +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 ParseFacebookUtilsV4-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 ParseFacebookUtilsV4.podspec + pod lib lint --use-libraries ParseFacebookUtilsV4.podspec + 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/ParseFacebookTestApplicationV4.xcconfig b/Configurations/ParseFacebookTestApplicationV4.xcconfig new file mode 100644 index 0000000..2a8ca9a --- /dev/null +++ b/Configurations/ParseFacebookTestApplicationV4.xcconfig @@ -0,0 +1,17 @@ +// +// 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 = ParseFacebookTestApplicationV4 + +CLANG_ENABLE_MODULES = YES + +INFOPLIST_FILE = $(SRCROOT)/Tests/TestApplication/Resources/Info.plist diff --git a/Configurations/ParseFacebookUtilsV4-UnitTests.xcconfig b/Configurations/ParseFacebookUtilsV4-UnitTests.xcconfig new file mode 100644 index 0000000..450f7d4 --- /dev/null +++ b/Configurations/ParseFacebookUtilsV4-UnitTests.xcconfig @@ -0,0 +1,23 @@ +// +// 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-ParseFacebookUtilsV4-UnitTests/Pods-ParseFacebookUtilsV4-UnitTests.debug.xcconfig" + +PRODUCT_NAME = ParseFacebookUtilsV4-UnitTests + +CLANG_ENABLE_MODULES = YES + +INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/Info.plist +TEST_HOST = $(BUILT_PRODUCTS_DIR)/ParseFacebookTestApplicationV4.app/ParseFacebookTestApplicationV4 + +FRAMEWORK_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) $(SRCROOT)/Vendor +LIBRARY_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) +HEADER_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) diff --git a/Configurations/ParseFacebookUtilsV4-iOS.xcconfig b/Configurations/ParseFacebookUtilsV4-iOS.xcconfig new file mode 100644 index 0000000..1495237 --- /dev/null +++ b/Configurations/ParseFacebookUtilsV4-iOS.xcconfig @@ -0,0 +1,25 @@ +// +// 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 = ParseFacebookUtilsV4 + +MACH_O_TYPE = staticlib +DEFINES_MODULE = YES +CLANG_ENABLE_MODULES = YES + +INFOPLIST_FILE = $(SRCROOT)/Resources/Info.plist + +FRAMEWORK_SEARCH_PATHS = $(inherited) $(SRCROOT)/Vendor +LIBRARY_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) +HEADER_SEARCH_PATHS = $(inherited) $(BUILT_PRODUCTS_DIR) + +OTHER_CFLAGS[sdk=iphoneos9.0] = $(inherited) -fembed-bitcode 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.xcodeproj/project.pbxproj b/ParseFacebookUtils.xcodeproj/project.pbxproj new file mode 100644 index 0000000..99f5ae6 --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/project.pbxproj @@ -0,0 +1,723 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 813DFC861AB2510300F25A08 /* PFFacebookAuthenticationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 813DFC801AB2510300F25A08 /* PFFacebookAuthenticationProvider.h */; }; + 813DFC871AB2510300F25A08 /* PFFacebookAuthenticationProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 813DFC811AB2510300F25A08 /* PFFacebookAuthenticationProvider.m */; }; + 813DFC8A1AB2510300F25A08 /* PFFacebookUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 813DFC841AB2510300F25A08 /* PFFacebookUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 813DFC8B1AB2510300F25A08 /* PFFacebookUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 813DFC851AB2510300F25A08 /* PFFacebookUtils.m */; }; + 813DFC931AB2515A00F25A08 /* Bolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC921AB2515A00F25A08 /* Bolts.framework */; }; + 813DFC951AB251F700F25A08 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC941AB251F700F25A08 /* Parse.framework */; }; + 815FC59A1BBF74890006AF6E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 815FC5971BBF74890006AF6E /* main.m */; settings = {ASSET_TAGS = (); }; }; + 81643D771AB79ABD00DD3E65 /* PFFacebookUtils_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 81643D761AB79ABD00DD3E65 /* PFFacebookUtils_Private.h */; }; + 81643D7D1AB79DCE00DD3E65 /* PFFacebookAuthenticationProvider_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 81643D7C1AB79DCE00DD3E65 /* PFFacebookAuthenticationProvider_Private.h */; }; + 81930A3E1BBE1A0600A5E4BB /* PFFacebookTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 81930A3D1BBE1A0600A5E4BB /* PFFacebookTestCase.m */; settings = {ASSET_TAGS = (); }; }; + 81B3F22B1AC9CA5300A92677 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 81B3F22A1AC9CA5300A92677 /* Localizable.strings */; }; + 81CB98CC1AB7905D00136FA5 /* ParseFacebookUtilsV4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC07E0554694100DB518D /* ParseFacebookUtilsV4.framework */; }; + 81CB98D81AB791FB00136FA5 /* Bolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC921AB2515A00F25A08 /* Bolts.framework */; }; + 81CB98D91AB7920700136FA5 /* FBSDKCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81DA692F1AB25A36008C3B7F /* FBSDKCoreKit.framework */; }; + 81CB98DA1AB7920700136FA5 /* FBSDKLoginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81DA69301AB25A36008C3B7F /* FBSDKLoginKit.framework */; }; + 81CB98DB1AB7920E00136FA5 /* Parse.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 813DFC941AB251F700F25A08 /* Parse.framework */; }; + 81CB98DD1AB7921C00136FA5 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 81CB98DC1AB7921C00136FA5 /* libsqlite3.dylib */; }; + 81CB98DF1AB7922600136FA5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81CB98DE1AB7922600136FA5 /* AudioToolbox.framework */; }; + 81CB98E11AB7922C00136FA5 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81CB98E01AB7922C00136FA5 /* SystemConfiguration.framework */; }; + 81DA69311AB25A36008C3B7F /* FBSDKCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81DA692F1AB25A36008C3B7F /* FBSDKCoreKit.framework */; }; + 81DA69321AB25A37008C3B7F /* FBSDKLoginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81DA69301AB25A36008C3B7F /* FBSDKLoginKit.framework */; }; + 81E35FD41BAA6F8400348526 /* PFFacebookPrivateUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 81E35FD21BAA6F8400348526 /* PFFacebookPrivateUtilities.h */; settings = {ASSET_TAGS = (); }; }; + 81E35FD51BAA6F8400348526 /* PFFacebookPrivateUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E35FD31BAA6F8400348526 /* PFFacebookPrivateUtilities.m */; settings = {ASSET_TAGS = (); }; }; + 81EDD4B51B58AC7D002F69C0 /* ParseFacebookUtilsV4.h in Headers */ = {isa = PBXBuildFile; fileRef = 81EDD4B41B58AC7D002F69C0 /* ParseFacebookUtilsV4.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 982A9BABCF8E7DD3F3C2C18D /* libPods-ParseFacebookUtilsV4-UnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 02DBE4F2899D193F056501A4 /* libPods-ParseFacebookUtilsV4-UnitTests.a */; }; + F5E3229B1B549C2C00E319F9 /* FacebookAuthenticationProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E3229A1B549C2C00E319F9 /* FacebookAuthenticationProviderTests.m */; }; + F5E3229D1B5583A800E319F9 /* FacebookUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E3229C1B5583A800E319F9 /* FacebookUtilsTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 81CB98CD1AB7905D00136FA5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = "ParseFacebookUtils_v4-iOS"; + }; + F52CD6191B58311F0051AB86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F535C73A1B54B4A800A7D81E; + remoteInfo = ParseFacebookTestApplicationV4; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 02DBE4F2899D193F056501A4 /* libPods-ParseFacebookUtilsV4-UnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ParseFacebookUtilsV4-UnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 813DFC801AB2510300F25A08 /* PFFacebookAuthenticationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookAuthenticationProvider.h; sourceTree = ""; }; + 813DFC811AB2510300F25A08 /* PFFacebookAuthenticationProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookAuthenticationProvider.m; sourceTree = ""; }; + 813DFC841AB2510300F25A08 /* PFFacebookUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookUtils.h; sourceTree = ""; }; + 813DFC851AB2510300F25A08 /* PFFacebookUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookUtils.m; 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; }; + 815FC5971BBF74890006AF6E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 815FC5991BBF74890006AF6E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 81643D761AB79ABD00DD3E65 /* PFFacebookUtils_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PFFacebookUtils_Private.h; path = Internal/PFFacebookUtils_Private.h; sourceTree = ""; }; + 81643D7C1AB79DCE00DD3E65 /* PFFacebookAuthenticationProvider_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookAuthenticationProvider_Private.h; sourceTree = ""; }; + 8178BE9C1B716BF200051CF4 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; + 8178BE9E1B716BF200051CF4 /* iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = ""; }; + 8178BE9F1B716BF300051CF4 /* OSX.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = OSX.xcconfig; sourceTree = ""; }; + 8178BEA11B716BF300051CF4 /* Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Application.xcconfig; sourceTree = ""; }; + 8178BEA21B716BF300051CF4 /* Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Framework.xcconfig; sourceTree = ""; }; + 8178BEA31B716BF300051CF4 /* UnitTest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = UnitTest.xcconfig; sourceTree = ""; }; + 8178BEA51B716BF300051CF4 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + 8178BEA61B716BF300051CF4 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 8178BEA81B716BF300051CF4 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 81930A3C1BBE1A0600A5E4BB /* PFFacebookTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookTestCase.h; sourceTree = ""; }; + 81930A3D1BBE1A0600A5E4BB /* PFFacebookTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookTestCase.m; sourceTree = ""; }; + 81B3F22A1AC9CA5300A92677 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Localizable.strings; path = Resources/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 81CB98C61AB7905D00136FA5 /* ParseFacebookUtilsV4-UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ParseFacebookUtilsV4-UnitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 81CB98DC1AB7921C00136FA5 /* 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; }; + 81CB98DE1AB7922600136FA5 /* 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; }; + 81CB98E01AB7922C00136FA5 /* 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; }; + 81DA692F1AB25A36008C3B7F /* FBSDKCoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FBSDKCoreKit.framework; path = Vendor/FBSDKCoreKit.framework; sourceTree = ""; }; + 81DA69301AB25A36008C3B7F /* FBSDKLoginKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FBSDKLoginKit.framework; path = Vendor/FBSDKLoginKit.framework; sourceTree = ""; }; + 81E35FD21BAA6F8400348526 /* PFFacebookPrivateUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFFacebookPrivateUtilities.h; sourceTree = ""; }; + 81E35FD31BAA6F8400348526 /* PFFacebookPrivateUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFFacebookPrivateUtilities.m; sourceTree = ""; }; + 81EDD4B41B58AC7D002F69C0 /* ParseFacebookUtilsV4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParseFacebookUtilsV4.h; sourceTree = ""; }; + D2AAC07E0554694100DB518D /* ParseFacebookUtilsV4.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ParseFacebookUtilsV4.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F52CD64A1B5838560051AB86 /* ParseFacebookUtilsV4-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ParseFacebookUtilsV4-iOS.xcconfig"; sourceTree = ""; }; + F52CD64B1B5838620051AB86 /* ParseFacebookUtilsV4-UnitTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ParseFacebookUtilsV4-UnitTests.xcconfig"; sourceTree = ""; }; + F52CD64C1B58386F0051AB86 /* ParseFacebookTestApplicationV4.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ParseFacebookTestApplicationV4.xcconfig; sourceTree = ""; }; + F535C73B1B54B4A800A7D81E /* ParseFacebookTestApplicationV4.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ParseFacebookTestApplicationV4.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F5E3229A1B549C2C00E319F9 /* FacebookAuthenticationProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthenticationProviderTests.m; sourceTree = ""; }; + F5E3229C1B5583A800E319F9 /* FacebookUtilsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookUtilsTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 81CB98C31AB7905D00136FA5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 81CB98E11AB7922C00136FA5 /* SystemConfiguration.framework in Frameworks */, + 81CB98DF1AB7922600136FA5 /* AudioToolbox.framework in Frameworks */, + 81CB98DD1AB7921C00136FA5 /* libsqlite3.dylib in Frameworks */, + 81CB98CC1AB7905D00136FA5 /* ParseFacebookUtilsV4.framework in Frameworks */, + 81CB98D81AB791FB00136FA5 /* Bolts.framework in Frameworks */, + 81CB98D91AB7920700136FA5 /* FBSDKCoreKit.framework in Frameworks */, + 81CB98DA1AB7920700136FA5 /* FBSDKLoginKit.framework in Frameworks */, + 81CB98DB1AB7920E00136FA5 /* Parse.framework in Frameworks */, + 982A9BABCF8E7DD3F3C2C18D /* libPods-ParseFacebookUtilsV4-UnitTests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 813DFC951AB251F700F25A08 /* Parse.framework in Frameworks */, + 81DA69311AB25A36008C3B7F /* FBSDKCoreKit.framework in Frameworks */, + 81DA69321AB25A37008C3B7F /* FBSDKLoginKit.framework in Frameworks */, + 813DFC931AB2515A00F25A08 /* Bolts.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F535C7381B54B4A800A7D81E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* ParseFacebookUtilsV4.framework */, + 81CB98C61AB7905D00136FA5 /* ParseFacebookUtilsV4-UnitTests.xctest */, + F535C73B1B54B4A800A7D81E /* ParseFacebookTestApplicationV4.app */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* Breakpad */ = { + isa = PBXGroup; + children = ( + F52CD63A1B58383C0051AB86 /* Configurations */, + 813DFC7E1AB2510300F25A08 /* ParseFacebookUtilsV4 */, + 813DFC961AB2524C00F25A08 /* Resources */, + 81CB98D21AB7906D00136FA5 /* Tests */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + 9274417D12A02673DA657222 /* Pods */, + ); + indentWidth = 4; + name = Breakpad; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 813DFC8F1AB2513D00F25A08 /* User Frameworks */, + 813DFC8E1AB2513300F25A08 /* System Frameworks */, + 02DBE4F2899D193F056501A4 /* libPods-ParseFacebookUtilsV4-UnitTests.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 813DFC7E1AB2510300F25A08 /* ParseFacebookUtilsV4 */ = { + isa = PBXGroup; + children = ( + 813DFC7F1AB2510300F25A08 /* Internal */, + 81EDD4B41B58AC7D002F69C0 /* ParseFacebookUtilsV4.h */, + 813DFC841AB2510300F25A08 /* PFFacebookUtils.h */, + 81643D761AB79ABD00DD3E65 /* PFFacebookUtils_Private.h */, + 813DFC851AB2510300F25A08 /* PFFacebookUtils.m */, + ); + name = ParseFacebookUtilsV4; + path = ParseFacebookUtils; + sourceTree = ""; + }; + 813DFC7F1AB2510300F25A08 /* Internal */ = { + isa = PBXGroup; + children = ( + 813DFC801AB2510300F25A08 /* PFFacebookAuthenticationProvider.h */, + 81643D7C1AB79DCE00DD3E65 /* PFFacebookAuthenticationProvider_Private.h */, + 813DFC811AB2510300F25A08 /* PFFacebookAuthenticationProvider.m */, + 81E35FD21BAA6F8400348526 /* PFFacebookPrivateUtilities.h */, + 81E35FD31BAA6F8400348526 /* PFFacebookPrivateUtilities.m */, + ); + path = Internal; + sourceTree = ""; + }; + 813DFC8E1AB2513300F25A08 /* System Frameworks */ = { + isa = PBXGroup; + children = ( + 81CB98E01AB7922C00136FA5 /* SystemConfiguration.framework */, + 81CB98DE1AB7922600136FA5 /* AudioToolbox.framework */, + 81CB98DC1AB7921C00136FA5 /* libsqlite3.dylib */, + ); + name = "System Frameworks"; + sourceTree = ""; + }; + 813DFC8F1AB2513D00F25A08 /* User Frameworks */ = { + isa = PBXGroup; + children = ( + 81DA692F1AB25A36008C3B7F /* FBSDKCoreKit.framework */, + 81DA69301AB25A36008C3B7F /* FBSDKLoginKit.framework */, + 813DFC941AB251F700F25A08 /* Parse.framework */, + 813DFC921AB2515A00F25A08 /* Bolts.framework */, + ); + name = "User Frameworks"; + sourceTree = ""; + }; + 813DFC961AB2524C00F25A08 /* Resources */ = { + isa = PBXGroup; + children = ( + 81B3F22A1AC9CA5300A92677 /* Localizable.strings */, + ); + path = Resources; + sourceTree = ""; + }; + 815FC5951BBF74890006AF6E /* TestApplication */ = { + isa = PBXGroup; + children = ( + 815FC5961BBF74890006AF6E /* Classes */, + 815FC5981BBF74890006AF6E /* Resources */, + ); + path = TestApplication; + sourceTree = ""; + }; + 815FC5961BBF74890006AF6E /* Classes */ = { + isa = PBXGroup; + children = ( + 815FC5971BBF74890006AF6E /* main.m */, + ); + path = Classes; + sourceTree = ""; + }; + 815FC5981BBF74890006AF6E /* Resources */ = { + isa = PBXGroup; + children = ( + 815FC5991BBF74890006AF6E /* Info.plist */, + ); + path = Resources; + sourceTree = ""; + }; + 8178BE9B1B716BF200051CF4 /* Shared */ = { + isa = PBXGroup; + children = ( + 8178BE9C1B716BF200051CF4 /* Common.xcconfig */, + 8178BE9D1B716BF200051CF4 /* Platform */, + 8178BEA01B716BF300051CF4 /* Product */, + 8178BEA41B716BF300051CF4 /* Project */, + 8178BEA81B716BF300051CF4 /* Warnings.xcconfig */, + ); + path = Shared; + sourceTree = ""; + }; + 8178BE9D1B716BF200051CF4 /* Platform */ = { + isa = PBXGroup; + children = ( + 8178BE9E1B716BF200051CF4 /* iOS.xcconfig */, + 8178BE9F1B716BF300051CF4 /* OSX.xcconfig */, + ); + path = Platform; + sourceTree = ""; + }; + 8178BEA01B716BF300051CF4 /* Product */ = { + isa = PBXGroup; + children = ( + 8178BEA11B716BF300051CF4 /* Application.xcconfig */, + 8178BEA21B716BF300051CF4 /* Framework.xcconfig */, + 8178BEA31B716BF300051CF4 /* UnitTest.xcconfig */, + ); + path = Product; + sourceTree = ""; + }; + 8178BEA41B716BF300051CF4 /* Project */ = { + isa = PBXGroup; + children = ( + 8178BEA51B716BF300051CF4 /* Debug.xcconfig */, + 8178BEA61B716BF300051CF4 /* Release.xcconfig */, + ); + path = Project; + sourceTree = ""; + }; + 81930A3A1BBE1A0600A5E4BB /* Other */ = { + isa = PBXGroup; + children = ( + 81930A3B1BBE1A0600A5E4BB /* TestCase */, + ); + path = Other; + sourceTree = ""; + }; + 81930A3B1BBE1A0600A5E4BB /* TestCase */ = { + isa = PBXGroup; + children = ( + 81930A3C1BBE1A0600A5E4BB /* PFFacebookTestCase.h */, + 81930A3D1BBE1A0600A5E4BB /* PFFacebookTestCase.m */, + ); + path = TestCase; + sourceTree = ""; + }; + 81CB98D21AB7906D00136FA5 /* Tests */ = { + isa = PBXGroup; + children = ( + F535C7311B54B45400A7D81E /* Unit */, + 81930A3A1BBE1A0600A5E4BB /* Other */, + 815FC5951BBF74890006AF6E /* TestApplication */, + ); + path = Tests; + sourceTree = ""; + }; + 9274417D12A02673DA657222 /* Pods */ = { + isa = PBXGroup; + children = ( + ); + name = Pods; + sourceTree = ""; + }; + F52CD63A1B58383C0051AB86 /* Configurations */ = { + isa = PBXGroup; + children = ( + 8178BE9B1B716BF200051CF4 /* Shared */, + F52CD64A1B5838560051AB86 /* ParseFacebookUtilsV4-iOS.xcconfig */, + F52CD64B1B5838620051AB86 /* ParseFacebookUtilsV4-UnitTests.xcconfig */, + F52CD64C1B58386F0051AB86 /* ParseFacebookTestApplicationV4.xcconfig */, + ); + path = Configurations; + sourceTree = ""; + }; + F535C7311B54B45400A7D81E /* Unit */ = { + isa = PBXGroup; + children = ( + F5E3229A1B549C2C00E319F9 /* FacebookAuthenticationProviderTests.m */, + F5E3229C1B5583A800E319F9 /* FacebookUtilsTests.m */, + ); + path = Unit; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 813DFC8A1AB2510300F25A08 /* PFFacebookUtils.h in Headers */, + 81EDD4B51B58AC7D002F69C0 /* ParseFacebookUtilsV4.h in Headers */, + 81E35FD41BAA6F8400348526 /* PFFacebookPrivateUtilities.h in Headers */, + 81643D7D1AB79DCE00DD3E65 /* PFFacebookAuthenticationProvider_Private.h in Headers */, + 81643D771AB79ABD00DD3E65 /* PFFacebookUtils_Private.h in Headers */, + 813DFC861AB2510300F25A08 /* PFFacebookAuthenticationProvider.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 81CB98C51AB7905D00136FA5 /* ParseFacebookUtilsV4-UnitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 81CB98D11AB7905D00136FA5 /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV4-UnitTests" */; + buildPhases = ( + 947535AF3D7FE64739018338 /* Check Pods Manifest.lock */, + 81CB98C21AB7905D00136FA5 /* Sources */, + 81CB98C31AB7905D00136FA5 /* Frameworks */, + 81CB98C41AB7905D00136FA5 /* Resources */, + 59A0049CBA9158822CB055BC /* Copy Pods Resources */, + A72EB79485B8A201DDE9573A /* Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + F52CD61A1B58311F0051AB86 /* PBXTargetDependency */, + 81CB98CE1AB7905D00136FA5 /* PBXTargetDependency */, + ); + name = "ParseFacebookUtilsV4-UnitTests"; + productName = "ParseFacebookUtilsV4-Tests"; + productReference = 81CB98C61AB7905D00136FA5 /* ParseFacebookUtilsV4-UnitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D2AAC07D0554694100DB518D /* ParseFacebookUtilsV4-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV4-iOS" */; + buildPhases = ( + 81F035FB1BC332C00055BFDE /* Fetch latest Dependencies */, + 81B3F2291AC9CA2600A92677 /* Generate Localizable Strings */, + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + 8139B1341A7BF6B5002BEF84 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ParseFacebookUtilsV4-iOS"; + productName = Breakpad; + productReference = D2AAC07E0554694100DB518D /* ParseFacebookUtilsV4.framework */; + productType = "com.apple.product-type.framework"; + }; + F535C73A1B54B4A800A7D81E /* ParseFacebookTestApplicationV4 */ = { + isa = PBXNativeTarget; + buildConfigurationList = F535C75B1B54B4A800A7D81E /* Build configuration list for PBXNativeTarget "ParseFacebookTestApplicationV4" */; + buildPhases = ( + F535C7371B54B4A800A7D81E /* Sources */, + F535C7381B54B4A800A7D81E /* Frameworks */, + F535C7391B54B4A800A7D81E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ParseFacebookTestApplicationV4; + productName = ParseFacebookTestApplicationV4; + productReference = F535C73B1B54B4A800A7D81E /* ParseFacebookTestApplicationV4.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 = { + 81CB98C51AB7905D00136FA5 = { + CreatedOnToolsVersion = 6.2; + TestTargetID = F535C73A1B54B4A800A7D81E; + }; + F535C73A1B54B4A800A7D81E = { + 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 /* ParseFacebookUtilsV4-iOS */, + 81CB98C51AB7905D00136FA5 /* ParseFacebookUtilsV4-UnitTests */, + F535C73A1B54B4A800A7D81E /* ParseFacebookTestApplicationV4 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8139B1341A7BF6B5002BEF84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81B3F22B1AC9CA5300A92677 /* Localizable.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 81CB98C41AB7905D00136FA5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F535C7391B54B4A800A7D81E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 59A0049CBA9158822CB055BC /* 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-ParseFacebookUtilsV4-UnitTests/Pods-ParseFacebookUtilsV4-UnitTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 81B3F2291AC9CA2600A92677 /* 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\""; + }; + 81F035FB1BC332C00055BFDE /* Fetch latest Dependencies */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Fetch latest Dependencies"; + 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 -L $ARCHIVE_URL -o $ARCHIVE_NAME\n\n unzip $ARCHIVE_NAME\n rm $ARCHIVE_NAME\nfi\n\n#\n# Uncomment and move to fetching FBSDK the moment it's not flaky to download\n#\n# if [[ ! -d \"FBSDKCoreKit.framework\" || ! -d \"FBSDKLoginKit.framework\" ]]; then\n# ARCHIVE_NAME=FBSDK.zip\n#\n# ARCHIVE_URL=\"https://origincache.facebook.com/developers/resources/?id=facebook-ios-sdk-current.zip\"\n# curl $ARCHIVE_URL -o $ARCHIVE_NAME\n#\n# unzip $ARCHIVE_NAME -d fbsdk\n# mv fbsdk/FBSDKCoreKit.framework .\n# mv fbsdk/FBSDKLoginKit.framework .\n#\n# rm $ARCHIVE_NAME\n# rm -r fbsdk\n# fi\n"; + showEnvVarsInLog = 0; + }; + 947535AF3D7FE64739018338 /* 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; + }; + A72EB79485B8A201DDE9573A /* 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-ParseFacebookUtilsV4-UnitTests/Pods-ParseFacebookUtilsV4-UnitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 81CB98C21AB7905D00136FA5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81930A3E1BBE1A0600A5E4BB /* PFFacebookTestCase.m in Sources */, + F5E3229D1B5583A800E319F9 /* FacebookUtilsTests.m in Sources */, + F5E3229B1B549C2C00E319F9 /* FacebookAuthenticationProviderTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 813DFC8B1AB2510300F25A08 /* PFFacebookUtils.m in Sources */, + 813DFC871AB2510300F25A08 /* PFFacebookAuthenticationProvider.m in Sources */, + 81E35FD51BAA6F8400348526 /* PFFacebookPrivateUtilities.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F535C7371B54B4A800A7D81E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 815FC59A1BBF74890006AF6E /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 81CB98CE1AB7905D00136FA5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* ParseFacebookUtilsV4-iOS */; + targetProxy = 81CB98CD1AB7905D00136FA5 /* PBXContainerItemProxy */; + }; + F52CD61A1B58311F0051AB86 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F535C73A1B54B4A800A7D81E /* ParseFacebookTestApplicationV4 */; + targetProxy = F52CD6191B58311F0051AB86 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64A1B5838560051AB86 /* ParseFacebookUtilsV4-iOS.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64A1B5838560051AB86 /* ParseFacebookUtilsV4-iOS.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8178BEA51B716BF300051CF4 /* Debug.xcconfig */; + buildSettings = { + PARSE_DIR = "$(PROJECT_DIR)/.."; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8178BEA61B716BF300051CF4 /* Release.xcconfig */; + buildSettings = { + PARSE_DIR = "$(PROJECT_DIR)/.."; + }; + name = Release; + }; + 81CB98CF1AB7905D00136FA5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64B1B5838620051AB86 /* ParseFacebookUtilsV4-UnitTests.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 81CB98D01AB7905D00136FA5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64B1B5838620051AB86 /* ParseFacebookUtilsV4-UnitTests.xcconfig */; + buildSettings = { + }; + name = Release; + }; + F535C75C1B54B4A800A7D81E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64C1B58386F0051AB86 /* ParseFacebookTestApplicationV4.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + F535C75D1B54B4A800A7D81E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F52CD64C1B58386F0051AB86 /* ParseFacebookTestApplicationV4.xcconfig */; + buildSettings = { + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV4-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; + }; + 81CB98D11AB7905D00136FA5 /* Build configuration list for PBXNativeTarget "ParseFacebookUtilsV4-UnitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 81CB98CF1AB7905D00136FA5 /* Debug */, + 81CB98D01AB7905D00136FA5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F535C75B1B54B4A800A7D81E /* Build configuration list for PBXNativeTarget "ParseFacebookTestApplicationV4" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F535C75C1B54B4A800A7D81E /* Debug */, + F535C75D1B54B4A800A7D81E /* 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..04cd5da --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme new file mode 100644 index 0000000..ce728e8 --- /dev/null +++ b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..3902182 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.h @@ -0,0 +1,48 @@ +/** + * 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 + +@class BFTask PF_GENERIC(__covariant BFGenericType); + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const PFFacebookUserAuthenticationType; + +@interface PFFacebookAuthenticationProvider : NSObject + +@property (nonatomic, strong, readonly) FBSDKLoginManager *loginManager; + +///-------------------------------------- +/// @name Init +///-------------------------------------- + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +- (instancetype)initWithApplication:(UIApplication *)application + launchOptions:(nullable NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER; ++ (instancetype)providerWithApplication:(UIApplication *)application + launchOptions:(nullable NSDictionary *)launchOptions;; + +///-------------------------------------- +/// @name Authenticate +///-------------------------------------- + +- (BFTask *)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *) *)readPermissions + publishPermissions:(nullable NSArray PF_GENERIC(NSString *) *)publishPermissions; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m new file mode 100644 index 0000000..a5765c1 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider.m @@ -0,0 +1,152 @@ +/** + * 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" +#import "PFFacebookAuthenticationProvider_Private.h" + +#import +#import + +#import +#import +#import + +#import + +#import + +#import "PFFacebookPrivateUtilities.h" + +NSString *const PFFacebookUserAuthenticationType = @"facebook"; + +@implementation PFFacebookAuthenticationProvider + +///-------------------------------------- +#pragma mark - Init +///-------------------------------------- + +- (instancetype)initWithApplication:(UIApplication *)application + launchOptions:(nullable NSDictionary *)launchOptions { + self = [super init]; + if (!self) return nil; + + _loginManager = [[FBSDKLoginManager alloc] init]; + + [[FBSDKApplicationDelegate sharedInstance] application:[UIApplication sharedApplication] + didFinishLaunchingWithOptions:launchOptions]; + + return self; +} + ++ (instancetype)providerWithApplication:(UIApplication *)application + launchOptions:(nullable NSDictionary *)launchOptions { + return [[self alloc] initWithApplication:application launchOptions:launchOptions]; +} + +///-------------------------------------- +#pragma mark - User Authentication Data +///-------------------------------------- + ++ (NSDictionary *)_userAuthenticationDataWithFacebookUserId:(NSString *)userId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate { + return @{ @"id" : userId, + @"access_token" : accessToken, + @"expiration_date" : [[NSDateFormatter pffb_preciseDateFormatter] stringFromDate:expirationDate] }; +} + ++ (NSDictionary *)_userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)token { + if (!token.userID || !token.tokenString || !token.expirationDate) { + return nil; + } + + return [self _userAuthenticationDataWithFacebookUserId:token.userID + accessToken:token.tokenString + expirationDate:token.expirationDate]; +} + ++ (FBSDKAccessToken *)_facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary PF_GENERIC(NSString *,NSString *) *)authData { + NSString *accessToken = authData[@"access_token"]; + NSString *expirationDateString = authData[@"expiration_date"]; + if (!accessToken || !expirationDateString) { + return nil; + } + + NSDate *expirationDate = [[NSDateFormatter pffb_preciseDateFormatter] dateFromString:expirationDateString]; + FBSDKAccessToken *token = [[FBSDKAccessToken alloc] initWithTokenString:accessToken + permissions:nil + declinedPermissions:nil + appID:[FBSDKSettings appID] + userID:authData[@"id"] + expirationDate:expirationDate + refreshDate:nil]; + return token; +} + +///-------------------------------------- +#pragma mark - Authenticate +///-------------------------------------- + +- (BFTask *)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *) *)readPermissions + publishPermissions:(nullable NSArray PF_GENERIC(NSString *) *)publishPermissions { + if (readPermissions && publishPermissions) { + NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException + reason:@"Read permissions are not permitted to be requested with publish permissions." + userInfo:nil]; + return [BFTask taskWithException:exception]; + } + + BFTaskCompletionSource *taskCompletionSource = [BFTaskCompletionSource taskCompletionSource]; + FBSDKLoginManagerRequestTokenHandler resultHandler = ^(FBSDKLoginManagerLoginResult *result, NSError *error) { + if (result.isCancelled) { + [taskCompletionSource cancel]; + } else if (error) { + taskCompletionSource.error = error; + } else { + taskCompletionSource.result = [[self class] _userAuthenticationDataFromAccessToken:result.token]; + } + }; + if (publishPermissions) { + [self.loginManager logInWithPublishPermissions:publishPermissions + fromViewController:[PFFacebookPrivateUtilities applicationTopViewController] + handler:resultHandler]; + } else { + [self.loginManager logInWithReadPermissions:readPermissions + fromViewController:[PFFacebookPrivateUtilities applicationTopViewController] + handler:resultHandler]; + } + return taskCompletionSource.task; +} + +///-------------------------------------- +#pragma mark - PFUserAuthenticationDelegate +///-------------------------------------- + +- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *,NSString *) *)authData { + FBSDKAccessToken *token = [[self class] _facebookAccessTokenFromUserAuthenticationData:authData]; + if (!token) { + // Only deauthenticate if authData was nil, otherwise - fail with an error + if (!authData) { + [self.loginManager logOut]; + return YES; + } + return NO; + } + + FBSDKAccessToken *currentToken = [FBSDKAccessToken currentAccessToken]; + // Do not reset the current token if we have the same token already set. + if (![currentToken.userID isEqualToString:token.userID] || + ![currentToken.tokenString isEqualToString:token.tokenString]) { + [FBSDKAccessToken setCurrentAccessToken:token]; + } + + return YES; +} + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h new file mode 100644 index 0000000..19870a6 --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookAuthenticationProvider_Private.h @@ -0,0 +1,25 @@ +/** + * 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" + +@class FBSDKAccessToken; + +@interface PFFacebookAuthenticationProvider () + +@property (nonatomic, strong, readwrite) FBSDKLoginManager *loginManager; + ++ (NSDictionary *)_userAuthenticationDataWithFacebookUserId:(NSString *)userId + accessToken:(NSString *)accessToken + expirationDate:(NSDate *)expirationDate; ++ (NSDictionary *)_userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)token; + +@end diff --git a/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h new file mode 100644 index 0000000..5642cbf --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h @@ -0,0 +1,42 @@ +/** + * 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 + +@interface PFFacebookPrivateUtilities : NSObject + ++ (UIViewController *)applicationTopViewController; + +@end + +@interface BFTask (ParseFacebookUtils) + +- (instancetype)pffb_continueWithMainThreadUserBlock:(PFUserResultBlock)block; +- (instancetype)pffb_continueWithMainThreadBooleanBlock:(PFBooleanResultBlock)block; +- (instancetype)pffb_continueWithMainThreadBlock:(BFContinuationBlock)block; + +@end + +@interface NSError (ParseFacebookUtils) + ++ (instancetype)pffb_invalidFacebookSessionError; + +@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..4859f1f --- /dev/null +++ b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m @@ -0,0 +1,72 @@ +/** + * 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 + ++ (UIViewController *)applicationTopViewController { + UIViewController *viewController = [UIApplication sharedApplication].keyWindow.rootViewController; + while (viewController.presentedViewController) { + viewController = viewController.presentedViewController; + } + return viewController; +} + +@end + +@implementation BFTask (ParseFacebookUtils) + +- (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 NSError (ParseFacebookUtils) + ++ (instancetype)pffb_invalidFacebookSessionError { + return [NSError errorWithDomain:PFParseErrorDomain + code:kPFErrorFacebookInvalidSession + userInfo:@{ NSLocalizedDescriptionKey : @"Supplied access token is missing required data." }]; +} + +@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/PFFacebookUtils_Private.h b/ParseFacebookUtils/Internal/PFFacebookUtils_Private.h new file mode 100644 index 0000000..b80a38e --- /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 (Private) + ++ (PFFacebookAuthenticationProvider *)_authenticationProvider; ++ (void)_setAuthenticationProvider:(PFFacebookAuthenticationProvider *)provider; + +@end diff --git a/ParseFacebookUtils/PFFacebookUtils.h b/ParseFacebookUtils/PFFacebookUtils.h new file mode 100644 index 0000000..8daf537 --- /dev/null +++ b/ParseFacebookUtils/PFFacebookUtils.h @@ -0,0 +1,266 @@ +/** + * 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 +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/*! + The `PFFacebookUtils` class provides utility functions for using Facebook authentication with s. + + @warning This class supports official Facebook iOS SDK v4.0+ and is available only on iOS. + */ +@interface PFFacebookUtils : NSObject + +///-------------------------------------- +/// @name Interacting With Facebook +///-------------------------------------- + +/*! + @abstract Initializes Parse Facebook Utils. + + @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 launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + */ ++ (void)initializeFacebookWithApplicationLaunchOptions:(nullable NSDictionary *)launchOptions; + +/*! + @abstract `FBSDKLoginManager` provides methods for configuring login behavior, default audience + and managing Facebook Access Token. + + @returns An instance of `FBSDKLoginManager` that is used by `PFFacebookUtils`. + */ ++ (FBSDKLoginManager *)facebookLoginManager; + +///-------------------------------------- +/// @name Logging In +///-------------------------------------- + +/*! + @abstract *Asynchronously* logs in a user using Facebook with read permissions. + + @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 Array of read permissions to use. + + @returns The task that has will a have `result` set to if operation succeeds. + */ ++ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract *Asynchronously* logs in a user using Facebook with read permissions. + + @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 Array of read permissions to use. + @param block The block to execute when the log in completes. + It should have the following signature: `^(PFUser *user, NSError *error)`. + */ ++ (void)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block; + +/*! + @abstract *Asynchronously* logs in a user using Facebook with publish permissions. + + @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 Array of publish permissions to use. + + @returns The task that has will a have `result` set to if operation succeeds. + */ ++ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract *Asynchronously* logs in a user using Facebook with publish permissions. + + @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 Array of publish permissions to use. + @param block The block to execute when the log in completes. + It should have the following signature: `^(PFUser *user, NSError *error)`. + */ ++ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block; + +/*! + @abstract *Asynchronously* logs in a user using given Facebook Acess Token. + + @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 accessToken An instance of `FBSDKAccessToken` to use when logging in. + + @returns The task that has will a have `result` set to if operation succeeds. + */ ++ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken; + +/*! + @abstract *Asynchronously* logs in a user using given Facebook Acess Token. + + @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 accessToken An instance of `FBSDKAccessToken` to use when logging in. + @param block The block to execute when the log in completes. + It should have the following signature: `^(PFUser *user, NSError *error)`. + */ ++ (void)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken + block:(nullable PFUserResultBlock)block; + +///-------------------------------------- +/// @name Linking Users +///-------------------------------------- + +/*! + @abstract *Asynchronously* links Facebook with read permissions to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param permissions Array of read permissions to use when logging in with Facebook. + + @returns The task that will have a `result` set to `@YES` if operation succeeds. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract *Asynchronously* links Facebook with read permissions to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param permissions Array of read permissions to use. + @param block The block to execute when the linking completes. + It should have the following signature: `^(BOOL succeeded, NSError *error)`. + */ ++ (void)linkUserInBackground:(PFUser *)user + withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block; + +/*! + @abstract *Asynchronously* links Facebook with publish permissions to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param permissions Array of publish permissions to use. + + @returns The task that will have a `result` set to `@YES` if operation succeeds. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions; + +/*! + @abstract *Asynchronously* links Facebook with publish permissions to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param permissions Array of publish permissions to use. + @param block The block to execute when the linking completes. + It should have the following signature: `^(BOOL succeeded, NSError *error)`. + */ ++ (void)linkUserInBackground:(PFUser *)user + withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block; + +/*! + @abstract *Asynchronously* links Facebook Access Token to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param accessToken An instance of `FBSDKAccessToken` to use. + + @returns The task that will have a `result` set to `@YES` if operation succeeds. + */ ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken; + +/*! + @abstract *Asynchronously* links Facebook Access Token to an existing . + + @discussion This method delegates to the Facebook SDK to authenticate + the user, and then automatically links the account to the . + It will also save any unsaved changes that were made to the `user`. + + @param user User to link to Facebook. + @param accessToken An instance of `FBSDKAccessToken` to use. + @param block The block to execute when the linking completes. + It should have the following signature: `^(BOOL succeeded, NSError *error)`. + */ ++ (void)linkUserInBackground:(PFUser *)user + withAccessToken:(FBSDKAccessToken *)accessToken + block:(nullable PFBooleanResultBlock)block; + +///-------------------------------------- +/// @name Unlinking Users +///-------------------------------------- + +/*! + @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; + +///-------------------------------------- +/// @name Getting Linked State +///-------------------------------------- + +/*! + @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; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ParseFacebookUtils/PFFacebookUtils.m b/ParseFacebookUtils/PFFacebookUtils.m new file mode 100644 index 0000000..1d894fb --- /dev/null +++ b/ParseFacebookUtils/PFFacebookUtils.m @@ -0,0 +1,187 @@ +/** + * 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 + +#import "PFFacebookAuthenticationProvider.h" +#import "PFFacebookAuthenticationProvider_Private.h" +#import "PFFacebookPrivateUtilities.h" + +@implementation PFFacebookUtils + +///-------------------------------------- +#pragma mark - Authentication Provider +///-------------------------------------- + +static PFFacebookAuthenticationProvider *authenticationProvider_; + ++ (void)_assertFacebookInitialized { + if (!authenticationProvider_) { + [NSException raise:NSInternalInconsistencyException format:@"You must initialize PFFacebookUtils with a call to +initializeFacebookWithApplicationLaunchOptions"]; + } +} + ++ (PFFacebookAuthenticationProvider *)_authenticationProvider { + return authenticationProvider_; +} + ++ (void)_setAuthenticationProvider:(PFFacebookAuthenticationProvider *)provider { + authenticationProvider_ = provider; +} + +///-------------------------------------- +#pragma mark - Interacting With Facebook +///-------------------------------------- + ++ (void)initializeFacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions { + if (!authenticationProvider_) { + PFFacebookAuthenticationProvider *provider = [PFFacebookAuthenticationProvider providerWithApplication:[UIApplication sharedApplication] + launchOptions:launchOptions]; + [PFUser registerAuthenticationDelegate:provider forAuthType:PFFacebookUserAuthenticationType]; + + [self _setAuthenticationProvider:provider]; + } +} + ++ (FBSDKLoginManager *)facebookLoginManager { + return [self _authenticationProvider].loginManager; +} + +///-------------------------------------- +#pragma mark - Logging In +///-------------------------------------- + ++ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + return [self _logInAsyncWithReadPermissions:permissions publishPermissions:nil]; +} + ++ (void)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block { + [[self logInInBackgroundWithReadPermissions:permissions] pffb_continueWithMainThreadUserBlock:block]; +} + ++ (BFTask *)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + return [self _logInAsyncWithReadPermissions:nil publishPermissions:permissions]; +} + ++ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFUserResultBlock)block { + [[self logInInBackgroundWithPublishPermissions:permissions] pffb_continueWithMainThreadUserBlock:block]; +} + ++ (BFTask PF_GENERIC(PFUser *)*)_logInAsyncWithReadPermissions:(NSArray PF_GENERIC(NSString *)*)readPermissions + publishPermissions:(NSArray PF_GENERIC(NSString *)*)publishPermissions { + [self _assertFacebookInitialized]; + + PFFacebookAuthenticationProvider *provider = [self _authenticationProvider]; + return [[provider authenticateAsyncWithReadPermissions:readPermissions + publishPermissions:publishPermissions] continueWithSuccessBlock:^id(BFTask *task) { + return [PFUser logInWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:task.result]; + }]; +} + ++ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken { + [self _assertFacebookInitialized]; + + NSDictionary *authData = [PFFacebookAuthenticationProvider _userAuthenticationDataFromAccessToken:accessToken]; + if (!authData) { + return [BFTask taskWithError:[NSError pffb_invalidFacebookSessionError]]; + } + return [[PFUser logInWithAuthTypeInBackground:PFFacebookUserAuthenticationType + authData:authData] continueWithSuccessBlock:^id(BFTask *task) { + [FBSDKAccessToken setCurrentAccessToken:accessToken]; + return task; // Return the same result. + }]; +} + ++ (void)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken + block:(nullable PFUserResultBlock)block { + [[self logInInBackgroundWithAccessToken:accessToken] pffb_continueWithMainThreadUserBlock:block]; +} + +///-------------------------------------- +#pragma mark - Linking Users +///-------------------------------------- + ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions { + return [self _linkUserAsync:user withReadPermissions:permissions publishPermissions:nil]; +} + ++ (void)linkUserInBackground:(PFUser *)user + withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block { + [[self linkUserInBackground:user withReadPermissions:permissions] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user + withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions { + return [self _linkUserAsync:user withReadPermissions:nil publishPermissions:permissions]; +} + ++ (void)linkUserInBackground:(PFUser *)user + withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions + block:(nullable PFBooleanResultBlock)block { + [[self linkUserInBackground:user withPublishPermissions:permissions] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken { + [self _assertFacebookInitialized]; + + NSDictionary *authData = [PFFacebookAuthenticationProvider _userAuthenticationDataFromAccessToken:accessToken]; + if (!authData) { + return [BFTask taskWithError:[NSError pffb_invalidFacebookSessionError]]; + } + return [user linkWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:authData]; +} + ++ (void)linkUserInBackground:(PFUser *)user + withAccessToken:(FBSDKAccessToken *)accessToken + block:(nullable PFBooleanResultBlock)block { + [[self linkUserInBackground:user withAccessToken:accessToken] pffb_continueWithMainThreadBooleanBlock:block]; +} + ++ (BFTask *)_linkUserAsync:(PFUser *)user + withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions + publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions { + [self _assertFacebookInitialized]; + + PFFacebookAuthenticationProvider *authenticationProvider = [self _authenticationProvider]; + return [[authenticationProvider authenticateAsyncWithReadPermissions:readPermissions + publishPermissions:publishPermissions] continueWithSuccessBlock:^id(BFTask *task) { + return [user linkWithAuthTypeInBackground:PFFacebookUserAuthenticationType authData:task.result]; + }]; +} + +///-------------------------------------- +#pragma mark - Unlinking +///-------------------------------------- + ++ (BFTask PF_GENERIC(NSNumber *)*)unlinkUserInBackground:(PFUser *)user { + [self _assertFacebookInitialized]; + return [user unlinkWithAuthTypeInBackground:PFFacebookUserAuthenticationType]; +} + ++ (void)unlinkUserInBackground:(PFUser *)user block:(nullable PFBooleanResultBlock)block { + [[self unlinkUserInBackground:user] pffb_continueWithMainThreadBooleanBlock:block]; +} + +///-------------------------------------- +#pragma mark - Getting Linked State +///-------------------------------------- + ++ (BOOL)isLinkedWithUser:(PFUser *)user { + return [user isLinkedWithAuthType:PFFacebookUserAuthenticationType]; +} + +@end diff --git a/ParseFacebookUtils/ParseFacebookUtilsV4.h b/ParseFacebookUtils/ParseFacebookUtilsV4.h new file mode 100644 index 0000000..367bb44 --- /dev/null +++ b/ParseFacebookUtils/ParseFacebookUtilsV4.h @@ -0,0 +1,10 @@ +/** + * 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 diff --git a/ParseFacebookUtilsV4.podspec b/ParseFacebookUtilsV4.podspec new file mode 100644 index 0000000..5269b0f --- /dev/null +++ b/ParseFacebookUtilsV4.podspec @@ -0,0 +1,34 @@ +Pod::Spec.new do |s| + s.name = 'ParseFacebookUtilsV4' + 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 => "v4-#{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 'FBSDKCoreKit', '~> 4.7' + s.dependency 'FBSDKLoginKit', '~> 4.7' +end diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..eb6b91c --- /dev/null +++ b/Podfile @@ -0,0 +1,8 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' + +workspace 'ParseFacebookUtils' + +target 'ParseFacebookUtilsV4-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..1fe6247 --- /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, 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 'ParseFacebookUtilsV4' + + 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/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.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 + [coverage-status-link]: https://codecov.io/github/ParsePlatform/ParseFacebookUtils-iOS?branch=master + + [license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg + [license-link]: https://github.com/ParsePlatform/ParseFacebookUtils-iOS/blob/master/LICENSE + + [podspec-svg]: https://img.shields.io/cocoapods/v/ParseFacebookUtilsV4.svg + [podspec-link]: https://cocoapods.org/pods/ParseFacebookUtilsV4 + + [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..4dc4d13 --- /dev/null +++ b/Resources/Info.plist @@ -0,0 +1,29 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ParseFacebookUtilsV4 + 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..7941e89 --- /dev/null +++ b/Tests/Other/TestCase/PFFacebookTestCase.h @@ -0,0 +1,78 @@ +/** + * 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) 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..b029d44 --- /dev/null +++ b/Tests/Unit/FacebookAuthenticationProviderTests.m @@ -0,0 +1,241 @@ +/** + * 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 Bolts.BFTask; + +@import FBSDKCoreKit.FBSDKAccessToken; +@import FBSDKLoginKit.FBSDKLoginManagerLoginResult; + +#import "PFFacebookAuthenticationProvider_Private.h" +#import "PFFacebookTestCase.h" + +@interface FacebookAuthenticationProviderTests : PFFacebookTestCase + +@end + +@implementation FacebookAuthenticationProviderTests + +- (void)testAuthType { + XCTAssertEqualObjects(PFFacebookUserAuthenticationType, @"facebook"); +} + +- (void)testAuthenticateRead { + NSDictionary *expectedAuthData = @{ @"id" : @"fbId", + @"access_token" : @"token", + @"expiration_date" : @"1970-01-01T00:22:17.000Z" }; + + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + OCMStub([mockedLoginManager logInWithReadPermissions:@[ @"read" ] + fromViewController:OCMOCK_ANY + handler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSDKLoginManagerRequestTokenHandler handler = nil; + [invocation getArgument:&handler atIndex:4]; + + FBSDKAccessToken *token = [[FBSDKAccessToken alloc] initWithTokenString:@"token" + permissions:@[ @"read" ] + declinedPermissions:nil + appID:@"appId" + userID:@"fbId" + expirationDate:[NSDate dateWithTimeIntervalSince1970:1337] + refreshDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:token + isCancelled:NO + grantedPermissions:[NSSet setWithObject:@"read"] + declinedPermissions:nil]; + + handler(result, nil); + }); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:@[ @"read" ] + publishPermissions:nil] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testAuthenticatePublish { + NSDictionary *expectedAuthData = @{ @"id" : @"fbId", + @"access_token" : @"token", + @"expiration_date" : @"1970-01-01T00:22:17.000Z" }; + + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + OCMStub([mockedLoginManager logInWithPublishPermissions:@[ @"publish" ] + fromViewController:OCMOCK_ANY + handler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSDKLoginManagerRequestTokenHandler handler = nil; + [invocation getArgument:&handler atIndex:4]; + + FBSDKAccessToken *token = [[FBSDKAccessToken alloc] initWithTokenString:@"token" + permissions:@[ @"publish" ] + declinedPermissions:nil + appID:@"appId" + userID:@"fbId" + expirationDate:[NSDate dateWithTimeIntervalSince1970:1337] + refreshDate:[NSDate dateWithTimeIntervalSince1970:1337]]; + FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:token + isCancelled:NO + grantedPermissions:[NSSet setWithObject:@"publish"] + declinedPermissions:nil]; + + handler(result, nil); + }); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:nil + publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, expectedAuthData); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testAuthenticateBoth { + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:@[ @"read" ] publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.exception.name, NSInvalidArgumentException); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testAuthenticateCancel { + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + OCMStub([mockedLoginManager logInWithPublishPermissions:@[ @"publish" ] + fromViewController:OCMOCK_ANY + handler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSDKLoginManagerRequestTokenHandler handler = nil; + [invocation getArgument:&handler atIndex:4]; + + FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:nil + isCancelled:YES + grantedPermissions:nil + declinedPermissions:[NSSet setWithObject:@"publish"]]; + + handler(result, nil); + }); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:nil publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertTrue(task.cancelled); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testAuthenticateError { + NSError *expectedError = [NSError errorWithDomain:@"FBSDK" code:1337 userInfo:nil]; + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + OCMStub([mockedLoginManager logInWithPublishPermissions:@[ @"publish" ] + fromViewController:OCMOCK_ANY + handler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSDKLoginManagerRequestTokenHandler handler = nil; + [invocation getArgument:&handler atIndex:4]; + + handler(nil, expectedError); + }); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:nil publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.error, expectedError); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testAuthenticateInvalidResults { + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + OCMStub([mockedLoginManager logInWithPublishPermissions:@[ @"publish" ] + fromViewController:OCMOCK_ANY + handler:OCMOCK_ANY]).andDo(^(NSInvocation *invocation) { + __unsafe_unretained FBSDKLoginManagerRequestTokenHandler handler = nil; + [invocation getArgument:&handler atIndex:4]; + + FBSDKAccessToken *token = [[FBSDKAccessToken alloc] initWithTokenString:nil + permissions:@[ @"publish" ] + declinedPermissions:nil + appID:@"appId" + userID:nil + expirationDate:nil + refreshDate:nil]; + FBSDKLoginManagerLoginResult *result = [[FBSDKLoginManagerLoginResult alloc] initWithToken:token + isCancelled:NO + grantedPermissions:[NSSet setWithObject:@"publish"] + declinedPermissions:nil]; + + handler(result, nil); + }); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTestExpectation *expectation = [self currentSelectorTestExpectation]; + [[provider authenticateAsyncWithReadPermissions:nil publishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertNil(task.result); + XCTAssertFalse(task.faulted); + [expectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; +} + +- (void)testReauthenticate { + NSDictionary *authData = @{ @"id" : @"fbId", + @"access_token" : @"token", + @"expiration_date" : @"1970-01-01T00:22:17.000Z" }; + + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTAssertTrue([provider restoreAuthenticationWithAuthData:authData]); +} + +- (void)testRestoreAuthNil { + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + OCMExpect([mockedLoginManager logOut]); + + PFFacebookAuthenticationProvider *provider = [[PFFacebookAuthenticationProvider alloc] initWithApplication:[UIApplication sharedApplication] launchOptions:nil]; + provider.loginManager = mockedLoginManager; + + XCTAssertTrue([provider restoreAuthenticationWithAuthData:nil]); + + OCMVerifyAll(mockedLoginManager); +} + +@end diff --git a/Tests/Unit/FacebookUtilsTests.m b/Tests/Unit/FacebookUtilsTests.m new file mode 100644 index 0000000..e82a8a1 --- /dev/null +++ b/Tests/Unit/FacebookUtilsTests.m @@ -0,0 +1,265 @@ +/** + * 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 Parse.PFConstants; + +#import + +#import "PFFacebookAuthenticationProvider_Private.h" +#import "PFFacebookTestCase.h" +#import "PFFacebookUtils_Private.h" + +///-------------------------------------- +#pragma mark - FacebookUtilsTests +///-------------------------------------- + +@interface FacebookUtilsTests : PFFacebookTestCase + +@end + +@implementation FacebookUtilsTests + +///-------------------------------------- +#pragma mark - XCTestCase +///-------------------------------------- + +- (void)tearDown { + [PFFacebookUtils _setAuthenticationProvider:nil]; + + [super tearDown]; +} + +///-------------------------------------- +#pragma mark - Helpers +///-------------------------------------- + +- (NSDictionary *)sampleAuthData { + return @{ @"id" : @"fbId", + @"auth_token" : @"token", + @"expiration_date" : @"1970-01-01T00:22:17.000Z" }; +} + +///-------------------------------------- +#pragma mark - Tests +///-------------------------------------- + +- (void)testInitialize { + id userMock = PFStrictClassMock([PFUser class]); + OCMExpect(ClassMethod([userMock registerAuthenticationDelegate:[OCMArg checkWithBlock:^BOOL(id obj) { + return (obj != nil); + }] forAuthType:@"facebook"])); + + XCTAssertThrows([PFFacebookUtils unlinkUserInBackground:userMock]); + + [PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]; + XCTAssertNotNil([PFFacebookUtils _authenticationProvider]); + + XCTAssertNoThrow([PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]); + + OCMVerifyAll(userMock); +} + +- (void)testLoginManager { + id mockedLoginManager = PFStrictClassMock([FBSDKLoginManager class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + + OCMStub([mockedAuthProvider loginManager]).andReturn(mockedLoginManager); + + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + XCTAssertEqualObjects(mockedLoginManager, [PFFacebookUtils facebookLoginManager]); +} + +- (void)testLoginReadPermissions { + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + OCMStub([mockedAuthProvider authenticateAsyncWithReadPermissions:@[ @"read" ] publishPermissions:nil]).andReturn([BFTask taskWithResult:@{}]); + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + + id userMock = PFStrictClassMock([PFUser class]); + OCMStub(ClassMethod([userMock logInWithAuthTypeInBackground:@"facebook" authData:[OCMArg isNotNil]])).andReturn([BFTask taskWithResult:userMock]); + + XCTestExpectation *taskExpecatation = [self expectationWithDescription:@"task"]; + [[PFFacebookUtils logInInBackgroundWithReadPermissions:@[ @"read" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqual(task.result, userMock); + [taskExpecatation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpecatation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils logInInBackgroundWithReadPermissions:@[ @"read" ] block:^(PFUser *resultUser, NSError *error) { + XCTAssertEqual(resultUser, userMock); + XCTAssertNil(error); + [blockExpecatation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testLoginWritePermissions { + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + OCMStub([mockedAuthProvider authenticateAsyncWithReadPermissions:nil publishPermissions:@[ @"publish" ]]).andReturn([BFTask taskWithResult:@{}]); + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + + id userMock = PFStrictClassMock([PFUser class]); + OCMStub(ClassMethod([userMock logInWithAuthTypeInBackground:@"facebook" authData:[OCMArg isNotNil]])).andReturn([BFTask taskWithResult:userMock]); + + XCTestExpectation *taskExpecatation = [self expectationWithDescription:@"task"]; + [[PFFacebookUtils logInInBackgroundWithPublishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqual(task.result, userMock); + [taskExpecatation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpecatation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils logInInBackgroundWithPublishPermissions:@[ @"publish" ] block:^(PFUser *resultUser, NSError *error) { + XCTAssertEqual(resultUser, userMock); + XCTAssertNil(error); + [blockExpecatation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testLoginWithAccessToken { + id mockedAccessToken = PFStrictClassMock([FBSDKAccessToken class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + + // NOTE: (richardross) Until we decouple user login with auth data, we can only mock error cases here. + OCMStub([mockedAuthProvider _userAuthenticationDataFromAccessToken:mockedAccessToken]).andReturn(nil); + + XCTestExpectation *taskExpectation = [self expectationWithDescription:@"task"]; + [[PFFacebookUtils logInInBackgroundWithAccessToken:mockedAccessToken] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.error.domain, PFParseErrorDomain); + XCTAssertEqual(task.error.code, kPFErrorFacebookInvalidSession); + [taskExpectation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpectation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils logInInBackgroundWithAccessToken:mockedAccessToken block:^(PFUser *user, NSError *error) { + XCTAssertNil(user); + XCTAssertEqualObjects(error.domain, PFParseErrorDomain); + XCTAssertEqual(error.code, kPFErrorFacebookInvalidSession); + [blockExpectation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testLinkWithReadPermissions { + id mockedUser = PFStrictClassMock([PFUser class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + + OCMStub([mockedAuthProvider authenticateAsyncWithReadPermissions:@[ @"read" ] publishPermissions:nil]).andReturn([BFTask taskWithResult:@{}]); + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + + OCMStub([mockedUser linkWithAuthTypeInBackground:@"facebook" authData:[OCMArg isNotNil]]).andReturn([BFTask taskWithResult:@YES]); + + XCTestExpectation *taskExpecatation = [self expectationWithDescription:@"task"]; + [[PFFacebookUtils linkUserInBackground:mockedUser withReadPermissions:@[ @"read" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, @YES); + [taskExpecatation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpectation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils linkUserInBackground:mockedUser withReadPermissions:@[ @"read" ] block:^(BOOL result, NSError *error) { + XCTAssertTrue(result); + [blockExpectation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testLinkWithWritePermissions { + id mockedUser = PFStrictClassMock([PFUser class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + + OCMStub([mockedAuthProvider authenticateAsyncWithReadPermissions:nil publishPermissions:@[ @"publish" ]]).andReturn([BFTask taskWithResult:@{}]); + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + OCMStub([mockedUser linkWithAuthTypeInBackground:@"facebook" authData:[OCMArg isNotNil]]).andReturn([BFTask taskWithResult:@YES]); + + XCTestExpectation *taskExpecation = [self expectationWithDescription:@"task"]; + [[PFFacebookUtils linkUserInBackground:mockedUser withPublishPermissions:@[ @"publish" ]] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, @YES); + [taskExpecation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpectation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils linkUserInBackground:mockedUser withPublishPermissions:@[ @"publish" ] block:^(BOOL result, NSError *error) { + XCTAssertTrue(result); + [blockExpectation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testLinkWithAccessToken { + id mockedAccessToken = PFStrictClassMock([FBSDKAccessToken class]); + id mockedUser = PFStrictClassMock([PFUser class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + + NSDictionary *sampleAuthData = [self sampleAuthData]; + OCMStub([mockedAuthProvider _userAuthenticationDataFromAccessToken:mockedAccessToken]).andReturn(sampleAuthData); + + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + [OCMStub([mockedUser linkWithAuthTypeInBackground:@"facebook" authData:sampleAuthData]) andReturn:[BFTask taskWithResult:@YES]]; + + XCTestExpectation *taskExpecatation = [self expectationWithDescription:@"block"]; + [[PFFacebookUtils linkUserInBackground:mockedUser withAccessToken:mockedAccessToken] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, @YES); + [taskExpecatation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpectation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils linkUserInBackground:mockedUser withAccessToken:mockedAccessToken block:^(BOOL result, NSError *error) { + XCTAssertTrue(result); + [blockExpectation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testUnlink { + id mockedLinkedUser = PFStrictClassMock([PFUser class]); + id mockedAuthProvider = PFStrictClassMock([PFFacebookAuthenticationProvider class]); + + [PFFacebookUtils _setAuthenticationProvider:mockedAuthProvider]; + [OCMStub([mockedLinkedUser unlinkWithAuthTypeInBackground:@"facebook"]) andReturn:[BFTask taskWithResult:@YES]]; + + XCTestExpectation *taskExpecatation = [self expectationWithDescription:@"block"]; + [[PFFacebookUtils unlinkUserInBackground:mockedLinkedUser] continueWithBlock:^id(BFTask *task) { + XCTAssertEqualObjects(task.result, @YES); + [taskExpecatation fulfill]; + return nil; + }]; + [self waitForTestExpectations]; + + XCTestExpectation *blockExpectation = [self expectationWithDescription:@"block"]; + [PFFacebookUtils unlinkUserInBackground:mockedLinkedUser block:^(BOOL result, NSError *error) { + XCTAssertTrue(result); + [blockExpectation fulfill]; + }]; + [self waitForTestExpectations]; +} + +- (void)testIsLinked { + id mockedLinkedUser = PFStrictClassMock([PFUser class]); + id mockedUnlinkedUser = PFStrictClassMock([PFUser class]); + + OCMStub([mockedLinkedUser isLinkedWithAuthType:@"facebook"]).andReturn(YES); + OCMStub([mockedUnlinkedUser isLinkedWithAuthType:@"facebook"]).andReturn(NO); + + XCTAssertTrue([PFFacebookUtils isLinkedWithUser:mockedLinkedUser]); + XCTAssertFalse([PFFacebookUtils isLinkedWithUser:mockedUnlinkedUser]); +} + +@end diff --git a/Vendor/FBSDKCoreKit.framework/FBSDKCoreKit b/Vendor/FBSDKCoreKit.framework/FBSDKCoreKit new file mode 100644 index 0000000..95e4836 Binary files /dev/null and b/Vendor/FBSDKCoreKit.framework/FBSDKCoreKit differ diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h new file mode 100644 index 0000000..4ed0656 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAccessToken.h @@ -0,0 +1,166 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import +#import +#import + +/*! + @abstract Notification indicating that the `currentAccessToken` has changed. + @discussion the userInfo dictionary of the notification will contain keys + `FBSDKAccessTokenChangeOldKey` and + `FBSDKAccessTokenChangeNewKey`. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification; + +/*! + @abstract A key in the notification's userInfo that will be set + if and only if the user ID changed between the old and new tokens. + @discussion Token refreshes can occur automatically with the SDK + which do not change the user. If you're only interested in user + changes (such as logging out), you should check for the existence + of this key. The value is a NSNumber with a boolValue. + + On a fresh start of the app where the SDK reads in the cached value + of an access token, this key will also exist since the access token + is moving from a null state (no user) to a non-null state (user). + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID; + +/* + @abstract key in notification's userInfo object for getting the old token. + @discussion If there was no old token, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey; + +/* + @abstract key in notification's userInfo object for getting the new token. + @discussion If there is no new token, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey; + + +/*! + @class FBSDKAccessToken + @abstract Represents an immutable access token for using Facebook services. + */ +@interface FBSDKAccessToken : NSObject + +/*! + @abstract Returns the app ID. + */ +@property (readonly, copy, nonatomic) NSString *appID; + +/*! + @abstract Returns the known declined permissions. + */ +@property (readonly, copy, nonatomic) NSSet *declinedPermissions; + +/*! + @abstract Returns the expiration date. + */ +@property (readonly, copy, nonatomic) NSDate *expirationDate; + +/*! + @abstract Returns the known granted permissions. + */ +@property (readonly, copy, nonatomic) NSSet *permissions; + +/*! + @abstract Returns the date the token was last refreshed. +*/ +@property (readonly, copy, nonatomic) NSDate *refreshDate; + +/*! + @abstract Returns the opaque token string. + */ +@property (readonly, copy, nonatomic) NSString *tokenString; + +/*! + @abstract Returns the user ID. + */ +@property (readonly, copy, nonatomic) NSString *userID; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/*! + @abstract Initializes a new instance. + @param tokenString the opaque token string. + @param permissions the granted permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param declinedPermissions the declined permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param appID the app ID. + @param userID the user ID. + @param expirationDate the optional expiration date (defaults to distantFuture). + @param refreshDate the optional date the token was last refreshed (defaults to today). + @discussion This initializer should only be used for advanced apps that + manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager` + along with `+currentAccessToken`. + */ +- (instancetype)initWithTokenString:(NSString *)tokenString + permissions:(NSArray *)permissions + declinedPermissions:(NSArray *)declinedPermissions + appID:(NSString *)appID + userID:(NSString *)userID + expirationDate:(NSDate *)expirationDate + refreshDate:(NSDate *)refreshDate +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract Convenience getter to determine if a permission has been granted + @param permission The permission to check. + */ +- (BOOL)hasGranted:(NSString *)permission; + +/*! + @abstract Compares the receiver to another FBSDKAccessToken + @param token The other token + @return YES if the receiver's values are equal to the other token's values; otherwise NO + */ +- (BOOL)isEqualToAccessToken:(FBSDKAccessToken *)token; + +/*! + @abstract Returns the "global" access token that represents the currently logged in user. + @discussion The `currentAccessToken` is a convenient representation of the token of the + current user and is used by other SDK components (like `FBSDKLoginManager`). + */ ++ (FBSDKAccessToken *)currentAccessToken; + +/*! + @abstract Sets the "global" access token that represents the currently logged in user. + @param token The access token to set. + @discussion This will broadcast a notification and save the token to the app keychain. + */ ++ (void)setCurrentAccessToken:(FBSDKAccessToken *)token; + +/*! + @abstract Refresh the current access token's permission state and extend the token's expiration date, + if possible. + @param completionHandler an optional callback handler that can surface any errors related to permission refreshing. + @discussion On a successful refresh, the currentAccessToken will be updated so you typically only need to + observe the `FBSDKAccessTokenDidChangeNotification` notification. + + If a token is already expired, it cannot be refreshed. + */ ++ (void)refreshCurrentAccessToken:(FBSDKGraphRequestHandler)completionHandler; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h new file mode 100644 index 0000000..375d413 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppEvents.h @@ -0,0 +1,462 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import "FBSDKMacros.h" + +@class FBSDKAccessToken; +@class FBSDKGraphRequest; + +/*! @abstract NSNotificationCenter name indicating a result of a failed log flush attempt. The posted object will be an NSError instance. */ +FBSDK_EXTERN NSString *const FBSDKAppEventsLoggingResultNotification; + +/*! @abstract optional plist key ("FacebookLoggingOverrideAppID") for setting `loggingOverrideAppID` */ +FBSDK_EXTERN NSString *const FBSDKAppEventsOverrideAppIDBundleKey; + +/*! + + @typedef NS_ENUM (NSUInteger, FBSDKAppEventsFlushBehavior) + + @abstract Specifies when `FBSDKAppEvents` sends log events to the server. + + */ +typedef NS_ENUM(NSUInteger, FBSDKAppEventsFlushBehavior) +{ + + /*! Flush automatically: periodically (once a minute or every 100 logged events) and always at app reactivation. */ + FBSDKAppEventsFlushBehaviorAuto = 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`. */ + FBSDKAppEventsFlushBehaviorExplicitOnly, + +}; + +/*! + @methodgroup Predefined event names for logging events common to many apps. Logging occurs through the `logEvent` family of methods on `FBSDKAppEvents`. + Common event parameters are provided in the `FBSDKAppEventsParameterNames*` constants. + */ + +/*! Log this event when the user has achieved a level in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAchievedLevel; + +/*! Log this event when the user has entered their payment info. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameAddedPaymentInfo; + +/*! 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 FBSDKAppEventNameAddedToCart; + +/*! 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 FBSDKAppEventNameAddedToWishlist; + +/*! Log this event when a user has completed registration with the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedRegistration; + +/*! Log this event when the user has completed a tutorial in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameCompletedTutorial; + +/*! 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 FBSDKAppEventNameInitiatedCheckout; + +/*! 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 FBSDKAppEventNameRated; + +/*! Log this event when a user has performed a search within the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameSearched; + +/*! 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 FBSDKAppEventNameSpentCredits; + +/*! Log this event when the user has unlocked an achievement in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameUnlockedAchievement; + +/*! Log this event when a user has viewed a form of content in the app. */ +FBSDK_EXTERN NSString *const FBSDKAppEventNameViewedContent; + +/*! + @methodgroup Predefined event name parameters for common additional information to accompany events logged through the `logEvent` family + of methods on `FBSDKAppEvents`. Common event names are provided in the `FBAppEventName*` constants. + */ + +/*! 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 FBSDKAppEventParameterNameContentID; + +/*! 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 FBSDKAppEventParameterNameContentType; + +/*! 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 FBSDKAppEventParameterNameCurrency; + +/*! 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 FBSDKAppEventParameterNameDescription; + +/*! Parameter key used to specify the level achieved in a `FBAppEventNameAchieved` event. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameLevel; + +/*! Parameter key used to specify the maximum rating available for the `FBAppEventNameRate` event. E.g., "5" or "10". */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameMaxRatingValue; + +/*! Parameter key used to specify how many items are being processed for an `FBAppEventNameInitiatedCheckout` or `FBAppEventNamePurchased` event. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameNumItems; + +/*! Parameter key used to specify whether payment info is available for the `FBAppEventNameInitiatedCheckout` event. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNamePaymentInfoAvailable; + +/*! Parameter key used to specify method user has used to register for the app, e.g., "Facebook", "email", "Twitter", etc */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameRegistrationMethod; + +/*! Parameter key used to specify the string provided by the user for a search operation. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSearchString; + +/*! Parameter key used to specify whether the activity being logged about was successful or not. `FBSDKAppEventParameterValueYes` and `FBSDKAppEventParameterValueNo` are good canonical values to use for this parameter. */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterNameSuccess; + +/* + @methodgroup Predefined values to assign to event parameters that accompany events logged through the `logEvent` family + of methods on `FBSDKAppEvents`. Common event parameters are provided in the `FBSDKAppEventParameterName*` constants. + */ + +/*! Yes-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueYes; + +/*! No-valued parameter value to be used with parameter keys that need a Yes/No value */ +FBSDK_EXTERN NSString *const FBSDKAppEventParameterValueNo; + + +/*! + + @class FBSDKAppEvents + + @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 `FBSDKAppEvents` 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 `FBSDKAppEvents`: + + + 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 `FBSDKAppEvents` class is thread-safe in that events may be logged from any of the app's threads. + + + The developer can set the `flushBehavior` on `FBSDKAppEvents` 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 `FBSDKLoggingBehaviorAppEvents` 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 1000. + + 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 FBSDKAppEvents : NSObject + +/* + * Basic event logging + */ + +/*! + + @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 `FBSDKAppEvents` documentation. + + */ ++ (void)logEvent:(NSString *)eventName; + +/*! + + @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 `FBSDKAppEvents` 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; + + +/*! + + @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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + */ ++ (void)logEvent:(NSString *)eventName + parameters:(NSDictionary *)parameters; + +/*! + + @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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(double)valueToSum + parameters:(NSDictionary *)parameters; + + +/*! + + @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 `FBSDKAppEvents` 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 `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @param accessToken The optional access token to log the event as. + */ ++ (void)logEvent:(NSString *)eventName + valueToSum:(NSNumber *)valueToSum + parameters:(NSDictionary *)parameters + accessToken:(FBSDKAccessToken *)accessToken; + +/* + * Purchase logging + */ + +/*! + + @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 `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency; + +/*! + + @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 `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters; + +/*! + + @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 `FBSDKAppEvents` documentation. Commonly used parameter names + are provided in `FBSDKAppEventParameterName*` constants. + + @param accessToken The optional access token to log the event as. + + @discussion This event immediately triggers a flush of the `FBSDKAppEvents` event queue, unless the `flushBehavior` is set + to `FBSDKAppEventsFlushBehaviorExplicitOnly`. + + */ ++ (void)logPurchase:(double)purchaseAmount + currency:(NSString *)currency + parameters:(NSDictionary *)parameters + accessToken:(FBSDKAccessToken *)accessToken; + +/*! + + @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 + */ + +/*! + + @abstract + Get the current event flushing behavior specifying when events are sent back to Facebook servers. + */ ++ (FBSDKAppEventsFlushBehavior)flushBehavior; + +/*! + + @abstract + Set the current event flushing behavior specifying when events are sent back to Facebook servers. + + @param flushBehavior The desired `FBSDKAppEventsFlushBehavior` to be used. + */ ++ (void)setFlushBehavior:(FBSDKAppEventsFlushBehavior)flushBehavior; + +/*! + @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 `FBSDKAppEventsOverrideAppIDBundleKey` + plist value. If that's not set, it defaults to `[FBSDKSettings appID]`. + + This should be set before any other calls are made to `FBSDKAppEvents`. 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; + +/*! + @abstract + Get the 'override' App ID for App Event logging. + + @see setLoggingOverrideAppID: + + */ ++ (NSString *)loggingOverrideAppID; + + +/*! + @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 `FBSDKAppEventsLoggingResultNotification`. + */ ++ (void)flush; + +/*! + @abstract + Creates 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 accessToken The access token to use to establish the user's identity for users logged into Facebook through this app. + If `nil`, then the `[FBSDKAccessToken currentAccessToken]` is used. + + @discussion + 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 access token is valid, + the ID will represent the user associated with that token; 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 `[FBSDKSettings limitEventAndDataUsage]` flag, or a specific Facebook user cannot be identified. + */ ++ (FBSDKGraphRequest *)requestForCustomAudienceThirdPartyIDWithAccessToken:(FBSDKAccessToken *)accessToken; +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h new file mode 100644 index 0000000..8e65e5b --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h @@ -0,0 +1,82 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@class BFTask; + +// Check if Bolts.framework is available for import +#if __has_include() +// Import it if it's available +# import +#else +// Otherwise - redeclare BFAppLinkResolving protocol to resolve the problem of missing symbols +// Please note: Bolts.framework is still required for AppLink resolving to work, +// but this allows FBSDKCoreKit to weakly link Bolts.framework as well as this enables clang modulemaps to work. + +/*! + Implement this protocol to provide an alternate strategy for resolving + App Links that may include pre-fetching, caching, or querying for App Link + data from an index provided by a service provider. + */ +@protocol BFAppLinkResolving + +/*! + Asynchronously resolves App Link data for a given URL. + + @param url The URL to resolve into an App Link. + @returns A BFTask that will return a BFAppLink for the given URL. + */ +- (BFTask *)appLinkFromURLInBackground:(NSURL *)url; + +@end + +#endif + +/*! + @class FBSDKAppLinkResolver + + @abstract + Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook App Link + Index API 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. See `[FBSDKSettings setClientToken:]` and linking + Bolts.framework + */ +@interface FBSDKAppLinkResolver : 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 `[FBSDKSettings setClientToken:]` + */ +- (BFTask *)appLinksFromURLsInBackground:(NSArray *)urls; + +/*! + @abstract Allocates and initializes a new instance of FBSDKAppLinkResolver. + */ ++ (instancetype)resolver; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h new file mode 100644 index 0000000..216b71d --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKAppLinkUtility.h @@ -0,0 +1,55 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @abstract Describes the callback for fetchDeferredAppLink. + @param url the url representing the deferred App Link + @param error the error during the request, if any + + @discussion The url may also have a fb_click_time_utc query parameter that + represents when the click occurred that caused the deferred App Link to be created. + */ +typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); + +/*! + @abstract Class containing App Links related utility methods. + */ +@interface FBSDKAppLinkUtility : NSObject + +/*! + @abstract + Call this method from the main thread to fetch deferred applink data if you use Mobile App + Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). + This may require a network round trip. If successful, the handler is invoked with the link + data (this will only return a valid URL once, and future calls will result in a nil URL + value in the callback). + + @param handler the handler to be invoked if there is deferred App Link data + + @discussion The handler 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:). + */ ++ (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h new file mode 100644 index 0000000..857acd0 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKApplicationDelegate.h @@ -0,0 +1,74 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @class FBSDKApplicationDelegate + + @abstract + The FBSDKApplicationDelegate is designed to post process the results from Facebook Login + or Facebook Dialogs (or any action that requires switching over to the native Facebook + app or Safari). + + @discussion + The methods in this class are designed to mirror those in UIApplicationDelegate, and you + should call them in the respective methods in your AppDelegate implementation. + */ +@interface FBSDKApplicationDelegate : NSObject + +/*! + @abstract Gets the singleton instance. + */ ++ (instancetype)sharedInstance; + +/*! + @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 Safari as part of SSO authorization flow or Facebook dialogs. + + @param application The application as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @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 annotation The annotation as passed to [UIApplicationDelegate application:openURL:sourceApplication:annotation:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + sourceApplication:(NSString *)sourceApplication + annotation:(id)annotation; + +/*! + @abstract + Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method + of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK. + + @param application The application as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + + @param launchOptions The launchOptions as passed to [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + + @return YES if the url was intended for the Facebook SDK, NO if not. + */ +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKButton.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKButton.h new file mode 100644 index 0000000..8132998 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKButton.h @@ -0,0 +1,26 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @abstract A base class for common SDK buttons. + */ +@interface FBSDKButton : UIButton + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKConstants.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKConstants.h new file mode 100644 index 0000000..5f53161 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKConstants.h @@ -0,0 +1,210 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +/*! + @abstract The error domain for all errors from FBSDKCoreKit. + @discussion Error codes from the SDK in the range 0-99 are reserved for this domain. + */ +FBSDK_EXTERN NSString *const FBSDKErrorDomain; + +/*! + @typedef NS_ENUM(NSInteger, FBSDKErrorCode) + @abstract Error codes for FBSDKErrorDomain. + */ +typedef NS_ENUM(NSInteger, FBSDKErrorCode) +{ + /*! + @abstract Reserved. + */ + FBSDKReservedErrorCode = 0, + + /*! + @abstract The error code for errors from invalid encryption on incoming encryption URLs. + */ + FBSDKEncryptionErrorCode, + + /*! + @abstract The error code for errors from invalid arguments to SDK methods. + */ + FBSDKInvalidArgumentErrorCode, + + /*! + @abstract The error code for unknown errors. + */ + FBSDKUnknownErrorCode, + + /*! + @abstract A request failed due to a network error. Use NSUnderlyingErrorKey to retrieve + the error object from the NSURLConnection for more information. + */ + FBSDKNetworkErrorCode, + + /*! + @abstract The error code for errors encounted during an App Events flush. + */ + FBSDKAppEventsFlushErrorCode, + + /*! + @abstract An endpoint that returns a binary response was used with FBSDKGraphRequestConnection. + @discussion Endpoints that return image/jpg, etc. should be accessed using NSURLRequest + */ + FBSDKGraphRequestNonTextMimeTypeReturnedErrorCode, + + /*! + @abstract The operation failed because the server returned an unexpected response. + @discussion You can get this error if you are not using the most recent SDK, or you are accessing a version of the + Graph API incompatible with the current SDK. + */ + FBSDKGraphRequestProtocolMismatchErrorCode, + + /*! + @abstract The Graph API returned an error. + @discussion See below for useful userInfo keys (beginning with FBSDKGraphRequestError*) + */ + FBSDKGraphRequestGraphAPIErrorCode, + + /*! + @abstract The specified dialog configuration is not available. + @discussion This error may signify that the configuration for the dialogs has not yet been downloaded from the server + or that the dialog is unavailable. Subsequent attempts to use the dialog may succeed as the configuration is loaded. + */ + FBSDKDialogUnavailableErrorCode, + + /*! + @abstract Indicates an operation failed because a required access token was not found. + */ + FBSDKAccessTokenRequiredErrorCode, + + /*! + @abstract Indicates an app switch (typically for a dialog) failed because the destination app is out of date. + */ + FBSDKAppVersionUnsupportedErrorCode, + + /*! + @abstract Indicates an app switch to the browser (typically for a dialog) failed. + */ + FBSDKBrowswerUnavailableErrorCode, +}; + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) + @abstract Describes the category of Facebook error. See `FBSDKGraphRequestErrorCategoryKey`. + */ +typedef NS_ENUM(NSUInteger, FBSDKGraphRequestErrorCategory) +{ + /*! The default error category that is not known to be recoverable. Check `FBSDKLocalizedErrorDescriptionKey` for a user facing message. */ + FBSDKGraphRequestErrorCategoryOther = 0, + /*! Indicates the error is temporary (such as server throttling). While a recoveryAttempter will be provided with the error instance, the attempt is guaranteed to succeed so you can simply retry the operation if you do not want to present an alert. */ + FBSDKGraphRequestErrorCategoryTransient = 1, + /*! Indicates the error can be recovered (such as requiring a login). A recoveryAttempter will be provided with the error instance that can take UI action. */ + FBSDKGraphRequestErrorCategoryRecoverable = 2 +}; + +/* + @methodgroup error userInfo keys + */ + +/*! + @abstract The userInfo key for the invalid collection for errors with FBSDKInvalidArgumentErrorCode. + @discussion If the invalid argument is a collection, the collection can be found with this key and the individual + invalid item can be found with FBSDKErrorArgumentValueKey. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentCollectionKey; + +/*! + @abstract The userInfo key for the invalid argument name for errors with FBSDKInvalidArgumentErrorCode. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentNameKey; + +/*! + @abstract The userInfo key for the invalid argument value for errors with FBSDKInvalidArgumentErrorCode. + */ +FBSDK_EXTERN NSString *const FBSDKErrorArgumentValueKey; + +/*! + @abstract The userInfo key for the message for developers in NSErrors that originate from the SDK. + @discussion The developer message will not be localized and is not intended to be presented within the app. + */ +FBSDK_EXTERN NSString *const FBSDKErrorDeveloperMessageKey; + +/*! + @abstract The userInfo key describing a localized description that can be presented to the user. + */ +FBSDK_EXTERN NSString *const FBSDKErrorLocalizedDescriptionKey; + +/*! + @abstract The userInfo key describing a localized title that can be presented to the user, used with `FBSDKLocalizedErrorDescriptionKey`. + */ +FBSDK_EXTERN NSString *const FBSDKErrorLocalizedTitleKey; + +/* + @methodgroup FBSDKGraphRequest error userInfo keys + */ + +/*! + @abstract The userInfo key describing the error category, for error recovery purposes. + @discussion See `FBSDKGraphErrorRecoveryProcessor` and `[FBSDKGraphRequest disableErrorRecovery]`. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorCategoryKey; + +/* + @abstract The userInfo key for the Graph API error code. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorCode; + +/* + @abstract The userInfo key for the Graph API error subcode. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorGraphErrorSubcode; + +/* + @abstract The userInfo key for the HTTP status code. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorHTTPStatusCodeKey; + +/* + @abstract The userInfo key for the raw JSON response. + */ +FBSDK_EXTERN NSString *const FBSDKGraphRequestErrorParsedJSONResponseKey; + +/*! + @abstract a formal protocol very similar to the informal protocol NSErrorRecoveryAttempting + */ +@protocol FBSDKErrorRecoveryAttempting + +/*! + @abstract attempt the recovery + @param error the error + @param recoveryOptionIndex the selected option index + @param delegate the delegate + @param didRecoverSelector the callback selector, see discussion. + @param contextInfo context info to pass back to callback selector, see discussion. + @discussion + Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: + + - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; + + The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. + */ +- (void)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex delegate:(id)delegate didRecoverSelector:(SEL)didRecoverSelector contextInfo:(void *)contextInfo; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCopying.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCopying.h new file mode 100644 index 0000000..f4ad767 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCopying.h @@ -0,0 +1,33 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @abstract Extension protocol for NSCopying that adds the copy method, which is implemented on NSObject. + @discussion NSObject implicitly conforms to this protocol. + */ +@protocol FBSDKCopying + +/*! + @abstract Implemented by NSObject as a convenience to copyWithZone:. + @return A copy of the receiver. + */ +- (id)copy; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h new file mode 100644 index 0000000..3b78900 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h @@ -0,0 +1,38 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#define FBSDK_VERSION_STRING @"4.7.0" +#define FBSDK_TARGET_PLATFORM_VERSION @"v2.5" diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h new file mode 100644 index 0000000..d2b0313 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h @@ -0,0 +1,97 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import "FBSDKConstants.h" + +@class FBSDKGraphErrorRecoveryProcessor; +@class FBSDKGraphRequest; + +/*! + @abstract Defines a delegate for `FBSDKGraphErrorRecoveryProcessor`. + */ +@protocol FBSDKGraphErrorRecoveryProcessorDelegate + +/*! + @abstract Indicates the error recovery has been attempted. + @param processor the processor instance. + @param didRecover YES if the recovery was successful. + @param error the error that that was attempted to be recovered from. + */ +- (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor didRecover:(BOOL)didRecover error:(NSError *)error; + +@optional +/*! + @abstract Indicates the processor is about to process the error. + @param processor the processor instance. + @param error the error is about to be processed. + @discussion return NO if the processor should not process the error. For example, + if you want to prevent alerts of localized messages but otherwise perform retries and recoveries, + you could return NO for errors where userInfo[FBSDKGraphRequestErrorCategoryKey] equal to FBSDKGraphRequestErrorCategoryOther + */ +- (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor error:(NSError *)error; + +@end + +/*! + @abstract Defines a type that can process Facebook NSErrors with best practices. + @discussion Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or + localized messages to present to the user. This class will process the instances as follows: + + 1. If the error is temporary as indicated by FBSDKGraphRequestErrorCategoryKey, assume the recovery succeeded and + notify the delegate. + 2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread) + with the recovery options and call the instance's [ attemptRecoveryFromError:optionIndex:...]. + 3. If a FBSDKErrorRecoveryAttempting is not available, check the userInfo for FBSDKLocalizedErrorDescriptionKey + and present that in an alert (dispatched to main thread). + + By default, FBSDKGraphRequests use this type to process errors and retry the request upon a successful + recovery. + + Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such + work is dispatched to the main thread (therefore your request handlers may then run on the main thread). + + Login recovery requires FBSDKLoginKit. Login will use FBSDKLoginBehaviorNative and will prompt the user + for all permissions last granted. If any are declined on the new request, the recovery is not successful but + the `[FBSDKAccessToken currentAccessToken]` might still have been updated. + . + */ +@interface FBSDKGraphErrorRecoveryProcessor : NSObject + +/*! + @abstract Gets the delegate. Note this is a strong reference, and is nil'ed out after recovery is complete. + */ +@property (nonatomic, strong, readonly) iddelegate; + +/*! + @abstract Attempts to process the error, return YES if the error can be processed. + @param error the error to process. + @param request the relateed request that may be reissued. + @param delegate the delegate that will be retained until recovery is complete. + */ +- (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request delegate:(id) delegate; + +/*! + @abstract The callback for FBSDKErrorRecoveryAttempting + @param didRecover if the recovery succeeded + @param contextInfo unused + */ +- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h new file mode 100644 index 0000000..5ae03e2 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequest.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +@class FBSDKAccessToken; + +/*! + @abstract Represents a request to the Facebook Graph API. + + @discussion `FBSDKGraphRequest` encapsulates the components of a request (the + Graph API path, the parameters, error recovery behavior) and should be + used in conjunction with `FBSDKGraphRequestConnection` to issue the request. + + Nearly all Graph APIs require an access token. Unless specified, the + `[FBSDKAccessToken currentAccessToken]` is used. Therefore, most requests + will require login first (see `FBSDKLoginManager` in FBSDKLoginKit.framework). + + A `- start` method is provided for convenience for single requests. + + By default, FBSDKGraphRequest will attempt to recover any errors returned from + Facebook. You can disable this via `disableErrorRecovery:`. + @see FBSDKGraphErrorRecoveryProcessor + */ +@interface FBSDKGraphRequest : NSObject + +/*! + @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters; + +/*! + @abstract Initializes a new instance that use use `[FBSDKAccessToken currentAccessToken]`. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + @param HTTPMethod the optional HTTP method. nil defaults to @"GET". + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + HTTPMethod:(NSString *)HTTPMethod; + +/*! + @abstract Initializes a new instance. + @param graphPath the graph path (e.g., @"me"). + @param parameters the optional parameters dictionary. + @param tokenString the token string to use. Specifying nil will cause no token to be used. + @param version the optional Graph API version (e.g., @"v2.0"). nil defaults to FBSDK_TARGET_PLATFORM_VERSION. + @param HTTPMethod the optional HTTP method (e.g., @"POST"). nil defaults to @"GET". + */ +- (instancetype)initWithGraphPath:(NSString *)graphPath + parameters:(NSDictionary *)parameters + tokenString:(NSString *)tokenString + version:(NSString *)version + HTTPMethod:(NSString *)HTTPMethod +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract The request parameters. + */ +@property (nonatomic, strong, readonly) NSMutableDictionary *parameters; + +/*! + @abstract The access token string used by the request. + */ +@property (nonatomic, copy, readonly) NSString *tokenString; + +/*! + @abstract The Graph API endpoint to use for the request, for example "me". + */ +@property (nonatomic, copy, readonly) NSString *graphPath; + +/*! + @abstract The HTTPMethod to use for the request, for example "GET" or "POST". + */ +@property (nonatomic, copy, readonly) NSString *HTTPMethod; + +/*! + @abstract The Graph API version to use (e.g., "v2.0") + */ +@property (nonatomic, copy, readonly) NSString *version; + +/*! + @abstract If set, disables the automatic error recovery mechanism. + @param disable whether to disable the automatic error recovery mechanism + @discussion By default, non-batched FBSDKGraphRequest instances will automatically try to recover + from errors by constructing a `FBSDKGraphErrorRecoveryProcessor` instance that + re-issues the request on successful recoveries. The re-issued request will call the same + handler as the receiver but may occur with a different `FBSDKGraphRequestConnection` instance. + + This will override [FBSDKSettings setGraphErrorRecoveryDisabled:]. + */ +- (void)setGraphErrorRecoveryDisabled:(BOOL)disable; + +/*! + @abstract Starts a connection to the Graph API. + @param handler The handler block to call when the request completes. + */ +- (FBSDKGraphRequestConnection *)startWithCompletionHandler:(FBSDKGraphRequestHandler)handler; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h new file mode 100644 index 0000000..79ffb3f --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestConnection.h @@ -0,0 +1,325 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +@class FBSDKGraphRequest; +@class FBSDKGraphRequestConnection; + +/*! + @typedef FBSDKGraphRequestHandler + + @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 `FBSDKGraphRequestConnection` 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 (^FBSDKGraphRequestHandler)(FBSDKGraphRequestConnection *connection, + id result, + NSError *error); + +/*! + @protocol + + @abstract + The `FBSDKGraphRequestConnectionDelegate` protocol defines the methods used to receive network + activity progress information from a . + */ +@protocol FBSDKGraphRequestConnectionDelegate + +@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 + */ +- (void)requestConnectionWillBeginLoading:(FBSDKGraphRequestConnection *)connection; + +/*! + @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 FBSDKGraphRequestHandler + 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 + */ +- (void)requestConnectionDidFinishLoading:(FBSDKGraphRequestConnection *)connection; + +/*! + @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 + FBSDKGraphRequestHandler block may contain additional information. + + @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:(FBSDKGraphRequestConnection *)connection + didFailWithError:(NSError *)error; + +/*! + @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:(FBSDKGraphRequestConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; + +@end + +/*! + @class FBSDKGraphRequestConnection + + @abstract + The `FBSDKGraphRequestConnection` represents a single connection to Facebook to service a request. + + @discussion + The request settings are encapsulated in a reusable object. The + `FBSDKGraphRequestConnection` object encapsulates the concerns of a single communication + e.g. starting a connection, canceling a connection, or batching requests. + + */ +@interface FBSDKGraphRequestConnection : NSObject + +/*! + @abstract + The delegate object that receives updates. + */ +@property (nonatomic, assign) id delegate; + +/*! + @abstract Gets or sets the timeout interval to wait for a response before giving up. + */ +@property (nonatomic) NSTimeInterval timeout; + +/*! + @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 FBSDKGraphRequestHandler callback. + */ +@property (nonatomic, retain, readonly) NSHTTPURLResponse *URLResponse; + +/*! + @methodgroup Class methods + */ + +/*! + @method + + @abstract + This method sets the default timeout on all FBSDKGraphRequestConnection instances. Defaults to 60 seconds. + + @param defaultConnectionTimeout The timeout interval. + */ ++ (void)setDefaultConnectionTimeout:(NSTimeInterval)defaultConnectionTimeout; + +/*! + @methodgroup Adding requests + */ + +/*! + @method + + @abstract + This method adds an object to this 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. + + @discussion + The completion handler is retained until the block is called upon the + completion or cancellation of the connection. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler; + +/*! + @method + + @abstract + This method adds an object to this 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. + + @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 + `FBSDKGraphRequestConnection` as described in + [Graph API Batch Requests]( https://developers.facebook.com/docs/reference/api/batch/ ). + + @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. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler + batchEntryName:(NSString *)name; + +/*! + @method + + @abstract + This method adds an object to this 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. + + @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". + + @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. + */ +- (void)addRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters; + +/*! + @methodgroup Instance methods + */ + +/*! + @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 + This method starts a connection with the server and is capable of handling all of the + requests that were added to the connection. + + @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. + See `setDelegateQueue:` for other options. + + This method cannot be called twice for an `FBSDKGraphRequestConnection` instance. + */ +- (void)start; + +/*! + @abstract Determines the operation queue that is used to call methods on the connection's delegate. + @param queue The operation queue to use when calling delegate methods. + @discussion By default, a connection is scheduled on the current thread in the default mode when it is created. + You cannot reschedule a connection after it has started. + + This is very similar to `[NSURLConnection setDelegateQueue:]`. + */ +- (void)setDelegateQueue:(NSOperationQueue *)queue; + +/*! + @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; + +@end + +/*! + @abstract The key in the result dictionary for requests to old versions of the Graph API + whose response is not a JSON object. + + @discussion When a request returns a non-JSON response (such as a "true" literal), that response + will be wrapped into a dictionary using this const as the key. This only applies for very few Graph API + prior to v2.1. + */ +FBSDK_EXTERN NSString *const FBSDKNonJSONResponseProperty; diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h new file mode 100644 index 0000000..c179e29 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKGraphRequestDataAttachment.h @@ -0,0 +1,52 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @abstract A container class for data attachments so that additional metadata can be provided about the attachment. + */ +@interface FBSDKGraphRequestDataAttachment : NSObject + +/*! + @abstract Initializes the receiver with the attachment data and metadata. + @param data The attachment data (retained, not copied) + @param filename The filename for the attachment + @param contentType The content type for the attachment + */ +- (instancetype)initWithData:(NSData *)data + filename:(NSString *)filename + contentType:(NSString *)contentType +NS_DESIGNATED_INITIALIZER; + +/*! + @abstract The content type for the attachment. + */ +@property (nonatomic, copy, readonly) NSString *contentType; + +/*! + @abstract The attachment data. + */ +@property (nonatomic, strong, readonly) NSData *data; + +/*! + @abstract The filename for the attachment. + */ +@property (nonatomic, copy, readonly) NSString *filename; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMacros.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMacros.h new file mode 100644 index 0000000..fd2e2ff --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMacros.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#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 + +#define FBSDK_NO_DESIGNATED_INITIALIZER() \ +@throw [NSException exceptionWithName:NSInvalidArgumentException \ + reason:[NSString stringWithFormat:@"unrecognized selector sent to instance %p", self] \ + userInfo:nil] + +#define FBSDK_NOT_DESIGNATED_INITIALIZER(DESIGNATED_INITIALIZER) \ +@throw [NSException exceptionWithName:NSInvalidArgumentException \ + reason:[NSString stringWithFormat:@"Please use the designated initializer [%p %@]", \ + self, \ + NSStringFromSelector(@selector(DESIGNATED_INITIALIZER))] \ + userInfo:nil] diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h new file mode 100644 index 0000000..621fac9 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKMutableCopying.h @@ -0,0 +1,35 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +/*! + @abstract Extension protocol for NSMutableCopying that adds the mutableCopy method, which is implemented on NSObject. + @discussion NSObject implicitly conforms to this protocol. + */ +@protocol FBSDKMutableCopying + +/*! + @abstract Implemented by NSObject as a convenience to mutableCopyWithZone:. + @return A mutable copy of the receiver. + */ +- (id)mutableCopy; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfile.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfile.h new file mode 100644 index 0000000..11da3d9 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfile.h @@ -0,0 +1,148 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import "FBSDKMacros.h" +#import "FBSDKProfilePictureView.h" + +/*! + @abstract Notification indicating that the `currentProfile` has changed. + @discussion the userInfo dictionary of the notification will contain keys + `FBSDKProfileChangeOldKey` and + `FBSDKProfileChangeNewKey`. + */ +FBSDK_EXTERN NSString *const FBSDKProfileDidChangeNotification; + +/* @abstract key in notification's userInfo object for getting the old profile. + @discussion If there was no old profile, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKProfileChangeOldKey; + +/* @abstract key in notification's userInfo object for getting the new profile. + @discussion If there is no new profile, the key will not be present. + */ +FBSDK_EXTERN NSString *const FBSDKProfileChangeNewKey; + +/*! + @abstract Represents an immutable Facebook profile + @discussion This class provides a global "currentProfile" instance to more easily + add social context to your application. When the profile changes, a notification is + posted so that you can update relevant parts of your UI and is persisted to NSUserDefaults. + + Typically, you will want to call `enableUpdatesOnAccessTokenChange:YES` so that + it automatically observes changes to the `[FBSDKAccessToken currentAccessToken]`. + + You can use this class to build your own `FBSDKProfilePictureView` or in place of typical requests to "/me". + */ +@interface FBSDKProfile : NSObject + +/*! + @abstract initializes a new instance. + @param userID the user ID + @param firstName the user's first name + @param middleName the user's middle name + @param lastName the user's last name + @param name the user's complete name + @param linkURL the link for this profile + @param refreshDate the optional date this profile was fetched. Defaults to [NSDate date]. + */ +- (instancetype)initWithUserID:(NSString *)userID + firstName:(NSString *)firstName + middleName:(NSString *)middleName + lastName:(NSString *)lastName + name:(NSString *)name + linkURL:(NSURL *)linkURL + refreshDate:(NSDate *)refreshDate NS_DESIGNATED_INITIALIZER; +/*! + @abstract The user id + */ +@property (nonatomic, readonly) NSString *userID; +/*! + @abstract The user's first name + */ +@property (nonatomic, readonly) NSString *firstName; +/*! + @abstract The user's middle name + */ +@property (nonatomic, readonly) NSString *middleName; +/*! + @abstract The user's last name + */ +@property (nonatomic, readonly) NSString *lastName; +/*! + @abstract The user's complete name + */ +@property (nonatomic, readonly) NSString *name; +/*! + @abstract A URL to the user's profile. + @discussion Consider using Bolts and `FBSDKAppLinkResolver` to resolve this + to an app link to link directly to the user's profile in the Facebook app. + */ +@property (nonatomic, readonly) NSURL *linkURL; + +/*! + @abstract The last time the profile data was fetched. + */ +@property (nonatomic, readonly) NSDate *refreshDate; + +/*! + @abstract Gets the current FBSDKProfile instance. + */ ++ (FBSDKProfile *)currentProfile; + +/*! + @abstract Sets the current instance and posts the appropriate notification if the profile parameter is different + than the receiver. + @param profile the profile to set + @discussion This persists the profile to NSUserDefaults. + */ ++ (void)setCurrentProfile:(FBSDKProfile *)profile; + +/*! + @abstract Indicates if `currentProfile` will automatically observe `FBSDKAccessTokenDidChangeNotification` notifications + @param enable YES is observing + @discussion If observing, this class will issue a graph request for public profile data when the current token's userID + differs from the current profile. You can observe `FBSDKProfileDidChangeNotification` for when the profile is updated. + + Note that if `[FBSDKAccessToken currentAccessToken]` is unset, the `currentProfile` instance remains. It's also possible + for `currentProfile` to return nil until the data is fetched. + */ ++ (void)enableUpdatesOnAccessTokenChange:(BOOL)enable; + +/*! + @abstract A convenience method for returning a complete `NSURL` for retrieving the user's profile image. + @param mode The picture mode + @param size The height and width. This will be rounded to integer precision. + */ +- (NSURL *)imageURLForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size; + +/*! + @abstract A convenience method for returning a Graph API path for retrieving the user's profile image. + @deprecated use `imageURLForPictureMode:size:` instead + @discussion You can pass this to a `FBSDKGraphRequest` instance to download the image. + @param mode The picture mode + @param size The height and width. This will be rounded to integer precision. + */ +- (NSString *)imagePathForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size +__attribute__ ((deprecated("use imageURLForPictureMode:size: instead"))); + +/*! + @abstract Returns YES if the profile is equivalent to the receiver. + @param profile the profile to compare to. + */ +- (BOOL)isEqualToProfile:(FBSDKProfile *)profile; +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h new file mode 100644 index 0000000..f1f64cb --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKProfilePictureView.h @@ -0,0 +1,59 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @typedef FBSDKProfilePictureMode enum + @abstract Defines the aspect ratio mode for the source image of the profile picture. + */ +typedef NS_ENUM(NSUInteger, FBSDKProfilePictureMode) +{ + /*! + @abstract A square cropped version of the image will be included in the view. + */ + FBSDKProfilePictureModeSquare, + /*! + @abstract The original picture's aspect ratio will be used for the source image in the view. + */ + FBSDKProfilePictureModeNormal, +}; + +/*! + @abstract A view to display a profile picture. + */ +@interface FBSDKProfilePictureView : UIView + +/*! + @abstract The mode for the receiver to determine the aspect ratio of the source image. + */ +@property (nonatomic, assign) FBSDKProfilePictureMode pictureMode; + +/*! + @abstract The profile ID to show the picture for. + */ +@property (nonatomic, copy) NSString *profileID; + +/*! + @abstract Explicitly marks the receiver as needing to update the image. + @discussion This method is called whenever any properties that affect the source image are modified, but this can also + be used to trigger a manual update of the image if it needs to be re-downloaded. + */ +- (void)setNeedsImageUpdate; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKSettings.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKSettings.h new file mode 100644 index 0000000..edc0040 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKSettings.h @@ -0,0 +1,209 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +/* + * Constants defining logging behavior. Use with <[FBSDKSettings setLoggingBehavior]>. + */ + +/*! Include access token in logging. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAccessTokens; + +/*! Log performance characteristics */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorPerformanceCharacteristics; + +/*! Log FBSDKAppEvents interactions */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAppEvents; + +/*! Log Informational occurrences */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorInformational; + +/*! Log cache errors. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorCacheErrors; + +/*! Log errors from SDK UI controls */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorUIControlErrors; + +/*! Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugWarning; + +/*! Log warnings from API response, i.e. when requested feature will be deprecated in next version of API. + Info is the lowest level of severity, using it will result in logging all previously mentioned levels. + */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugInfo; + +/*! Log errors from SDK network requests */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorNetworkRequests; + +/*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ +FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorDeveloperErrors; + +@interface FBSDKSettings : NSObject + +/*! + @abstract Get the Facebook App ID used by the SDK. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookAppID). + */ ++ (NSString *)appID; + +/*! + @abstract Set the Facebook App ID to be used by the SDK. + @param appID The Facebook App ID to be used by the SDK. + */ ++ (void)setAppID:(NSString *)appID; + +/*! + @abstract Get the default url scheme suffix used for sessions. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). + */ ++ (NSString *)appURLSchemeSuffix; + +/*! + @abstract Set the app url scheme suffix used by the SDK. + @param appURLSchemeSuffix The url scheme suffix to be used by the SDK. + */ ++ (void)setAppURLSchemeSuffix:(NSString *)appURLSchemeSuffix; + +/*! + @abstract Retrieve the Client Token that has been set via [FBSDKSettings setClientToken]. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookClientToken). + */ ++ (NSString *)clientToken; + +/*! + @abstract Sets the Client Token for the Facebook App. + @discussion This is needed for certain API calls when made anonymously, without a user-based access token. + @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; + +/*! + @abstract A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. + @param disableGraphErrorRecovery YES or NO. + */ ++ (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery; + +/*! + @abstract Get the Facebook Display Name used by the SDK. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). + */ ++ (NSString *)displayName; + +/*! + @abstract Set the default Facebook Display Name to be used by the SDK. + @discussion 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 Facebook Display Name to be used by the SDK. + */ ++ (void)setDisplayName:(NSString *)displayName; + +/*! + @abstract Get the Facebook domain part. + @discussion If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). + */ ++ (NSString *)facebookDomainPart; + +/*! + @abstract Set the subpart of the Facebook domain. + @discussion This can be used to change 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; + +/*! + @abstract The quality of JPEG images sent to Facebook from the SDK. + @discussion If not explicitly set, the default is 0.9. + @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ ++ (CGFloat)JPEGCompressionQuality; + +/*! + @abstract Set the quality of JPEG images sent to Facebook from the SDK. + @param JPEGCompressionQuality The quality for JPEG images, expressed as a value from 0.0 to 1.0. + @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ ++ (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality; + +/*! + @abstract + Gets whether data such as that generated through FBSDKAppEvents 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; + +/*! + @abstract + Sets whether data such as that generated through FBSDKAppEvents 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; + +/*! + @abstract Retrieve the current iOS SDK version. + */ ++ (NSString *)sdkVersion; + +/*! + @abstract Retrieve the current Facebook SDK logging behavior. + */ ++ (NSSet *)loggingBehavior; + +/*! + @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as + constants with FBSDKLoggingBehavior*. + + @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 to an empty set in order to disable all logging. + + @discussion You can also define this via an array in your app plist with key "FacebookLoggingBehavior" or add and remove individual values via enableLoggingBehavior: or disableLogginBehavior: + */ ++ (void)setLoggingBehavior:(NSSet *)loggingBehavior; + +/*! + @abstract Enable a particular Facebook SDK logging behavior. + + @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*. + */ ++ (void)enableLoggingBehavior:(NSString *)loggingBehavior; + +/*! + @abstract Disable a particular Facebook SDK logging behavior. + + @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*. + */ ++ (void)disableLoggingBehavior:(NSString *)loggingBehavior; + +/*! + @abstract Set the user defaults key used by legacy token caches. + + @param tokenInformationKeyName the key used by legacy token caches. + + @discussion Use this only if you customized FBSessionTokenCachingStrategy in v3.x of + the Facebook SDK for iOS. +*/ ++ (void)setLegacyUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; + +/*! + @abstract Get the user defaults key used by legacy token caches. +*/ ++ (NSString *)legacyUserDefaultTokenInformationKeyName; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h new file mode 100644 index 0000000..7d2e0ac --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKTestUsersManager.h @@ -0,0 +1,102 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@class FBSDKAccessToken; + +/*! + @typedef + + @abstract Callback block for returning an array of FBSDKAccessToken instances (and possibly `NSNull` instances); or an error. + */ +typedef void (^FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)(NSArray *tokens, NSError *error) ; + +/*! + @typedef + + @abstract Callback block for removing a test user. + */ +typedef void (^FBSDKTestUsersManagerRemoveTestAccountHandler)(NSError *error) ; + + +/*! + @class FBSDKTestUsersManager + @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 FBSDKTestUsersManager : 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 FBSDKAccessToken instances for test accounts with the specific permissions. + @param arraysOfPermissions an array of permissions sets, such as @[ [NSSet setWithObject:@"email"], [NSSet setWithObject:@"user_birthday"]] + if you needed two test accounts with email and birthday permissions, respectively. You can pass in empty nested sets + if you need two arbitrary test accounts. For convenience, passing nil is treated as @[ [NSSet set] ] + 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:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract add a test account with the specified permissions + @param permissions the set of permissions, e.g., [NSSet setWithObjects:@"email", @"user_friends"] + @param handler the callback handler + */ +- (void)addTestAccountWithPermissions:(NSSet *)permissions + completionHandler:(FBSDKTestUsersManagerRetrieveTestAccountTokensHandler)handler; + +/*! + @abstract remove a test account for the given user id + @param userId the user id + @param handler the callback handler + */ +- (void)removeTestAccount:(NSString *)userId completionHandler:(FBSDKTestUsersManagerRemoveTestAccountHandler)handler; + +/*! + @abstract Make two test users friends with each other. + @param first the token of the first user + @param second the token of the second user + @param callback the callback handler + */ +- (void)makeFriendsWithFirst:(FBSDKAccessToken *)first second:(FBSDKAccessToken *)second callback:(void (^)(NSError *))callback; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Headers/FBSDKUtility.h b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKUtility.h new file mode 100644 index 0000000..46c490b --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Headers/FBSDKUtility.h @@ -0,0 +1,55 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @abstract Class to contain common utility methods. + */ +@interface FBSDKUtility : NSObject + +/*! + @abstract Parses a query string into a dictionary. + @param queryString The query string value. + @return A dictionary with the key/value pairs. + */ ++ (NSDictionary *)dictionaryWithQueryString:(NSString *)queryString; + +/*! + @abstract Constructs a query string from a dictionary. + @param dictionary The dictionary with key/value pairs for the query string. + @param errorRef If an error occurs, upon return contains an NSError object that describes the problem. + @result Query string representation of the parameters. + */ ++ (NSString *)queryStringWithDictionary:(NSDictionary *)dictionary error:(NSError *__autoreleasing *)errorRef; + +/*! + @abstract Decodes a value from an URL. + @param value The value to decode. + @result The decoded value. + */ ++ (NSString *)URLDecode:(NSString *)value; + +/*! + @abstract Encodes a value for an URL. + @param value The value to encode. + @result The encoded value. + */ ++ (NSString *)URLEncode:(NSString *)value; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/Info.plist b/Vendor/FBSDKCoreKit.framework/Info.plist new file mode 100644 index 0000000..b6dda8e Binary files /dev/null and b/Vendor/FBSDKCoreKit.framework/Info.plist differ diff --git a/Vendor/FBSDKCoreKit.framework/Modules/module.modulemap b/Vendor/FBSDKCoreKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..3c3e6e6 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/Modules/module.modulemap @@ -0,0 +1,31 @@ +framework module FBSDKCoreKit { + umbrella header "FBSDKCoreKit.h" + + export * + module * { export * } + + explicit module FBSDKButton { + header "FBSDKButton.h" + export * + } + + explicit module FBSDKAppLinkResolver { + header "FBSDKAppLinkResolver.h" + export * + } + + explicit module FBSDKGraphErrorRecoveryProcessor { + header "FBSDKGraphErrorRecoveryProcessor.h" + export * + } + + explicit module FBSDKGraphRequestDataAttachment { + header "FBSDKGraphRequestDataAttachment.h" + export * + } + + explicit module FBSDKTestUsersManager { + header "FBSDKTestUsersManager.h" + export * + } +} diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKAccessTokenCacheV4.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKAccessTokenCacheV4.h new file mode 100644 index 0000000..7fa7d7f --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKAccessTokenCacheV4.h @@ -0,0 +1,26 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import "FBSDKAccessToken.h" +#import "FBSDKAccessTokenCaching.h" + +@interface FBSDKAccessTokenCacheV4 : NSObject + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPICrypto.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPICrypto.h new file mode 100644 index 0000000..7d488e7 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPICrypto.h @@ -0,0 +1,31 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import "FBSDKBridgeAPIRequest.h" + +@interface FBSDKBridgeAPICrypto : NSObject + ++ (void)addCipherKeyToQueryParameters:(NSMutableDictionary *)queryParameters; ++ (NSDictionary *)decryptResponseForRequest:(FBSDKBridgeAPIRequest *)request + queryParameters:(NSDictionary *)queryParameters + error:(NSError *__autoreleasing *)errorRef; ++ (void)reset; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocol.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocol.h new file mode 100644 index 0000000..679577c --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocol.h @@ -0,0 +1,44 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +#import "FBSDKBridgeAPIProtocolType.h" + +@class FBSDKBridgeAPIRequest; + +FBSDK_EXTERN NSString *const FBSDKBridgeAPIAppIDKey; +FBSDK_EXTERN NSString *const FBSDKBridgeAPISchemeSuffixKey; +FBSDK_EXTERN NSString *const FBSDKBridgeAPIVersionKey; + +@protocol FBSDKBridgeAPIProtocol + +- (NSURL *)requestURLWithActionID:(NSString *)actionID + scheme:(NSString *)scheme + methodName:(NSString *)methodName + methodVersion:(NSString *)methodVersion + parameters:(NSDictionary *)parameters + error:(NSError *__autoreleasing *)errorRef; +- (NSDictionary *)responseParametersForActionID:(NSString *)actionID + queryParameters:(NSDictionary *)queryParameters + cancelled:(BOOL *)cancelledRef + error:(NSError *__autoreleasing *)errorRef; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolNativeV1.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolNativeV1.h new file mode 100644 index 0000000..8fd34bd --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolNativeV1.h @@ -0,0 +1,70 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +#import "FBSDKBridgeAPIProtocol.h" + +typedef struct +{ + __unsafe_unretained NSString *bridgeArgs; + __unsafe_unretained NSString *methodArgs; + __unsafe_unretained NSString *methodVersion; +} FBSDKBridgeAPIProtocolNativeV1OutputKeysStruct; +FBSDK_EXTERN const FBSDKBridgeAPIProtocolNativeV1OutputKeysStruct FBSDKBridgeAPIProtocolNativeV1OutputKeys; + +typedef struct +{ + __unsafe_unretained NSString *actionID; + __unsafe_unretained NSString *appIcon; + __unsafe_unretained NSString *appName; + __unsafe_unretained NSString *sdkVersion; +} FBSDKBridgeAPIProtocolNativeV1BridgeParameterOutputKeysStruct; +FBSDK_EXTERN const FBSDKBridgeAPIProtocolNativeV1BridgeParameterOutputKeysStruct FBSDKBridgeAPIProtocolNativeV1BridgeParameterOutputKeys; + +typedef struct +{ + __unsafe_unretained NSString *bridgeArgs; + __unsafe_unretained NSString *methodResults; +} FBSDKBridgeAPIProtocolNativeV1InputKeysStruct; +FBSDK_EXTERN const FBSDKBridgeAPIProtocolNativeV1InputKeysStruct FBSDKBridgeAPIProtocolNativeV1InputKeys; + +typedef struct +{ + __unsafe_unretained NSString *actionID; + __unsafe_unretained NSString *error; +} FBSDKBridgeAPIProtocolNativeV1BridgeParameterInputKeysStruct; +FBSDK_EXTERN const FBSDKBridgeAPIProtocolNativeV1BridgeParameterInputKeysStruct FBSDKBridgeAPIProtocolNativeV1BridgeParameterInputKeys; + +@interface FBSDKBridgeAPIProtocolNativeV1 : NSObject + +- (instancetype)initWithAppScheme:(NSString *)appScheme; +- (instancetype)initWithAppScheme:(NSString *)appScheme + pasteboard:(UIPasteboard *)pasteboard + dataLengthThreshold:(NSUInteger)dataLengthThreshold + includeAppIcon:(BOOL)includeAppIcon +NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, copy, readonly) NSString *appScheme; +@property (nonatomic, assign, readonly) NSUInteger dataLengthThreshold; +@property (nonatomic, assign, readonly) BOOL includeAppIcon; +@property (nonatomic, strong, readonly) UIPasteboard *pasteboard; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolWebV1.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolWebV1.h new file mode 100644 index 0000000..c7b28f4 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKBridgeAPIProtocolWebV1.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import "FBSDKBridgeAPIProtocol.h" + +@interface FBSDKBridgeAPIProtocolWebV1 : NSObject + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKError.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKError.h new file mode 100644 index 0000000..f37bd86 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKError.h @@ -0,0 +1,56 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@interface FBSDKError : NSObject + ++ (NSString *)errorDomain; + ++ (BOOL)errorIsNetworkError:(NSError *)error; + ++ (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message; ++ (NSError *)errorWithCode:(NSInteger)code message:(NSString *)message underlyingError:(NSError *)underlyingError; ++ (NSError *)errorWithCode:(NSInteger)code + userInfo:(NSDictionary *)userInfo + message:(NSString *)message + underlyingError:(NSError *)underlyingError; + ++ (NSError *)invalidArgumentErrorWithName:(NSString *)name value:(id)value message:(NSString *)message; ++ (NSError *)invalidArgumentErrorWithName:(NSString *)name + value:(id)value + message:(NSString *)message + underlyingError:(NSError *)underlyingError; ++ (NSError *)invalidCollectionErrorWithName:(NSString *)name + collection:(id)collection + item:(id)item + message:(NSString *)message; ++ (NSError *)invalidCollectionErrorWithName:(NSString *)name + collection:(id)collection + item:(id)item + message:(NSString *)message + underlyingError:(NSError *)underlyingError; + ++ (NSError *)requiredArgumentErrorWithName:(NSString *)name message:(NSString *)message; ++ (NSError *)requiredArgumentErrorWithName:(NSString *)name + message:(NSString *)message + underlyingError:(NSError *)underlyingError; + ++ (NSError *)unknownErrorWithMessage:(NSString *)message; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestBody.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestBody.h new file mode 100644 index 0000000..b61c782 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestBody.h @@ -0,0 +1,47 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import +#import + +@class FBSDKGraphRequestDataAttachment; +@class FBSDKLogger; + +@interface FBSDKGraphRequestBody : NSObject + +@property (nonatomic, retain, readonly) NSData *data; + +- (void)appendWithKey:(NSString *)key + formValue:(NSString *)value + logger:(FBSDKLogger *)logger; + +- (void)appendWithKey:(NSString *)key + imageValue:(UIImage *)image + logger:(FBSDKLogger *)logger; + +- (void)appendWithKey:(NSString *)key + dataValue:(NSData *)data + logger:(FBSDKLogger *)logger; + +- (void)appendWithKey:(NSString *)key + dataAttachmentValue:(FBSDKGraphRequestDataAttachment *)dataAttachment + logger:(FBSDKLogger *)logger; + ++ (NSString *)mimeContentType; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestMetadata.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestMetadata.h new file mode 100644 index 0000000..cd218c4 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKGraphRequestMetadata.h @@ -0,0 +1,40 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +// Internal only class to facilitate FBSDKGraphRequest processing, specifically +// associating FBSDKGraphRequest and FBSDKGraphRequestHandler instances and necessary +// data for retry processing. +@interface FBSDKGraphRequestMetadata : NSObject + +@property (nonatomic, retain) FBSDKGraphRequest *request; +@property (nonatomic, copy) FBSDKGraphRequestHandler completionHandler; +@property (nonatomic, copy) NSDictionary *batchParameters; + +- (instancetype)initWithRequest:(FBSDKGraphRequest *)request + completionHandler:(FBSDKGraphRequestHandler)handler + batchParameters:(NSDictionary *)batchParameters +NS_DESIGNATED_INITIALIZER; + +- (void)invokeCompletionHandlerForConnection:(FBSDKGraphRequestConnection *)connection + withResults:(id)results + error:(NSError *)error; +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKURLConnection.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKURLConnection.h new file mode 100644 index 0000000..cbe80a0 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKURLConnection.h @@ -0,0 +1,51 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@class FBSDKURLConnection; + +typedef void (^FBSDKURLConnectionHandler)(FBSDKURLConnection *connection, + NSError *error, + NSURLResponse *response, + NSData *responseData); + +@protocol FBSDKURLConnectionDelegate + +@optional + +- (void)facebookURLConnection:(FBSDKURLConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten + totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; + +@end + +@interface FBSDKURLConnection : NSObject + +- (FBSDKURLConnection *)initWithRequest:(NSURLRequest *)request + completionHandler:(FBSDKURLConnectionHandler)handler +NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, assign) id delegate; + +- (void)cancel; +- (void)start; +- (void)setDelegateQueue:(NSOperationQueue *)queue; + +@end diff --git a/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKWebDialogView.h b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKWebDialogView.h new file mode 100644 index 0000000..9ad7427 --- /dev/null +++ b/Vendor/FBSDKCoreKit.framework/PrivateHeaders/FBSDKWebDialogView.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@protocol FBSDKWebDialogViewDelegate; + +@interface FBSDKWebDialogView : UIView + +@property (nonatomic, assign) id delegate; + +- (void)loadURL:(NSURL *)URL; +- (void)stopLoading; + +@end + +@protocol FBSDKWebDialogViewDelegate + +- (void)webDialogView:(FBSDKWebDialogView *)webDialogView didCompleteWithResults:(NSDictionary *)results; +- (void)webDialogView:(FBSDKWebDialogView *)webDialogView didFailWithError:(NSError *)error; +- (void)webDialogViewDidCancel:(FBSDKWebDialogView *)webDialogView; +- (void)webDialogViewDidFinishLoad:(FBSDKWebDialogView *)webDialogView; + +@end diff --git a/Vendor/FBSDKLoginKit.framework/FBSDKLoginKit b/Vendor/FBSDKLoginKit.framework/FBSDKLoginKit new file mode 100644 index 0000000..d6b45c5 Binary files /dev/null and b/Vendor/FBSDKLoginKit.framework/FBSDKLoginKit differ diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h new file mode 100644 index 0000000..51499d4 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h @@ -0,0 +1,128 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +#import + +#import "FBSDKTooltipView.h" + +@protocol FBSDKLoginButtonDelegate; + +/*! + @typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) + @abstract Indicates the desired login tooltip behavior. + */ +typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) +{ + /*! The default behavior. The tooltip will only be displayed if + the app is eligible (determined by possible server round trip) */ + FBSDKLoginButtonTooltipBehaviorAutomatic = 0, + /*! Force display of the tooltip (typically for UI testing) */ + FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, + /*! Force disable. In this case you can still exert more refined + control by manually constructing a `FBSDKLoginTooltipView` instance. */ + FBSDKLoginButtonTooltipBehaviorDisable = 2 +}; + +/*! + @abstract A button that initiates a log in or log out flow upon tapping. + @discussion `FBSDKLoginButton` works with `[FBSDKAccessToken currentAccessToken]` to + determine what to display, and automatically starts authentication when tapped (i.e., + you do not need to manually subscribe action targets). + + Like `FBSDKLoginManager`, you should make sure your app delegate is connected to + `FBSDKApplicationDelegate` in order for the button's delegate to receive messages. + + `FBSDKLoginButton` has a fixed height, but you may change the width. `initWithFrame:CGRectZero` + will size the button to its minimum frame. +*/ +@interface FBSDKLoginButton : FBSDKButton + +/*! + @abstract The default audience to use, if publish permissions are requested at login time. + */ +@property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; +/*! + @abstract Gets or sets the delegate. + */ +@property (weak, nonatomic) IBOutlet id delegate; +/*! + @abstract Gets or sets the login behavior to use + */ +@property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; +/*! + @abstract The publish permissions to request. + + @discussion Use `defaultAudience` to specify the default audience to publish to. + Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + */ +@property (copy, nonatomic) NSArray *publishPermissions; +/*! + @abstract The read permissions to request. + + @discussion Note, that if read permissions are specified, then publish permissions should not be specified. This is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + */ +@property (copy, nonatomic) NSArray *readPermissions; +/*! + @abstract Gets or sets the desired tooltip behavior. + */ +@property (assign, nonatomic) FBSDKLoginButtonTooltipBehavior tooltipBehavior; +/*! + @abstract Gets or sets the desired tooltip color style. + */ +@property (assign, nonatomic) FBSDKTooltipColorStyle tooltipColorStyle; + +@end + +/*! + @protocol + @abstract A delegate for `FBSDKLoginButton` + */ +@protocol FBSDKLoginButtonDelegate + +@required +/*! + @abstract Sent to the delegate when the button was used to login. + @param loginButton the sender + @param result The results of the login + @param error The error (if any) from the login + */ +- (void) loginButton:(FBSDKLoginButton *)loginButton +didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result + error:(NSError *)error; + +/*! + @abstract Sent to the delegate when the button was used to logout. + @param loginButton The button that was clicked. +*/ +- (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton; + +@optional +/*! + @abstract Sent to the delegate when the button is about to login. + @param loginButton the sender + @return YES if the login should be allowed to proceed, NO otherwise + */ +- (BOOL) loginButtonWillLogin:(FBSDKLoginButton *)loginButton; + +@end diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h new file mode 100644 index 0000000..100c09a --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginConstants.h @@ -0,0 +1,75 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +/*! + @abstract The error domain for all errors from FBSDKLoginKit + @discussion Error codes from the SDK in the range 300-399 are reserved for this domain. + */ +FBSDK_EXTERN NSString *const FBSDKLoginErrorDomain; + +/*! + @typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) + @abstract Error codes for FBSDKLoginErrorDomain. + */ +typedef NS_ENUM(NSInteger, FBSDKLoginErrorCode) +{ + /*! + @abstract Reserved. + */ + FBSDKLoginReservedErrorCode = 300, + /*! + @abstract The error code for unknown errors. + */ + FBSDKLoginUnknownErrorCode, + + /*! + @abstract The user's password has changed and must log in again + */ + FBSDKLoginPasswordChangedErrorCode, + /*! + @abstract The user must log in to their account on www.facebook.com to restore access + */ + FBSDKLoginUserCheckpointedErrorCode, + /*! + @abstract Indicates a failure to request new permissions because the user has changed. + */ + FBSDKLoginUserMismatchErrorCode, + /*! + @abstract The user must confirm their account with Facebook before logging in + */ + FBSDKLoginUnconfirmedUserErrorCode, + + /*! + @abstract The Accounts framework failed without returning an error, indicating the + app's slider in the iOS Facebook Settings (device Settings -> Facebook -> App Name) has + been disabled. + */ + FBSDKLoginSystemAccountAppDisabledErrorCode, + /*! + @abstract An error occurred related to Facebook system Account store + */ + FBSDKLoginSystemAccountUnavailableErrorCode, + /*! + @abstract The login response was missing a valid challenge string. + */ + FBSDKLoginBadChallengeString, +}; diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h new file mode 100644 index 0000000..4723940 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginKit.h @@ -0,0 +1,25 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import +#import +#import +#import +#import diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h new file mode 100644 index 0000000..ee35bd8 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManager.h @@ -0,0 +1,202 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import +#import +#import + +@class FBSDKLoginManagerLoginResult; + +/*! + @abstract Describes the call back to the FBSDKLoginManager + @param result the result of the authorization + @param error the authorization error, if any. + */ +typedef void (^FBSDKLoginManagerRequestTokenHandler)(FBSDKLoginManagerLoginResult *result, NSError *error); + + +/*! + @typedef FBSDKDefaultAudience 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, FBSDKDefaultAudience) +{ + /*! Indicates that the user's friends are able to see posts made by the application */ + FBSDKDefaultAudienceFriends = 0, + /*! Indicates that only the user is able to see posts made by the application */ + FBSDKDefaultAudienceOnlyMe, + /*! Indicates that all Facebook users are able to see posts made by the application */ + FBSDKDefaultAudienceEveryone, +}; + +/*! + @typedef FBSDKLoginBehavior enum + + @abstract + Passed to the \c FBSDKLoginManager to indicate how Facebook Login should 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. + + The \c FBSDKLoginBehavior enum specifies which log-in methods may be used. The SDK + will determine the best behavior based on the current device (such as iOS version). + */ +typedef NS_ENUM(NSUInteger, FBSDKLoginBehavior) +{ + /*! + @abstract This is the default behavior, and indicates logging in through the native + Facebook app may be used. The SDK may still use Safari instead. + */ + FBSDKLoginBehaviorNative = 0, + /*! + @abstract Attempts log in through the Safari or SFSafariViewController, if available. + */ + FBSDKLoginBehaviorBrowser, + /*! + @abstract Attempts log in through the Facebook account currently signed in through + the device Settings. + @note If the account is not available to the app (either not configured by user or + as determined by the SDK) this behavior falls back to \c FBSDKLoginBehaviorNative. + */ + FBSDKLoginBehaviorSystemAccount, + /*! + @abstract Attemps log in through a modal \c UIWebView pop up + + @note This behavior is only available to certain types of apps. Please check the Facebook + Platform Policy to verify your app meets the restrictions. + */ + FBSDKLoginBehaviorWeb, +}; + +/*! + @abstract `FBSDKLoginManager` provides methods for logging the user in and out. + @discussion `FBSDKLoginManager` works directly with `[FBSDKAccessToken currentAccessToken]` and + sets the "currentAccessToken" upon successful authorizations (or sets `nil` in case of `logOut`). + + You should check `[FBSDKAccessToken currentAccessToken]` before calling logIn* to see if there is + a cached token available (typically in your viewDidLoad). + + If you are managing your own token instances outside of "currentAccessToken", you will need to set + "currentAccessToken" before calling logIn* to authorize futher permissions on your tokens. + */ +@interface FBSDKLoginManager : NSObject + +/*! + @abstract the default audience. + @discussion you should set this if you intend to ask for publish permissions. + */ +@property (assign, nonatomic) FBSDKDefaultAudience defaultAudience; + +/*! + @abstract the login behavior + */ +@property (assign, nonatomic) FBSDKLoginBehavior loginBehavior; + +/*! + @deprecated use logInWithReadPermissions:fromViewController:handler: instead + */ +- (void)logInWithReadPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler +__attribute__ ((deprecated("use logInWithReadPermissions:fromViewController:handler: instead"))); + +/*! + @deprecated use logInWithPublishPermissions:fromViewController:handler: instead + */ +- (void)logInWithPublishPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler +__attribute__ ((deprecated("use logInWithPublishPermissions:fromViewController:handler: instead"))); + +/*! + @abstract Logs the user in or authorizes additional permissions. + @param permissions the optional array of permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param fromViewController the view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler the callback. + @discussion Use this method when asking for read permissions. You should only ask for permissions when they + are needed and explain the value to the user. You can inspect the result.declinedPermissions to also + provide more information to the user if they decline permissions. + + If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user + and will pass the "rerequest" flag to the login dialog. + + This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` + already contains the permissions you need before asking to reduce unnecessary app switching. For example, + you could make that check at viewDidLoad. + */ +- (void)logInWithReadPermissions:(NSArray *)permissions + fromViewController:(UIViewController *)fromViewController + handler:(FBSDKLoginManagerRequestTokenHandler)handler; + +/*! + @abstract Logs the user in or authorizes additional permissions. + @param permissions the optional array of permissions. Note this is converted to NSSet and is only + an NSArray for the convenience of literal syntax. + @param fromViewController the view controller to present from. If nil, the topmost view controller will be + automatically determined as best as possible. + @param handler the callback. + @discussion Use this method when asking for publish permissions. You should only ask for permissions when they + are needed and explain the value to the user. You can inspect the result.declinedPermissions to also + provide more information to the user if they decline permissions. + + If `[FBSDKAccessToken currentAccessToken]` is not nil, it will be treated as a reauthorization for that user + and will pass the "rerequest" flag to the login dialog. + + This method will present UI the user. You typically should check if `[FBSDKAccessToken currentAccessToken]` + already contains the permissions you need before asking to reduce unnecessary app switching. For example, + you could make that check at viewDidLoad. + */ +- (void)logInWithPublishPermissions:(NSArray *)permissions + fromViewController:(UIViewController *)fromViewController + handler:(FBSDKLoginManagerRequestTokenHandler)handler; + +/*! + @abstract Logs the user out + @discussion This calls [FBSDKAccessToken setCurrentAccessToken:nil] and [FBSDKProfile setCurrentProfile:nil]. + */ +- (void)logOut; + +/*! + @method + + @abstract Issues an asychronous renewCredentialsForAccount call to the device's Facebook account store. + + @param handler The completion handler to call when the renewal is completed. This can be invoked on an arbitrary thread. + + @discussion This can be used to explicitly renew account credentials 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). + + If the `[FBSDKAccessToken currentAccessToken]` was from the account store, a succesful renewal will also set + a new "currentAccessToken". + */ ++ (void)renewSystemCredentials:(void (^)(ACAccountCredentialRenewResult result, NSError *error))handler; + +@end diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h new file mode 100644 index 0000000..36a1af6 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginManagerLoginResult.h @@ -0,0 +1,62 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +@class FBSDKAccessToken; + +/*! + @abstract Describes the result of a login attempt. + */ +@interface FBSDKLoginManagerLoginResult : NSObject + +/*! + @abstract the access token. + */ +@property (copy, nonatomic) FBSDKAccessToken *token; + +/*! + @abstract whether the login was cancelled by the user. + */ +@property (readonly, nonatomic) BOOL isCancelled; + +/*! + @abstract the set of permissions granted by the user in the associated request. + @discussion inspect the token's permissions set for a complete list. + */ +@property (copy, nonatomic) NSSet *grantedPermissions; + +/*! + @abstract the set of permissions declined by the user in the associated request. + @discussion inspect the token's permissions set for a complete list. + */ +@property (copy, nonatomic) NSSet *declinedPermissions; + +/*! + @abstract Initializes a new instance. + @param token the access token + @param isCancelled whether the login was cancelled by the user + @param grantedPermissions the set of granted permissions + @param declinedPermissions the set of declined permissions + */ +- (instancetype)initWithToken:(FBSDKAccessToken *)token + isCancelled:(BOOL)isCancelled + grantedPermissions:(NSSet *)grantedPermissions + declinedPermissions:(NSSet *)declinedPermissions +NS_DESIGNATED_INITIALIZER; +@end diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h new file mode 100644 index 0000000..e6a9411 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKLoginTooltipView.h @@ -0,0 +1,93 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +#import + +@protocol FBSDKLoginTooltipViewDelegate; + +/*! + @class FBSDKLoginTooltipView + + @abstract Represents a tooltip to be displayed next to a Facebook login button + to highlight features for new users. + + @discussion The `FBSDKLoginButton` may display this view automatically. If you do + not use the `FBSDKLoginButton`, you can manually call one of the `present*` methods + as appropriate and customize behavior via `FBSDKLoginTooltipViewDelegate` delegate. + + By default, the `FBSDKLoginTooltipView` 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 FBSDKLoginTooltipView : FBSDKTooltipView + +/*! @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 `FBSDKLoginTooltipViewDelegate` protocol defines the methods used to receive event + notifications from `FBSDKLoginTooltipView` objects. + */ +@protocol FBSDKLoginTooltipViewDelegate + +@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:(FBSDKLoginTooltipView *)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:(FBSDKLoginTooltipView *)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:(FBSDKLoginTooltipView *)view; + + +@end diff --git a/Vendor/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h new file mode 100644 index 0000000..aff1067 --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Headers/FBSDKTooltipView.h @@ -0,0 +1,141 @@ +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// +// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, +// copy, modify, and distribute this software in source code or binary form for use +// in connection with the web services and APIs provided by Facebook. +// +// As with any software that integrates with the Facebook platform, your use of +// this software is subject to the Facebook Developer Principles and Policies +// [http://developers.facebook.com/policy/]. This copyright notice shall be +// included in all copies or substantial portions of the software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#import + +/*! + @typedef FBSDKTooltipViewArrowDirection enum + + @abstract + Passed on construction to determine arrow orientation. + */ +typedef NS_ENUM(NSUInteger, FBSDKTooltipViewArrowDirection) +{ + /*! View is located above given point, arrow is pointing down. */ + FBSDKTooltipViewArrowDirectionDown = 0, + /*! View is located below given point, arrow is pointing up. */ + FBSDKTooltipViewArrowDirectionUp = 1, +}; + +/*! + @typedef FBSDKTooltipColorStyle enum + + @abstract + Passed on construction to determine color styling. + */ +typedef NS_ENUM(NSUInteger, FBSDKTooltipColorStyle) +{ + /*! Light blue background, white text, faded blue close button. */ + FBSDKTooltipColorStyleFriendlyBlue = 0, + /*! Dark gray background, white text, light gray close button. */ + FBSDKTooltipColorStyleNeutralGray = 1, +}; + +/*! + @class FBSDKTooltipView + + @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 FBSDKTooltipView : 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) FBSDKTooltipColorStyle 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 `FBSDKLoginTooltipView` view. + + @see FBSDKLoginTooltipView + */ +- (instancetype)initWithTagline:(NSString *)tagline message:(NSString *)message colorStyle:(FBSDKTooltipColorStyle)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:(FBSDKTooltipViewArrowDirection)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/FBSDKLoginKit.framework/Info.plist b/Vendor/FBSDKLoginKit.framework/Info.plist new file mode 100644 index 0000000..ad88b51 Binary files /dev/null and b/Vendor/FBSDKLoginKit.framework/Info.plist differ diff --git a/Vendor/FBSDKLoginKit.framework/Modules/module.modulemap b/Vendor/FBSDKLoginKit.framework/Modules/module.modulemap new file mode 100644 index 0000000..4b1d57b --- /dev/null +++ b/Vendor/FBSDKLoginKit.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module FBSDKLoginKit { + umbrella header "FBSDKLoginKit.h" + + export * + module * { export * } +}