upgrade Facebook libraries
This commit is contained in:
1 parent
451fc6aa7f
commit
060efc0c83
72 files changed
+6811
-5623
No files matched your search
+19
-32
@@ -24,6 +24,7 @@
|
||||
#import "FBSDKShareCameraEffectContent.h"
|
||||
#import "FBSDKShareConstants.h"
|
||||
#import "FBSDKShareDefines.h"
|
||||
#import "FBSDKShareExtension.h"
|
||||
#import "FBSDKShareLinkContent.h"
|
||||
#import "FBSDKShareMediaContent.h"
|
||||
#import "FBSDKShareOpenGraphAction.h"
|
||||
@@ -1169,56 +1170,42 @@ static inline void FBSDKShareDialogValidateShareExtensionSchemeRegisteredForCanO
|
||||
- (NSString *)_calculateInitialText
|
||||
{
|
||||
NSString *initialText;
|
||||
NSString *const hashtag = [FBSDKShareUtility hashtagStringFromHashtag:self.shareContent.hashtag];
|
||||
if ([self _canAttributeThroughShareSheet]) {
|
||||
NSMutableDictionary *initialTextDictionary = [NSMutableDictionary new];
|
||||
initialTextDictionary[@"app_id"] = [FBSDKSettings appID];
|
||||
NSString *hashtag = [FBSDKShareUtility hashtagStringFromHashtag:self.shareContent.hashtag];
|
||||
if (hashtag != nil) {
|
||||
initialTextDictionary[@"hashtags"] = @[hashtag];
|
||||
NSMutableDictionary<NSString *, id> *const parameters = [NSMutableDictionary new];
|
||||
NSString *const appID = [FBSDKSettings appID];
|
||||
if (appID.length > 0) {
|
||||
parameters[FBSDKShareExtensionParamAppID] = [FBSDKSettings appID];
|
||||
}
|
||||
if (hashtag.length > 0) {
|
||||
parameters[FBSDKShareExtensionParamHashtags] = @[hashtag];
|
||||
}
|
||||
if ([self.shareContent isKindOfClass:[FBSDKShareLinkContent class]]) {
|
||||
NSString *quote = ((FBSDKShareLinkContent *)self.shareContent).quote;
|
||||
if (quote != nil) {
|
||||
initialTextDictionary[@"quotes"] = @[quote];
|
||||
NSString *const quote = ((FBSDKShareLinkContent *)self.shareContent).quote;
|
||||
if (quote.length > 0) {
|
||||
parameters[FBSDKShareExtensionParamQuotes] = @[quote];
|
||||
}
|
||||
}
|
||||
if ([self.shareContent isKindOfClass:[FBSDKShareOpenGraphContent class]]) {
|
||||
NSDictionary *ogData = [FBSDKShareUtility parametersForShareContent:self.shareContent
|
||||
bridgeOptions:FBSDKShareBridgeOptionsDefault
|
||||
shouldFailOnDataError:self.shouldFailOnDataError];
|
||||
initialTextDictionary[@"og_data"] = ogData;
|
||||
NSDictionary<NSString *, id> *const ogData = [FBSDKShareUtility parametersForShareContent:self.shareContent
|
||||
bridgeOptions:FBSDKShareBridgeOptionsDefault
|
||||
shouldFailOnDataError:self.shouldFailOnDataError];
|
||||
parameters[FBSDKShareExtensionParamOGData] = ogData;
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
NSString *jsonString = [FBSDKInternalUtility JSONStringForObject:initialTextDictionary error:&error invalidObjectHandler:NULL];
|
||||
NSString *const jsonString = [FBSDKInternalUtility JSONStringForObject:parameters error:&error invalidObjectHandler:NULL];
|
||||
if (error != nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *JSONStartDelimiter = @"|";
|
||||
initialText = [NSString stringWithFormat:@"%@%@%@",
|
||||
[self _calculatePreJSONInitialTextWithHashtag:hashtag],
|
||||
JSONStartDelimiter,
|
||||
jsonString];
|
||||
initialText = FBSDKShareExtensionInitialText(appID, hashtag, jsonString);
|
||||
} else {
|
||||
NSString *hashtag = [FBSDKShareUtility hashtagStringFromHashtag:self.shareContent.hashtag];
|
||||
if (hashtag != nil) {
|
||||
if (hashtag.length > 0) {
|
||||
initialText = hashtag;
|
||||
}
|
||||
}
|
||||
return initialText;
|
||||
}
|
||||
|
||||
// Not all versions of the Share Extension support JSON. Adding this text before allows backward compatibility
|
||||
- (NSString *)_calculatePreJSONInitialTextWithHashtag:(NSString *)hashtag
|
||||
{
|
||||
NSMutableString *text = [NSMutableString new];
|
||||
[text appendString:[NSString stringWithFormat:@"fb-app-id:%@", [FBSDKSettings appID]]];
|
||||
if (hashtag != nil) {
|
||||
[text appendString:@" "];
|
||||
[text appendString:hashtag];
|
||||
}
|
||||
return [text copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -195,7 +195,7 @@ NSString *const kFBSDKShareVideoURLKey = @"videoURL";
|
||||
}
|
||||
if ((errorRef != NULL) && !*errorRef) {
|
||||
*errorRef = [NSError fbInvalidArgumentErrorWithDomain:FBSDKShareErrorDomain
|
||||
name:@"videoURL"
|
||||
name:kFBSDKShareVideoURLKey
|
||||
value:videoURL
|
||||
message:@"Must refer to an asset file."];
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// 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 <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const FBSDKShareExtensionParamAppID; // application identifier string
|
||||
extern NSString *const FBSDKShareExtensionParamHashtags; // array of hashtag strings (max 1)
|
||||
extern NSString *const FBSDKShareExtensionParamQuotes; // array of quote strings (max 1)
|
||||
extern NSString *const FBSDKShareExtensionParamOGData; // dictionary of Open Graph data
|
||||
|
||||
NSString *_Nullable FBSDKShareExtensionInitialText(NSString *_Nullable appID,
|
||||
NSString *_Nullable hashtag,
|
||||
NSString *_Nullable jsonString);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// 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 "FBSDKShareExtension.h"
|
||||
|
||||
NSString *const FBSDKShareExtensionParamAppID = @"app_id"; // application identifier string
|
||||
NSString *const FBSDKShareExtensionParamHashtags = @"hashtags"; // array of hashtag strings (max 1)
|
||||
NSString *const FBSDKShareExtensionParamQuotes = @"quotes"; // array of quote strings (max 1)
|
||||
NSString *const FBSDKShareExtensionParamOGData = @"og_data"; // dictionary of Open Graph data
|
||||
|
||||
NSString *FBSDKShareExtensionInitialText(NSString *appID,
|
||||
NSString *hashtag,
|
||||
NSString *jsonString)
|
||||
{
|
||||
NSMutableString *const initialText = [NSMutableString new];
|
||||
|
||||
// Not all versions of our Share Extension supported JSON.
|
||||
// Adding this text before the JSON payload supports backward compatibility.
|
||||
if (appID.length > 0) {
|
||||
[initialText appendString:[NSString stringWithFormat:@"fb-app-id:%@", appID]];
|
||||
}
|
||||
if (hashtag.length > 0) {
|
||||
if (initialText.length > 0) {
|
||||
[initialText appendString:@" "];
|
||||
}
|
||||
[initialText appendString:hashtag];
|
||||
}
|
||||
|
||||
if (jsonString.length > 0) {
|
||||
[initialText appendString:@"|"]; // JSON start delimiter
|
||||
[initialText appendString:jsonString];
|
||||
}
|
||||
|
||||
return initialText.length > 0 ? initialText : nil;
|
||||
}
|
||||
Generated
+24
-7
@@ -1,16 +1,22 @@
|
||||
# Facebook SDK for iOS
|
||||
|
||||
[](https://cocoapods.org/pods/FBSDKCoreKit)
|
||||
[](https://travis-ci.org/facebook/facebook-objc-sdk)
|
||||
|
||||
[](https://cocoapods.org/pods/FBSDKCoreKit)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
|
||||
This open-source library allows you to integrate Facebook into your iOS app.
|
||||
|
||||
Learn more about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/docs/ios
|
||||
Learn more about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more
|
||||
at https://developers.facebook.com/docs/ios
|
||||
|
||||
NOTE: By default, the Facebook SDK for iOS is installed in ~/Documents/FacebookSDK
|
||||
|
||||
## TRY IT OUT
|
||||
|
||||
1. Download the SDK at <https://developers.facebook.com/docs/ios> or via CocoaPods by adding the 'FBSDKCoreKit', 'FBSDKLoginKit', and 'FBSDKShareKit' pods.
|
||||
1. Download the SDK at <https://developers.facebook.com/docs/ios> or via CocoaPods by adding the 'FBSDKCoreKit',
|
||||
'FBSDKLoginKit', and 'FBSDKShareKit' pods.
|
||||
2. Test your install: build and run the project at `~/Documents/FacebookSDK/Samples/Scrumptious/Scrumptious.xcodeproj`
|
||||
3. Check-out the tutorials available online at: <https://developers.facebook.com/docs/ios/getting-started>
|
||||
4. Start coding! Visit <https://developers.facebook.com/docs/ios> for tutorials and reference documentation.
|
||||
@@ -27,7 +33,8 @@ NOTE: By default, the Facebook SDK for iOS is installed in ~/Documents/FacebookS
|
||||
|
||||
Please report bugs or issues to <https://developers.facebook.com/bugs/>
|
||||
|
||||
You can also join the [Facebook Developers Group on Facebook](https://www.facebook.com/groups/fbdevelopers/) or ask questions on [Stack Overflow](http://facebook.stackoverflow.com)
|
||||
You can also join the [Facebook Developers Group on Facebook](https://www.facebook.com/groups/fbdevelopers/) or ask
|
||||
questions on [Stack Overflow](http://facebook.stackoverflow.com)
|
||||
|
||||
## LICENSE
|
||||
|
||||
@@ -35,9 +42,19 @@ See the [LICENSE](LICENSE) file.
|
||||
|
||||
## DEVELOPER TERMS
|
||||
|
||||
- By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our [Data Use Policy](https://www.facebook.com/about/privacy/), including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.
|
||||
- You may limit your sharing of information with us by updating the Insights control in the developer tool `https://developers.facebook.com/apps/{app_id}/settings/advanced`.
|
||||
- If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.
|
||||
- You agree to comply with all applicable laws and regulations and also agree to our Terms <https://www.facebook.com/policies/>, including our Platform Policies <https://developers.facebook.com/policy/>.and Advertising Guidelines, as applicable <https://www.facebook.com/ad_guidelines.php>.
|
||||
- By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including
|
||||
information about people’s use of your app. Facebook will use information received in accordance with our
|
||||
[Data Use Policy](https://www.facebook.com/about/privacy/), including to provide you with insights about the
|
||||
effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on
|
||||
and off Facebook.
|
||||
- You may limit your sharing of information with us by updating the Insights control in the developer tool
|
||||
`https://developers.facebook.com/apps/{app_id}/settings/advanced`.
|
||||
- If you use a Facebook integration, including to share information with us, you agree and confirm that you have
|
||||
provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users
|
||||
regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further
|
||||
agree that you will not share information with us about children under the age of 13.
|
||||
- You agree to comply with all applicable laws and regulations and also agree to our Terms
|
||||
<https://www.facebook.com/policies/>, including our Platform Policies <https://developers.facebook.com/policy/>.and
|
||||
Advertising Guidelines, as applicable <https://www.facebook.com/ad_guidelines.php>.
|
||||
|
||||
By using the Facebook SDK for iOS you agree to these terms.
|
||||
Reference in new issue
Block a user