Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[image_picker] Image picker phpicker impl #3835

Merged
merged 44 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9496772
Add PHPicker libraries and its delegate
ydag Apr 28, 2021
a4f8416
Add PHPicker implementation
ydag Apr 28, 2021
e8c128c
Refactor UIImagePickerController implementation
ydag Apr 28, 2021
0305c42
Refactor handleMethodCall function
ydag Apr 28, 2021
55cd773
Refactor showPhotoLibrary function
ydag Apr 28, 2021
1516e73
Add the limited access into the photo library
ydag Apr 28, 2021
5b64833
Add the implementation of picker function
ydag Apr 28, 2021
36b6a2a
Refactor Info.plist file
ydag Apr 28, 2021
1d2679a
Add the function to get PHAssetResult
ydag Apr 29, 2021
6566bf0
Change the image to bypass HEIC problem
ydag Apr 29, 2021
a4d2a12
Add UITest to test select photo functionality
ydag Apr 29, 2021
9ed3fcf
Add unit test for PHAssetResult
ydag Apr 29, 2021
7f81b7b
Format the codes in all files
ydag Apr 29, 2021
62bfcfd
Fix the unit test
ydag Apr 29, 2021
97311f9
Update the version
ydag Apr 29, 2021
cc7c5b1
Add the description into CHANGELOG file
ydag Apr 29, 2021
04a8452
Fix the license header
ydag Apr 30, 2021
b930c97
Remove the unnecessary if statement
ydag Apr 30, 2021
9d4c04d
Refactor PHPickerViewController to use property
ydag Apr 30, 2021
0728176
Refactor phPickerFlag state to use property
ydag Apr 30, 2021
852a828
Refactor the code to combine lines
ydag Apr 30, 2021
13e5e9d
Refactor arguments to use property
ydag Apr 30, 2021
aa8a878
Revert formatting changes
ydag Apr 30, 2021
f14c616
Fix the unit test
ydag Apr 30, 2021
7710140
Format the code
ydag Apr 30, 2021
29e5dfd
Refactor the UITest to skip lower versions
ydag May 3, 2021
a83440f
Fix the property's name
ydag May 3, 2021
97f24f8
Refactor the properties to pass them via methods
ydag May 3, 2021
6b295e0
Add the getDesiredImageQuality method
ydag May 3, 2021
f1ae1f2
Add API_AVAILABLE for limited access method
ydag May 3, 2021
30d9597
Refactor PHPickerController to use as a property
ydag May 3, 2021
89a6433
Refactor PHPicker picker method and UITest
ydag May 3, 2021
f3f84b4
Refactor the UITest
ydag May 3, 2021
6e41e86
Change the team to None in the RunnerUITestiOS14
ydag May 3, 2021
55252bf
Fix the UITest
ydag May 4, 2021
4785b7c
Refactor the method to fix dispatch
ydag May 4, 2021
202699c
Change to use self instead of weakSelf
ydag May 4, 2021
aab9714
Fix the UITest to use XCTSkip
ydag May 4, 2021
c04a4dd
Add ImagePickerClassType to use enum
ydag May 5, 2021
615e5a6
Remove unused method
ydag May 5, 2021
362bede
Fix property to change copy to strong
ydag May 6, 2021
4d753d3
Refactor enum
ydag May 6, 2021
049c365
Change argument call
ydag May 6, 2021
0812f61
Add checkPhotoAuthorizationForAccessLevel method
ydag May 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.7.5

* Fixes an issue where image rotation is wrong when Select Photos chose and image is scaled.
* Breaking Changes:
* Migrate to PHPicker for iOS 14 and higher versions to pick image from the photo library.
* Implement the limited permission to pick photo from the photo library when Select Photo is chose.

## 0.7.4

