Skip to content

Commit 61083da

Browse files
authored
Merge pull request #42 from PSPDFKit/rad/ios-v9.0
Update for PSPDFKit 9 for iOS
2 parents 7311adb + a6a095b commit 61083da

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,5 @@ unlinked_spec.ds
8585
!**/ios/**/default.mode2v3
8686
!**/ios/**/default.pbxuser
8787
!**/ios/**/default.perspectivev3
88-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
88+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
89+
/example/ios/Flutter/flutter_export_environment.sh

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,23 +233,26 @@ adb push /path/to/your/document.pdf /sdcard/document.pdf
233233

234234
![iOS View controller-based status bar appearance](screenshots/ios-info-plist-statusbarappearance.png)
235235

236-
8. Run `flutter packages get` to install the packages.
237-
9. Open the `Podfile`: `open ios/Podfile` and edit it as follows:
236+
8. If your application is targeting iOS versions **prior to iOS 12.2** and your application **does not already contain any Swift code**, then you need to make sure Xcode bundles Swift standard libraries with your application distribution. To to so, open your target Build Settings and enable `Always Embed Swift Standard Libraries`:
237+
238+
![Always Embed Swift Standard Libraries](screenshots/ios-always-embed-swift-standard-libraries.png)
239+
240+
9. Run `flutter packages get` to install the packages.
241+
10. Open the `Podfile`: `open ios/Podfile` and edit it as follows:
238242

239243
```diff
240244
# Uncomment this line to define a global platform for your project
241245
- # platform :ios, '9.0'
242246
+ platform :ios, '11.0'
243-
+ use_frameworks!
244247
...
245248
target 'Runner' do
246-
249+
use_frameworks!
247250
+ pod 'PSPDFKit', podspec:'https://customers.pspdfkit.com/cocoapods/YOUR_COCOAPODS_KEY_GOES_HERE/pspdfkit/latest.podspec'
248251
...
249252
end
250253
```
251254

252-
9. Open `lib/main.dart` and replace the whole content with a simple example that will load a PDF document from local device filesystem:
255+
11. Open `lib/main.dart` and replace the whole content with a simple example that will load a PDF document from local device filesystem:
253256

254257
```dart
255258
import 'dart:io';
@@ -353,9 +356,9 @@ class _MyAppState extends State<MyApp> {
353356
}
354357
```
355358

356-
10. In `lib/main.dart` replace `YOUR_LICENSE_KEY_GOES_HERE` with your PSPDFKit license key.
357-
11. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
358-
12. Run `flutter run`.
359+
12. In `lib/main.dart` replace `YOUR_LICENSE_KEY_GOES_HERE` with your PSPDFKit license key.
360+
13. Run `flutter emulators --launch apple_ios_simulator` to launch the iOS Simulator.
361+
14. Run `flutter run`.
359362

360363
# Example
361364

ios/Classes/PspdfkitPlugin.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
2626

2727
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
2828
if ([@"frameworkVersion" isEqualToString:call.method]) {
29-
result([@"iOS " stringByAppendingString:PSPDFKit.versionNumber]);
29+
result([@"iOS " stringByAppendingString:PSPDFKitGlobal.versionNumber]);
3030
} else if ([@"setLicenseKey" isEqualToString:call.method]) {
3131
NSString *licenseKey = call.arguments[@"licenseKey"];
32-
[PSPDFKit setLicenseKey:licenseKey];
32+
[PSPDFKitGlobal setLicenseKey:licenseKey];
3333
} else if ([@"present" isEqualToString:call.method]) {
3434
NSString *documentPath = call.arguments[@"document"];
3535
NSAssert(documentPath != nil, @"Document path may not be nil.");
406 KB
Loading

0 commit comments

Comments
 (0)