הצוות של Google Maps Platform מעדכן באופן קבוע את ערכות ה-SDK עם תכונות חדשות, תיקוני באגים ושיפורים בביצועים. בדף הזה מוסבר איך לנהל את התלות שלכם בערכות SDK לנייד.
לאיזו גרסה לקשר?
באפליקציות חיוניות, כדאי לקשר לגרסת הנקודה האחרונה של הגרסה הראשית שבה אתם משתמשים (X.*), ולשדרג מדי שנה לגרסה הראשית החדשה.
במהלך השנה, כשמפרסמים גרסאות חדשות של האפליקציה, יכול להיות שתתחילו להשתמש בגרסאות חדשות יותר של ה-SDK של מפות Google ל-iOS. לא יהיה צורך לבצע עדכונים באפליקציה כי גרסאות נקודה חדשות תואמות לאחור.
יתרונות:
אם תגלו בעיות ב-Maps SDK ל-iOS, נספק תיקונים באופן שתהיה תאימות לאחור למשך 12 חודשים אחרי ההשקה הראשונית של הגרסה הראשית, בהתאם למדיניות התמיכה בנייד. לא תצטרכו לשדרג בדחיפות לגרסת SDK לא תואמת כדי ליהנות מתיקונים.
אם האפליקציה כבר מבוססת על הגרסה האחרונה, קל יותר להטמיע את השיפורים והתכונות החדשים.
יכול להיות שעדכונים מצטברים שנתיים לגרסה העיקרית החדשה ביותר של ה-SDK ידרוש פחות עבודה בהתאמה, בכתיבה מחדש ובבדיקה של האפליקציה, מאשר טיפול בשינויים שאינם תואמים לאחור שמוצגים בכמה גרסאות עיקריות.
לאפליקציות לא קריטיות, מקשרים לכל גרסה קבועה. כשמקבלים הודעה על הוצאה משימוש של הגרסה הקבועה, יש 12 חודשים להפוך את קוד האפליקציה המעודכן לזמין למשתמשים.
יתרונות:
עבודות תחזוקה בתדירות נמוכה יותר.
גרסאות חדשות של האפליקציה ממשיכות לתמוך במכשירים של משתמשים שפועלות בהם מערכות הפעלה ישנות יותר לנייד למשך זמן ארוך יותר (עד שתצטרכו לשדרג לגרסה חדשה של ה-SDK).
בעלי פרויקטים עם כתובות אימייל במעקב מקבלים התראות יזומות על שינויים שמשפיעים על כל אחד מהפרויקטים שלהם. כדאי להתעדכן לגבי עדכונים חשובים, הוצאה משימוש ושינויים אחרים.
התקנה
Swift Package Manager
אפשר להתקין את Maps SDK ל-iOS דרך
Swift Package Manager. כדי להוסיף את ה-SDK, צריך לוודא שהסרתם את כל יחסי התלות הקיימים של Maps SDK ל-iOS.
כדי להוסיף את ה-SDK לפרויקט חדש או קיים, פועלים לפי השלבים הבאים:
פותחים את Xcode project או workspace, ואז עוברים אל File > Add Package Dependencies (קובץ > הוספת תלות בחבילה).
כדי להתקין version ספציפי, מגדירים את השדה Dependency Rule (כלל תלות) לאחת מהאפשרויות שמבוססות על גרסה. בפרויקטים חדשים, מומלץ לציין את הגרסה העדכנית ולהשתמש באפשרות 'גרסה מדויקת'. לסיום, לוחצים על 'הוספת חבילה'.
כדי לעדכן את package של פרויקט קיים, פועלים לפי השלבים הבאים:
אם אתם משדרגים מגרסה מוקדמת יותר מ-9.0.0, אתם צריכים להסיר את התלות הבאה: GoogleMapsBase, GoogleMapsCore ו-GoogleMapsM4B אחרי השדרוג. אין להסיר את התלות של
GoogleMaps. מידע נוסף זמין בהערות המוצר של גרסה 9.0.0.
בהגדרות התצורה של פרויקט Xcode, מחפשים את Frameworks, Libraries,
and Embedded Content (מסגרות, ספריות ותוכן מוטמע). משתמשים בסימן המינוס(-) כדי להסיר את המסגרת הבאה:
GoogleMapsBase (רק לשדרוגים מגרסאות מוקדמות יותר מ-9.0.0)
GoogleMapsCore (רק לשדרוגים מגרסאות מוקדמות יותר מ-9.0.0)
GoogleMapsM4B (רק לשדרוגים מגרסאות מוקדמות יותר מ-9.0.0)
ב-Xcode, עוברים אל File (קובץ) > Packages (חבילות) > Update To Latest Package Versions (עדכון לגרסאות החבילה העדכניות ביותר).
כדי לאמת את ההתקנה, עוברים לקטע Package Dependencies (תלות בחבילה) בProject Navigator (סייר הפרויקטים)
כדי לאמת את החבילה ואת הגרסה שלה.
כדי להסיר יחסי תלות קיימים ב-SDK של מפות ל-iOS שנוספו באמצעות
CocoaPods, פועלים לפי השלבים הבאים:
סוגרים את סביבת העבודה של Xcode. פותחים את הטרמינל ומריצים את הפקודה הבאה:
מסירים את Podfile, Podfile.resolved ואת
Xcode workspace אם אתם לא משתמשים בהם לשום דבר אחר מלבד CocoaPods.
CocoaPods
תמיד צריך לציין מספר גרסה בתלות במקום להשתמש באופרטור אופטימי (~>), כי זה עלול להוביל לבנייה בלתי צפויה ולא עקבית. Maps SDK ל-iOS פועל לפי גרסאות סמנטיות, והשקות של גרסאות ראשיות חדשות כוללות שינויים שעלולים לשבור את התאימות לאחור.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '16.0'
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'GoogleMaps', '10.2.0'
end
תחזוקה ושדרוג
כדי ליהנות מהשיפורים האחרונים, כדאי לבדוק באופן קבוע אם יש גרסאות חדשות יותר ולעדכן את מפרטי הגרסה. אם אתם מעדכנים לגרסה ראשית חדשה, כדאי לעיין בהערות המוצר כדי לראות אילו שינויים לא תואמים לאחור ואיך לעדכן את הקוד.
בנוסף לבדיקה של גרסאות חדשות יותר, בעלי פרויקטים ב-Google Cloud מקבלים אימיילים לגבי שינויים שלא תואמים לאחור, שיכול להיות שישפיעו על הפרויקטים שלהם. כדי לקבל התראה יזומה על שינויים שלא תואמים לאחור, צריך להקצות את תפקיד הבעלים עם כתובת אימייל במעקב לכל אחד מהפרויקטים.
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[[["\u003cp\u003eFor critical applications, link to the latest dot release of the major Google Maps SDK for iOS version and upgrade to the new major version annually to ensure access to bug fixes and new features.\u003c/p\u003e\n"],["\u003cp\u003eNon-critical applications can link to any fixed version, allowing for less frequent maintenance, but requiring an update within 12 months of receiving a deprecation notice.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Maps SDK for iOS can be installed via Swift Package Manager or CocoaPods; detailed instructions for both methods, along with version management guidance, are provided.\u003c/p\u003e\n"],["\u003cp\u003eRegular updates to the SDK are recommended, with release notes available to guide developers through any necessary code changes for compatibility.\u003c/p\u003e\n"],["\u003cp\u003eProject owners with monitored email addresses receive notifications about significant updates and changes, helping to ensure their applications remain up-to-date.\u003c/p\u003e\n"]]],["For app development using Google Maps SDK for iOS, link to the latest dot release for mission-critical apps and upgrade yearly, or use any fixed version for non-critical apps. To install, use Swift Package Manager or CocoaPods, adding the SDK via Xcode or specifying the version in your Podfile. Updating involves checking for newer versions, adjusting your Podfile or updating the package in Xcode. Always review release notes for compatibility and utilize provided links for the latest SDK information.\n"],null,["Select platform: [Android](/maps/documentation/android-sdk/versions \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/versions \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/versions \"View this page for the JavaScript platform docs.\")\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- **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 Maps 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 Maps 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\nSwift Package Manager\n\n\nThe Maps SDK for iOS 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 Maps SDK for iOS 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-maps-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. **If you are upgrading from a version earlier than 9.0.0,** you must remove\n the following dependencies: `GoogleMapsBase`, `GoogleMapsCore`, and\n `GoogleMapsM4B` after upgrading. Do not remove the dependency for\n `GoogleMaps`. For more information, see the\n [Version 9.0.0 Release Notes](/maps/documentation/ios-sdk/release-notes#May_20_2024).\n\n From your Xcode project configuration settings, find **Frameworks, Libraries,\n and Embedded Content** . Use the **minus sign(-)** to remove the following framework:\n - `GoogleMapsBase` (Only for upgrades from versions earlier than 9.0.0)\n - `GoogleMapsCore` (Only for upgrades from versions earlier than 9.0.0)\n - `GoogleMapsM4B` (Only for upgrades from versions earlier than 9.0.0)\n2. From Xcode, go to \"File \\\u003e Packages \\\u003e Update To Latest Package Versions\".\n3. 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\n\nTo remove existing Maps SDK for iOS dependencies added using\n`CocoaPods`, follow these steps:\n\n1. Close your Xcode workspace. Open terminal and execute the following command: \n\n ```swift\n sudo gem install cocoapods-deintegrate cocoapods-clean\n pod deintegrate\n pod cache clean --all\n ```\n2. Remove the `Podfile`, `Podfile.resolved` and the Xcode `workspace` if you are not using them for anything other than CocoaPods.\n\nCocoaPods\n\nAlways specify a version number in your dependencies instead of using an optimistic operator\n(`~\u003e`) since that can lead to unpredictable and unrepeatable builds. The\nMaps SDK for iOS adheres to [semantic versioning](https://semver.org),\nand new major version releases include breaking changes.\n\nAn example Podfile dependency using\n[Podfile](https://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions) syntax: \n\n```scdoc\nsource 'https://github.com/CocoaPods/Specs.git'\n\nplatform :ios, '16.0'\n\ntarget 'YOUR_APPLICATION_TARGET_NAME_HERE' do\n pod 'GoogleMaps', '10.2.0'\nend\n```\n\nMaintenance and upgrade\n\nTo build with the latest improvements, regularly check for newer versions and update your version\nspecifications. If you are updating to a new major version, check the\n[release notes](/maps/documentation/ios-sdk/releases) for backwards-incompatible changes and how to update your code.\n\nSwift Package Manager\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\nCocoapods\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 Maps 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/ios-sdk/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\nManual installation\n\n[Get the link to the latest source files](/maps/documentation/ios-sdk/start#download-sdk)\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."]]