Browse Source

ComPDFKit(flutter) - 1. readme.md的iOS的修改

yangliuhua 1 year ago
parent
commit
77cf8f7a34

+ 26 - 4
README.md

@@ -237,7 +237,7 @@ class _MyAppState extends State<MyApp> {
 flutter run
 ```
 
-#### 2.2.2 IOS
+#### 2.2.2 iOS
 
 1. Create a Flutter project called `example` with the `flutter` CLI:
 
@@ -276,7 +276,7 @@ open ios/Podfile
 
 ```diff
 - platform :ios, '9.0'
-+ platform :ios, '11.0' 
++ platform :ios, '10.0' 
  ...
  target 'Runner' do
    use_frameworks!
@@ -371,13 +371,35 @@ class _MyAppState extends State<MyApp> {
 +    - pdfs/
 ```
 
-11. Start your Android emulator, or connect a device.
+11. To protect user privacy,
+
+    To protect user privacy, before accessing the sensitive privacy data, you need to find the "***Info\***" configuration in your iOS 10.0 or higher iOS project and configure the relevant privacy terms as shown in the following picture.
+
+    ![](screenshots/1-8.png)
+
+    ```objective-c
+    <key>NSCameraUsageDescription</key>
+    <string>Your consent is required before you could access the function.</string>
+    
+    <key>NSMicrophoneUsageDescription</key>
+    <string>Your consent is required before you could access the function.</string>
+    
+    <key>NSPhotoLibraryAddUsageDescription</key>
+    <string>Your consent is required before you could access the function.</string>
+    
+    <key>NSPhotoLibraryUsageDescription</key>
+    <string>Your consent is required before you could access the function.</string>
+    ```
+
+    
+
+12. Start your Android emulator, or connect a device.
 
 ```bash
 flutter emulators --launch apple_ios_simulator
 ```
 
-12. Run the app with:
+13. Run the app with:
 
 ```bash
 flutter run

+ 18 - 0
example/ios/Runner.xcodeproj/project.pbxproj

@@ -198,6 +198,7 @@
 				97C146EC1CF9000F007C117D /* Resources */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
 				88AA2C2CA9E762CFA665D633 /* [CP] Embed Pods Frameworks */,
+				57BE941E48C1B3014E79E3A6 /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
 			);
@@ -284,6 +285,23 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
 		};
+		57BE941E48C1B3014E79E3A6 /* [CP] Copy Pods Resources */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
+			);
+			name = "[CP] Copy Pods Resources";
+			outputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+			showEnvVarsInLog = 0;
+		};
 		83EE13E06F8D899BA2AB6AF5 /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;

+ 0 - 4
ios/Classes/CompdfkitFlutterPlugin.m

@@ -14,10 +14,6 @@
   CompdfkitFlutterPlugin* instance = [[CompdfkitFlutterPlugin alloc] init];
 
   [registrar addMethodCallDelegate:instance channel:channel];
-    
-  FLNativeViewFactory* factory =
-  [[FLNativeViewFactory alloc] initWithMessenger:registrar.messenger];
-    [registrar registerViewFactory:factory withId:@"com.compdfkit.flutter.pdfviewer"];
 }
 
 - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {

BIN
screenshots/1-8.png