谷歌地图没有在flutter中加载到IOS设备中,但它在安卓设备中正确显示。我使用的是google_maps_flutter 0.5.24+1软件包
我的ios/Runner/AppDelegate.swift代码:
import UIKit
import Flutter
import GoogleMaps
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GMSServices.provideAPIKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
//(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
}
我已经根据文档更改了Info.plist:
<key>io.flutter.embedded_views_preview</key>
<true/>
注意:我在API中没有启用任何限制并且在控制台中没有错误
如果有人面临这个问题,请给出解决方案。感谢
iOS方面似乎存在一些配置问题,
请从软件包自述文件中仔细检查iOS配置。
请确保您还在谷歌开发者控制台的Additional APIs
部分中启用了Maps SDK for iOS
。