لمتابعة الرحلات عند الطلب في تطبيقات المستهلكين على iOS، استخدِم حزمة Consumer SDK. لمزيد من المعلومات حول ميزة "متابعة الرحلات" والتعرّف عليها، يُرجى الاطّلاع على متابعة رحلة في iOS.
لإعداد حزمة تطوير البرامج (SDK) المخصّصة للمستهلكين لتطبيق المستهلكين على iOS، اتّبِع الخطوات التالية:
الحصول على حزمة تطوير البرامج (SDK) الخاصة بالمستهلك
يمكنك تثبيت حزمة Consumer SDK وإعدادها باستخدام CocoaPods.
Swift Package Manager
يمكن تثبيت حزمة تطوير البرامج (SDK) الخاصة بالمستهلكين من خلال
Swift Package Manager. لإضافة حزمة SDK، تأكَّد من إزالة أي ملحقات حالية لحزمة Consumer SDK.
لإضافة حزمة تطوير البرامج إلى مشروع جديد أو حالي، اتّبِع الخطوات التالية:
افتح Xcode project أو workspace، ثم انتقِل إلى ملف > إضافة تبعيات الحزمة (File > Add Package Dependencies).
لتثبيت version معيّن، اضبط الحقل قاعدة التبعية على أحد الخيارات المستندة إلى الإصدار. بالنسبة إلى المشاريع الجديدة، ننصحك بتحديد أحدث إصدار واستخدام الخيار "الإصدار الدقيق". بعد إتمام الخطوة السابقة، انقر على "إضافة حزمة".
إنشاء ملف Podfile لحزمة Consumer SDK: يمكنك استخدام ملف Podfile لتثبيت واجهة برمجة التطبيقات والعناصر التابعة لها.
أنشئ ملفًا باسم Podfile في دليل مشروعك. يحدد هذا الملف التبعيات الخاصة بمشروعك.
عدِّل ملف Podfile وأضِف التبعيات. في ما يلي مثال يتضمّن التبعيات:
source"https://github.com/CocoaPods/Specs.git"
target'YOUR_APPLICATION_TARGET_NAME_HERE'dopod'GoogleRidesharingConsumer'
end
احفظ ملف Podfile: افتح نافذة طرفية وانتقِل إلى المجلد الذي يحتوي على ملف Podfile:
cd<path-to-project>
شغِّل الأمر pod install: يثبِّت هذا الأمر واجهات برمجة التطبيقات المحدّدة في ملف Podfile، بالإضافة إلى أي تبعيات قد تكون مرتبطة بها.
podinstall
افتح مشروعك في Xcode: أغلِق Xcode ثم افتح (انقر نقرًا مزدوجًا) ملف xcworkspace الخاص بمشروعك لتشغيل Xcode. لفتح المشروع
لاحقًا، استخدِم ملف xcworkspace.
التثبيت اليدوي
يوضّح هذا الدليل كيفية إضافة XCFramework التي تحتوي على حزمة تطوير البرامج (SDK) الخاصة بالمستهلك إلى مشروعك يدويًا، وكيفية ضبط إعدادات الإصدار في Xcode.
قبل اتّباع هذا الدليل، يُرجى تنفيذ ما يلي:
نزِّل XCFramework، وهي حزمة ثنائية تستخدمها لتثبيت حزمة تطوير البرامج (SDK) الخاصة بالمستهلك. يمكنك استخدام هذه الحزمة على منصات متعددة، بما في ذلك الأجهزة التي تستخدم مجموعة شرائح M1.
فكّ ضغط الملفات المضغوطة للوصول إلى XCFramework والموارد.
ابدأ Xcode وافتح مشروعًا أو أنشئه. إذا كنت تستخدم نظام التشغيل iOS للمرة الأولى،
أنشئ مشروعًا جديدًا واختَر نموذج تطبيق iOS.
إذا كانت مجموعة المشاريع لا تحتوي على مجموعة "أُطر"، أنشئها.
اسحب ملف gRPCCertificates.bundle الذي تم تنزيله إلى دليل المستوى الأعلى في مشروع Xcode. إذا طُلب منك ذلك، اختَر نسخ العناصر.
لتثبيت حزمة Consumer SDK، اسحب ملف GoogleRidesharingConsumer.xcframework إلى مشروعك ضمن الأُطر والمكتبات والمحتوى المضمّن. إذا طُلب منك ذلك، اختَر نسخ العناصر.
اسحب حزمة GoogleRidesharingConsumer.bundle التي تم تنزيلها إلى الدليل ذي المستوى الأعلى في مشروع Xcode. إذا طُلب منك ذلك، اختَر نسخ العناصر.
اختَر مشروعك من "مستكشف المشروع" (Project Navigator)، ثم اختَر هدف تطبيقك.
افتح علامة التبويب مراحل الإنشاء، وفي ربط الملف الثنائي بالمكتبات، أضِف الأُطر والمكتبات التالية إذا لم تكن متوفّرة:
Accelerate.framework
CoreData.framework
CoreGraphics.framework
CoreImage.framework
CoreLocation.framework
CoreTelephony.framework
CoreText.framework
GLKit.framework
ImageIO.framework
libc++.tbd
libz.tbd
Metal.framework
OpenGLES.framework
QuartzCore.framework
SystemConfiguration.framework
UIKit.framework
اختَر مشروعك بدلاً من هدف محدّد، وافتح علامة التبويب إعدادات الإنشاء. في قسم علامات ربط أخرى،
أضِف -ObjC لكل من الإصدار المخصّص لتصحيح الأخطاء والإصدار العلني.
إذا لم تظهر هذه الإعدادات، غيِّر الفلتر في شريط إعدادات الإنشاء من أساسي إلى الكل.
فحص ملف بيان الخصوصية في Apple
تتطلّب Apple توفير تفاصيل خصوصية التطبيق للتطبيقات على App Store. يمكنك الانتقال إلى صفحة "تفاصيل الخصوصية" في Apple App Store للاطّلاع على آخر الأخبار والمزيد من المعلومات.
يتم تضمين ملف "بيان الخصوصية" من Apple في حزمة الموارد لحزمة SDK. للتأكّد من تضمين ملف بيان الخصوصية وفحص محتواه، أنشئ أرشيفًا لتطبيقك وأنشئ تقرير خصوصية من الأرشيف.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis documentation outlines the setup process for the Google Maps Platform Consumer SDK for iOS, enabling on-demand trip following in your iOS consumer apps.\u003c/p\u003e\n"],["\u003cp\u003eThe SDK requires iOS 14 or later, Xcode 15 or later, and can be installed using CocoaPods, Swift Package Manager, or manual installation.\u003c/p\u003e\n"],["\u003cp\u003eAfter installation, developers must configure a Google Cloud Console project, obtain authentication tokens, and initialize the SDK in their app.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should inspect the included Apple Privacy Manifest file to ensure compliance with Apple's App Store privacy requirements.\u003c/p\u003e\n"]]],["To integrate the Consumer SDK for on-demand trip tracking in iOS apps, start by checking the minimum system requirements: iOS 14+ and Xcode 15+. Install the SDK using Swift Package Manager or CocoaPods, ensuring removal of any existing Consumer SDK dependencies. Alternatively, a manual installation option is described. Add required frameworks and libraries, set the `-ObjC` linker flag, then inspect the Apple Privacy Manifest file, and configure your Google Cloud Console project.\n"],null,["Select platform: [Android](/maps/documentation/mobility/journey-sharing/on-demand/android/setup \"View this page for the Android platform docs.\") [iOS](/maps/documentation/mobility/journey-sharing/on-demand/ios/setup \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/mobility/journey-sharing/on-demand/javascript/setup \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nTo follow on-demand trips in your iOS consumer apps, use\nthe Consumer SDK. For more information on and an introduction to following\ntrips, see\n[Follow a trip in iOS](/maps/documentation/mobility/journey-sharing/on-demand).\n| For examples, see the [iOS sample apps](https://github.com/googlemaps/ios-on-demand-rides-deliveries-samples) or [combined samples](https://github.com/googlemaps/on-demand-rides-deliveries-samples).\n\nTo set up the Consumer SDK for your iOS consumer app, follow these steps:\n\n1. [Check the minimum system requirements](#check-min).\n2. [Get the Consumer SDK](#install).\n3. [Inspect Apple Privacy Manifest file](/maps/documentation/mobility/journey-sharing/on-demand/ios/setup#inspect-apple).\n4. [Configure a Google Cloud Console project](/maps/documentation/mobility/journey-sharing/on-demand/ios/configure-project).\n5. [Get authentication tokens](/maps/documentation/mobility/journey-sharing/on-demand/ios/auth-sdk).\n6. [Initialize the Consumer SDK](/maps/documentation/mobility/journey-sharing/on-demand/ios/init-sdk).\n\nCheck the minimum system requirements\n\nCheck the release notes for the minimum requirements for the version of the\nConsumer SDK you are using. See [Release notes](/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_ios).\n\n- The mobile device must be running iOS 14 or later.\n- Apple [Xcode](https://developer.apple.com/xcode/) **version 15** or later.\n\nGet the Consumer SDK\n\nYou install and configure the Consumer SDK with CocoaPods. \n\nSwift Package Manager\n\n\nThe Consumer 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 Consumer 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-consumer-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\n\u003cbr /\u003e\n\nTo remove the existing Consumer SDK installed\nmanually, follow these steps:\n\n1. From your Xcode project configuration settings, find **Frameworks,\n Libraries, and Embedded Content** . Use the **minus sign`(-)`** to remove\n the following framework:\n\n - `GoogleRidesharingConsumer.xcframework`\n2. From the top level directory of your Xcode project, remove the\n `GoogleRidesharingConsumer` bundle.\n\nUse CocoaPods\n\n1. **Install the CocoaPods tool**: Open a terminal window and\n run the following command:\n\n sudo gem install cocoapods\n\n For more details, refer to the\n [CocoaPods Get Started guide](https://guides.cocoapods.org/using/getting-started.html).\n2. **Create a Podfile for the Consumer SDK**: You\n use the Podfile to install the API and its dependencies.\n\n 1. Create a file named `Podfile` in your project directory. This file\n defines your project's dependencies.\n\n 2. Edit the Podfile and add your dependencies. Here is\n an example which includes the dependencies:\n\n source \"https://github.com/CocoaPods/Specs.git\"\n target 'YOUR_APPLICATION_TARGET_NAME_HERE' do\n pod 'GoogleRidesharingConsumer'\n end\n\n 3. **Save the Podfile**: Open a terminal and go to the folder with\n the Podfile:\n\n cd \u003cpath-to-project\u003e\n\n3. **Run the pod install command**: This command installs the APIs\n specified in the Podfile, along with any dependencies they may have.\n\n pod install\n\n4. **Open your project in Xcode**: Close Xcode and then open (double-click)\n your project's .xcworkspace file to launch Xcode. To open the project\n later, use the .xcworkspace file.\n\n | **Note:** Periodically run `pod outdated` to detect when there's a newer version of the SDK. For more information, see Consumer SDK Versions in the [Consumer SDK Release notes](/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_ios).\n\nManual installation\n\nThis guide shows how to manually add the XCFramework containing the\nConsumer SDK to your project and configure your build settings in Xcode.\n| **Caution**: As a best practice, use Cocoapods to install the Consumer SDK whenever possible.\n\nBefore following this guide, do the following:\n\n- Download the XCFramework, a binary package that you use to install the\n Consumer SDK. You can use this package on multiple platforms, including\n machines using the M1 chipset.\n\n- Install the\n [Maps SDK](/maps/documentation/ios-sdk/config#install-the-sdk).\n\n1. Download the SDK binary and resources:\n\n - [GoogleRidesharingConsumer.xcframework](https://dl.google.com/geosdk/swiftpm/3.2.0/GoogleRidesharingConsumer_3p.xcframework.zip)\n - [GoogleRidesharingConsumer.bundle](https://dl.google.com/geosdk/swiftpm/3.2.0/GoogleRidesharingConsumer.zip)\n - [gRPCCertificates.bundle](https://dl.google.com/geosdk/gRPCCertificates.bundle.zip)\n\n \u003cbr /\u003e\n\n2. Unpack the zipped files to access the XCFramework and resources.\n\n3. Start Xcode and either open or create a project. If you're new to iOS,\n create a new project and select the iOS App template.\n\n4. If your project group does not contain a Frameworks group, create it.\n\n5. Drag the downloaded `gRPCCertificates.bundle` file into the top-level\n directory of your Xcode project. If prompted, select **Copy items**.\n\n6. To install the Consumer SDK, drag the\n `GoogleRidesharingConsumer.xcframework` file into your project under\n **Frameworks, Libraries, and Embedded Content** . If prompted, select\n **Copy items**.\n\n7. Drag the downloaded `GoogleRidesharingConsumer.bundle` into the\n top-level directory of your Xcode project. If prompted, select\n **Copy items**.\n\n8. Select your project from the Project Navigator, and choose your\n application's target.\n\n9. Open the **Build Phases** tab, and in **Link Binary with Libraries**,\n add the following frameworks and libraries if they are not already\n present:\n\n - `Accelerate.framework`\n - `CoreData.framework`\n - `CoreGraphics.framework`\n - `CoreImage.framework`\n - `CoreLocation.framework`\n - `CoreTelephony.framework`\n - `CoreText.framework`\n - `GLKit.framework`\n - `ImageIO.framework`\n - `libc++.tbd`\n - `libz.tbd`\n - `Metal.framework`\n - `OpenGLES.framework`\n - `QuartzCore.framework`\n - `SystemConfiguration.framework`\n - `UIKit.framework`\n10. Choose your project, rather than a specific target, and open the\n **Build Settings** tab. In the **Other Linker Flags** section,\n add `-ObjC` for both debug and release.\n\n If these settings are not visible, change the filter in the\n **Build Settings** bar from **Basic** to **All**.\n\nInspect Apple Privacy Manifest file\n\nApple requires app privacy details for apps on the App Store. Visit the [Apple App Store Privacy Details page](/maps/documentation/ios-sdk/apple-privacy-policy) for updates and more information.\n\nThe Apple Privacy Manifest file is included in the resources bundle for the SDK. To verify that the Privacy Manifest File has been included, and to inspect its contents, create an archive of your app and [generate a privacy report](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests#4239187) from the archive.\n\nWhat's next\n\n[Configure a Google Cloud Console project](/maps/documentation/mobility/journey-sharing/on-demand/ios/configure-project)"]]