Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nhóm Nền tảng Google Maps thường xuyên cập nhật SDK bằng các tính năng mới, bản sửa lỗi và cải tiến hiệu suất. Trang này cung cấp hướng dẫn về cách quản lý các phần phụ thuộc trên SDK dành cho thiết bị di động.
Liên kết đến phiên bản nào?
Đối với các ứng dụng quan trọng, hãy liên kết đến bản phát hành dấu chấm mới nhất của phiên bản chính mà bạn đang sử dụng (X.*) và nâng cấp hằng năm lên phiên bản chính mới.
Khi phát hành các phiên bản mới của ứng dụng trong suốt cả năm, bạn có thể bắt đầu sử dụng các phiên bản dấu chấm mới hơn của SDK Trình điều khiển cho iOS. Việc này sẽ không yêu cầu cập nhật trong ứng dụng vì các phiên bản dấu chấm mới có khả năng tương thích ngược.
Lợi ích:
Nếu bạn phát hiện vấn đề trong SDK trình điều khiển dành cho iOS, chúng tôi sẽ cung cấp bản sửa lỗi có khả năng tương thích ngược trong 12 tháng sau khi phát hành phiên bản chính đầu tiên, theo Chính sách hỗ trợ thiết bị di động. Bạn sẽ không cần phải khẩn trương nâng cấp lên phiên bản SDK không tương thích để hưởng lợi từ các bản sửa lỗi.
Bạn có thể dễ dàng áp dụng các tính năng và điểm cải tiến mới nhất khi ứng dụng của bạn được xây dựng trên phiên bản mới nhất.
Việc cập nhật tăng dần hằng năm cho phiên bản chính mới nhất của SDK có thể giúp bạn tiết kiệm công sức thích ứng, viết lại và kiểm thử ứng dụng hơn so với việc phải xử lý các thay đổi không tương thích ngược được đưa ra trong nhiều bản phát hành phiên bản chính.
Đối với các ứng dụng không quan trọng, hãy liên kết đến bất kỳ phiên bản đã sửa lỗi nào. Khi nhận được thông báo ngừng sử dụng cho phiên bản đã sửa lỗi đó, bạn sẽ có 12 tháng để cung cấp mã ứng dụng đã cập nhật cho người dùng.
Lợi ích:
Ít phải bảo trì hơn.
Các phiên bản mới của ứng dụng sẽ tiếp tục hỗ trợ các thiết bị của người dùng chạy hệ điều hành di động cũ trong thời gian dài hơn (cho đến khi bạn cần nâng cấp lên phiên bản SDK mới).
Chủ sở hữu dự án có địa chỉ email được giám sát sẽ nhận được thông báo chủ động về những thay đổi ảnh hưởng đến từng dự án của họ. Luôn cập nhật về các bản cập nhật lớn, tính năng ngừng hoạt động và các thay đổi khác.
Cài đặt
Luôn chỉ định số phiên bản trong các phần phụ thuộc thay vì sử dụng toán tử lạc quan (~>) vì điều đó có thể dẫn đến các bản dựng không thể lặp lại và không thể dự đoán. SDK trình điều khiển cho iOS tuân thủ tính năng phiên bản ngữ nghĩa và các bản phát hành phiên bản chính mới bao gồm các thay đổi có thể gây lỗi.
CocoaPods
Ví dụ về phần phụ thuộc Podfile sử dụng cú pháp Podfile:
source "https://github.com/CocoaPods/Specs.git"
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'GoogleRidesharingDriver', '2.0.0'
end
Trình quản lý gói Swift
Bạn có thể cài đặt SDK trình điều khiển thông qua
Trình quản lý gói Swift. Để thêm SDK, hãy đảm bảo bạn đã xoá mọi phần phụ thuộc SDK Trình điều khiển hiện có.
Để thêm SDK vào một dự án mới hoặc hiện có, hãy làm theo các bước sau:
Mở project hoặc workspace Xcode, sau đó chuyển đến File (Tệp) > Add Package Dependencies (Thêm phần phụ thuộc gói).
Để cài đặt một version cụ thể, hãy đặt trường Dependency Rule (Quy tắc phần phụ thuộc) thành một trong các tuỳ chọn dựa trên phiên bản. Đối với các dự án mới, bạn nên chỉ định phiên bản mới nhất và sử dụng tuỳ chọn "Phiên bản chính xác". Sau khi hoàn tất, hãy nhấp vào "Thêm gói".
Để cập nhật package cho một dự án hiện có, hãy làm theo các bước sau:
Để xác minh quá trình cài đặt, hãy chuyển đến phần Package Dependencies (Phần phụ thuộc gói) của Project Navigator (Trình điều hướng dự án) để xác minh gói và phiên bản của gói.
Bảo trì và nâng cấp
Để xây dựng bằng các điểm cải tiến mới nhất, hãy thường xuyên kiểm tra các phiên bản mới hơn và cập nhật thông số kỹ thuật của phiên bản. Nếu bạn đang cập nhật lên một phiên bản chính mới, hãy kiểm tra ghi chú phát hành để biết các thay đổi không tương thích ngược và cách cập nhật mã.
Cocoapods
Mở cửa sổ dòng lệnh rồi chuyển đến thư mục chứa Podfile:
cd <path-to-project>
Chạy pod outdated để xem có phiên bản mới hơn của SDK trình điều khiển cho iOS hay không.
Nếu tìm thấy phiên bản SDK mới hơn, hãy cập nhật Podfile bằng phiên bản mới này.
Hãy xem phần Chỉ định phiên bản pod để tìm hiểu cách đặt một phiên bản cụ thể trong Podfile.
Chạy pod update.
Thực hiện mọi thay đổi cần thiết sau khi nâng cấp. Hãy xem Ghi chú phát hành để biết danh sách các thay đổi trong từng bản phát hành.
Dọn sạch và tạo lại dự án bằng cách chọn Product > Clean (Sản phẩm > Dọn sạch) rồi chọn Product > Build (Sản phẩm > Tạo)
Ngoài việc thăm dò ý kiến về các phiên bản mới hơn, chủ sở hữu dự án trên Google Cloud còn nhận được email về những thay đổi không tương thích ngược có thể ảnh hưởng đến dự án của họ. Để nhận thông báo chủ động về các thay đổi không tương thích ngược, hãy chỉ định vai trò chủ sở hữu bằng một địa chỉ email được theo dõi cho mỗi dự án của bạn.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThe Google Maps Platform team provides regular updates to the Driver SDK for iOS, including new features, bug fixes, and performance improvements.\u003c/p\u003e\n"],["\u003cp\u003eMission-critical apps should link to the latest dot release within their major version and upgrade yearly for optimal support and features.\u003c/p\u003e\n"],["\u003cp\u003eNon-critical apps have more flexibility in versioning, linking to fixed releases with a 12-month deprecation notice period for easier maintenance.\u003c/p\u003e\n"],["\u003cp\u003eYou should always specify a version number instead of optimistic operators for predictable and repeatable builds when including the SDK as a dependency.\u003c/p\u003e\n"],["\u003cp\u003eRegularly check for newer SDK versions and update your dependencies to benefit from the latest improvements and bug fixes, consulting release notes for any necessary code adjustments during major version upgrades.\u003c/p\u003e\n"]]],["Google Maps Platform SDK management involves linking to specific versions for mission-critical or non-critical apps. Mission-critical apps should use the latest dot release and upgrade annually. Non-critical apps can use any fixed version, with 12 months to update upon deprecation. Installation options include CocoaPods and Swift Package Manager, always specifying a fixed version number. Regularly check for updates, and for major versions, consult release notes for breaking changes. Project owners receive emails about impactful changes.\n"],null,["# Driver SDK for iOS versions\n\nThe Google Maps Platform team regularly updates SDKs with new features, bug fixes, and\nperformance improvements. This page provides guidance on how to manage your dependencies\non mobile SDKs.\n\nWhich version to link to?\n-------------------------\n\n- **For mission-critical apps**, link to the latest dot release of the major\n version that you are using (X.\\*), and upgrade yearly to the new major version.\n\n As you release new versions of your application\n throughout the year, you may start using newer dot versions of the Driver SDK for iOS. This will\n not require updates in your application as new dot versions are backward compatible.\n\n **Benefits:**\n - If you discover issues in the Driver SDK for iOS, fixes will be provided in a backward-compatible way for 12 months after the initial release of the major version, per the [Mobile support\n policy](https://developers.google.com/maps/software-support#sdk-support). You will not need to urgently upgrade to an *incompatible* SDK version to benefit from fixes.\n - The latest improvements and features are easy to adopt when your app is already built on the latest version.\n - Annual incremental updates to the newest major version of the SDK may require less work to adapt, rewrite, and test your application, than having to handle backwards-incompatible changes introduced across multiple major version releases.\n\n \u003cbr /\u003e\n\n- **For non-critical apps**, link to any fixed version. When you receive a deprecation\n notice for that fixed version, you will have 12 months to make your updated app code available to\n your users.\n\n **Benefits:**\n - Less frequent maintenance work.\n - New versions of your app keep supporting users' devices running older mobile operating systems for longer (until you need to upgrade to a new SDK version).\n\n \u003cbr /\u003e\n\nProject Owners with monitored email addresses receive proactive notifications about changes that\nimpact each of their projects. [Stay\ninformed](https://developers.google.com/maps/support#staying_informed) about major updates, deprecations, and other changes.\n\nInstallation\n------------\n\n\u003cbr /\u003e\n\nAlways specify a version number in your dependencies instead of using an\noptimistic operator (`~\u003e`) since that can lead to unpredictable and\nunrepeatable builds. The Driver SDK for iOS adheres to\n[semantic versioning](https://semver.org), and new major version releases\ninclude breaking changes.\n**Note:** Driver SDK for iOS does not support installation using Carthage. \n\n### CocoaPods\n\nAn example Podfile dependency using [Podfile](https://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions) syntax: \n\n```scdoc\n source \"https://github.com/CocoaPods/Specs.git\"\n\n target 'YOUR_APPLICATION_TARGET_NAME_HERE' do\n pod 'GoogleRidesharingDriver', '2.0.0'\n end\n \n```\n\n### Swift Package Manager\n\n\nThe Driver SDK can be installed via [Swift Package Manager](https://developer.apple.com/documentation/xcode/swift-packages). To add the SDK, ensure you have\nremoved any existing Driver SDK dependencies.\n\n| Important: These instructions assume the use of Xcode 15 or later, but should be similar for previous versions of Xcode.\n\n\u003cbr /\u003e\n\n\nTo add the SDK to a new or existing project, follow these steps:\n\n1. Open your Xcode `project` or `workspace`, then go to **File \\\u003e Add Package Dependencies**.\n2. Enter \u003chttps://github.com/googlemaps/ios-driver-sdk\u003e as the URL, press **Enter** to pull in the package, and click \"Add Package\".\n3. To install a specific `version`, set the **Dependency Rule** field to one of the version-based options. For new projects, we recommend specifying the latest version and using the \"Exact Version\" option. Once complete, click \"Add Package\".\n\nTo update the `package` for an existing project, follow these steps:\n\n1. To verify your installation, go to the **Package Dependencies** section of **Project Navigator** to verify the package and its version.\n\n| **Important:** Sometimes, artifacts cannot be resolved or errors can occur, in this case select \"File \\\u003e Packages \\\u003e Reset Package Cache\".\n\n\u003cbr /\u003e\n\nMaintenance and upgrade\n-----------------------\n\nTo build with the latest improvements, regularly check for newer versions and\nupdate your version specifications. If you are updating to a new major version,\ncheck the\n[release notes](/maps/documentation/mobility/services/resources/relnotes_driver_sdk_ios)\nfor backwards-incompatible changes and how to update your code. \n\n### Cocoapods\n\n1. Open a terminal and go to the directory containing the `Podfile`:\n\n ```text\n cd \u003cpath-to-project\u003e\n ```\n2. Run `pod outdated` to see if a newer version of the Driver SDK for iOS is available.\n3. If a newer version of the SDK is found, update your `Podfile` with this new version. See [Specifying pod versions](https://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions) to learn how to set a specific version in your `Podfile`.\n4. Run `pod update`.\n5. Make any necessary changes as a result of the upgrade. See the [Release Notes](/maps/documentation/mobility/driver-sdk/scheduled/ios/releases) for a list of the changes in each release.\n6. Clean and rebuild your project by selecting **Product \\\u003e Clean** and then **Product \\\u003e Build**\n\n### Manual installation\n\n\n[Get the link to the latest source files](/maps/documentation/mobility/driver-sdk/scheduled/ios/minimum-requirements#manual-installation)\nat Installing the SDK.\n\nIn addition to polling for newer versions, Google Cloud\n[project\nowners](https://cloud.google.com/iam/docs/understanding-roles#basic-definitions) receive emails about backwards incompatible changes that may affect their projects. To\nget proactive notification about backwards incompatible changes,\n[assign\nthe owner role](https://cloud.google.com/iam/docs/granting-changing-revoking-access) with a monitored email address for each of your projects."]]