Skip to content

Commit

Permalink
Increase SharePhotoContent photos limit to 10 (#2469)
Browse files Browse the repository at this point in the history
Summary:
- [x] sign [contributor license agreement](https://code.facebook.com/cla)
- [x] I've ensured that all existing tests pass and added tests (when/where necessary)
- [ ] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary)
- [ ] I've added the proper label to this pull request (e.g. `bug` for bug fixes)

## Pull Request Details

`SLComposeViewController` has a limit of 10 images for sharing to Facebook. This PR increases the limit imposed by `FBSDKShareKit` from 6 to 10 and clarifies the comment.

Pull Request resolved: #2469

Test Plan: Updated the current tests to reflect the change.

Differential Revision: D63028650

Pulled By: yuriy-tolstoguzov

fbshipit-source-id: fa1b6cb52679e462adcb417f959626b1e113a397
  • Loading branch information
sebastiangrail authored and facebook-github-bot committed Sep 20, 2024
1 parent 08d3c96 commit b07933d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions FBSDKShareKit/FBSDKShareKit/Content/SharePhotoContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ extension SharePhotoContent: SharingContent {
// MARK: - SharingValidatable

extension SharePhotoContent: SharingValidatable {
// The number of photos that can be shared at once is restricted
private static let photosCountRange = 1 ... 6
// The number of photos that can be shared at once is restricted by SLComposeViewController
private static let photosCountRange = 1 ... 10

/// Validate that this content contains valid values
@objc(validateWithOptions:error:)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ final class SharePhotoContentTests: XCTestCase {
XCTAssertNoThrow(try content.validate(options: []))
XCTAssertEqual(validator.validateArrayArray as? [SharePhoto], content.photos, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMinCount, 1, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMaxCount, 6, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMaxCount, 10, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayName, "photos", .validationValidatesPhotos)
}

Expand All @@ -92,7 +92,7 @@ final class SharePhotoContentTests: XCTestCase {
XCTAssertThrowsError(try content.validate(options: []), .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayArray as? [SharePhoto], content.photos, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMinCount, 1, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMaxCount, 6, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayMaxCount, 10, .validationValidatesPhotos)
XCTAssertEqual(validator.validateArrayName, "photos", .validationValidatesPhotos)
}

Expand Down

0 comments on commit b07933d

Please sign in to comment.