* Update flutter_plugin_android_lifecycle dependency to 2.0.1 to fix an R8 issue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
5C9513011EC38BD300040975 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9513001EC38BD300040975 /* GeneratedPluginRegistrant.m */; };
680049262280D736006DD6AB /* MetaDataUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 680049252280D736006DD6AB /* MetaDataUtilTests.m */; };
680049272280D79A006DD6AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
680049382280F2B9006DD6AB /* pngImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 680049352280F2B8006DD6AB /* pngImage.png */; };
680049392280F2B9006DD6AB /* jpgImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 680049362280F2B8006DD6AB /* jpgImage.jpg */; };
6801C8392555D726009DAF8D /* ImagePickerFromGalleryUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6801C8382555D726009DAF8D /* ImagePickerFromGalleryUITests.m */; };
Expand All @@ -23,6 +22,7 @@
9FC8F0E9229FA49E00C8D58F /* gifImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9FC8F0E8229FA49E00C8D58F /* gifImage.gif */; };
9FC8F0EC229FA68500C8D58F /* gifImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9FC8F0E8229FA49E00C8D58F /* gifImage.gif */; };
9FC8F0EE229FB90B00C8D58F /* ImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FC8F0ED229FB90B00C8D58F /* ImageUtilTests.m */; };
BE7AEE7926403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7AEE7826403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m */; };
F4F7A436CCA4BF276270A3AE /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EC32F6993F4529982D9519F1 /* libPods-Runner.a */; };
F78AF3192342D9D7008449C7 /* ImagePickerTestImages.m in Sources */ = {isa = PBXBuildFile; fileRef = F78AF3182342D9D7008449C7 /* ImagePickerTestImages.m */; };
/* End PBXBuildFile section */
Expand All @@ -35,6 +35,13 @@
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
BE7AEE7126403C46006181AA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -80,6 +87,9 @@
9FC8F0E8229FA49E00C8D58F /* gifImage.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = gifImage.gif; sourceTree = "<group>"; };
9FC8F0ED229FB90B00C8D58F /* ImageUtilTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ImageUtilTests.m; path = ../../../ios/Tests/ImageUtilTests.m; sourceTree = "<group>"; };
A908FAEEA2A9B26D903C09C5 /* libPods-RunnerUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITestiOS14.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
BE7AEE7026403C46006181AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BE7AEE7826403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImagePickerFromLimitedGalleryUITests.m; sourceTree = "<group>"; };
EC32F6993F4529982D9519F1 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F78AF3172342D9D7008449C7 /* ImagePickerTestImages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ImagePickerTestImages.h; path = ../../../ios/Tests/ImagePickerTestImages.h; sourceTree = "<group>"; };
F78AF3182342D9D7008449C7 /* ImagePickerTestImages.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ImagePickerTestImages.m; path = ../../../ios/Tests/ImagePickerTestImages.m; sourceTree = "<group>"; };
Expand All @@ -90,7 +100,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F10E2DB84567A50A8721C9C7 /* libPods-RunnerUITests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -102,6 +111,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
BE7AEE6926403C46006181AA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand Down Expand Up @@ -159,6 +175,7 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
6801C8372555D726009DAF8D /* RunnerUITests */,
BE7AEE6D26403C46006181AA /* RunnerUITestiOS14 */,
97C146EF1CF9000F007C117D /* Products */,
840012C8B5EDBCF56B0E4AC1 /* Pods */,
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
Expand All @@ -170,6 +187,7 @@
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
6801C8362555D726009DAF8D /* RunnerUITests.xctest */,
BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -198,6 +216,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
BE7AEE6D26403C46006181AA /* RunnerUITestiOS14 */ = {
isa = PBXGroup;
children = (
BE7AEE7826403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m */,
BE7AEE7026403C46006181AA /* Info.plist */,
);
path = RunnerUITestiOS14;
sourceTree = "<group>";
};
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -250,6 +277,24 @@
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
BE7AEE6B26403C46006181AA /* RunnerUITestiOS14 */ = {
isa = PBXNativeTarget;
buildConfigurationList = BE7AEE7526403C46006181AA /* Build configuration list for PBXNativeTarget "RunnerUITestiOS14" */;
buildPhases = (
BE7AEE6826403C46006181AA /* Sources */,
BE7AEE6926403C46006181AA /* Frameworks */,
BE7AEE6A26403C46006181AA /* Resources */,
);
buildRules = (
);
dependencies = (
BE7AEE7226403C46006181AA /* PBXTargetDependency */,
);
name = RunnerUITestiOS14;
productName = RunnerUITestiOS14;
productReference = BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -273,6 +318,11 @@
};
};
};
BE7AEE6B26403C46006181AA = {
CreatedOnToolsVersion = 12.4;
ProvisioningStyle = Automatic;
TestTargetID = 97C146ED1CF9000F007C117D;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
Expand All @@ -290,6 +340,7 @@
targets = (
97C146ED1CF9000F007C117D /* Runner */,
6801C8352555D726009DAF8D /* RunnerUITests */,
BE7AEE6B26403C46006181AA /* RunnerUITestiOS14 */,
);
};
/* End PBXProject section */
Expand All @@ -316,6 +367,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
BE7AEE6A26403C46006181AA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -413,6 +471,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
BE7AEE6826403C46006181AA /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE7AEE7926403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand All @@ -421,6 +487,11 @@
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = 6801C83B2555D726009DAF8D /* PBXContainerItemProxy */;
};
BE7AEE7226403C46006181AA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = BE7AEE7126403C46006181AA /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -642,6 +713,53 @@
};
name = Release;
};
BE7AEE7326403C46006181AA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = RunnerUITestiOS14/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I guess this is the trick to not let the test run on ios 13 and below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think. Because it seems the target should be different and we can implement it by defining new one.

LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.baseflow.RunnerUITestiOS14;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Runner;
};
name = Debug;
};
BE7AEE7426403C46006181AA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NHAKRD9N7D;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = RunnerUITestiOS14/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.baseflow.RunnerUITestiOS14;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Runner;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -672,6 +790,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BE7AEE7526403C46006181AA /* Build configuration list for PBXNativeTarget "RunnerUITestiOS14" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE7AEE7326403C46006181AA /* Debug */,
BE7AEE7426403C46006181AA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -47,6 +47,16 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BE7AEE6B26403C46006181AA"
BuildableName = "RunnerUITestiOS14.xctest"
BlueprintName = "RunnerUITestiOS14"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Loading