[google_maps_flutter] Fix UIKit availability and pod lint warnings (#2681)
diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md
index 36d22be..5b3e350 100644
--- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md
+++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.5.26+2
+
+* Fix UIKit availability warnings and CocoaPods podspec lint warnings.
+
## 0.5.26+1
* Removes a errorneously added method from the GoogleMapController.h header file.
diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapController.m
index 76e8619..59bfaa0 100644
--- a/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapController.m
+++ b/packages/google_maps_flutter/google_maps_flutter/ios/Classes/GoogleMapController.m
@@ -172,20 +172,25 @@
} else if ([call.method isEqualToString:@"map#waitForMap"]) {
result(nil);
} else if ([call.method isEqualToString:@"map#takeSnapshot"]) {
- if (_mapView != nil) {
- UIGraphicsImageRendererFormat* format = [UIGraphicsImageRendererFormat defaultFormat];
- format.scale = [[UIScreen mainScreen] scale];
- UIGraphicsImageRenderer* renderer =
- [[UIGraphicsImageRenderer alloc] initWithSize:_mapView.frame.size format:format];
+ if (@available(iOS 10.0, *)) {
+ if (_mapView != nil) {
+ UIGraphicsImageRendererFormat* format = [UIGraphicsImageRendererFormat defaultFormat];
+ format.scale = [[UIScreen mainScreen] scale];
+ UIGraphicsImageRenderer* renderer =
+ [[UIGraphicsImageRenderer alloc] initWithSize:_mapView.frame.size format:format];
- UIImage* image = [renderer imageWithActions:^(UIGraphicsImageRendererContext* context) {
- [_mapView.layer renderInContext:context.CGContext];
- }];
- result([FlutterStandardTypedData typedDataWithBytes:UIImagePNGRepresentation(image)]);
+ UIImage* image = [renderer imageWithActions:^(UIGraphicsImageRendererContext* context) {
+ [_mapView.layer renderInContext:context.CGContext];
+ }];
+ result([FlutterStandardTypedData typedDataWithBytes:UIImagePNGRepresentation(image)]);
+ } else {
+ result([FlutterError errorWithCode:@"GoogleMap uninitialized"
+ message:@"takeSnapshot called prior to map initialization"
+ details:nil]);
+ }
} else {
- result([FlutterError errorWithCode:@"GoogleMap uninitialized"
- message:@"takeSnapshot called prior to map initialization"
- details:nil]);
+ NSLog(@"Taking snapshots is not supported for Flutter Google Maps prior to iOS 10.");
+ result(nil);
}
} else if ([call.method isEqualToString:@"markers#update"]) {
id markersToAdd = call.arguments[@"markersToAdd"];
diff --git a/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec b/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec
index c8fb83b..9a1f04d 100644
--- a/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec
+++ b/packages/google_maps_flutter/google_maps_flutter/ios/google_maps_flutter.podspec
@@ -4,14 +4,16 @@
Pod::Spec.new do |s|
s.name = 'google_maps_flutter'
s.version = '0.0.1'
- s.summary = 'A new flutter plugin project.'
+ s.summary = 'Google Maps for Flutter'
s.description = <<-DESC
-A new flutter plugin project.
+A Flutter plugin that provides a Google Maps widget.
+Downloaded by pub (not CocoaPods).
DESC
- s.homepage = 'http://example.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'Your Company' => 'email@example.com' }
- s.source = { :path => '.' }
+ s.homepage = 'https://github.com/flutter/plugins'
+ s.license = { :type => 'BSD', :file => '../LICENSE' }
+ s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
+ s.source = { :http => 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter' }
+ s.documentation_url = 'https://pub.dev/packages/google_maps_flutter'
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml
index 93017b4..3d5f7b5 100644
--- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml
+++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml
@@ -1,7 +1,7 @@
name: google_maps_flutter
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter
-version: 0.5.26+1
+version: 0.5.26+2
dependencies:
flutter: