تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بدءًا من CocoaPods 1.9.0 وFirebase 7، يمكنك اختيار ما إذا كانت تبعيات Firebase سيتم إنشاؤها كأُطر ثابتة أو ديناميكية. ننصحك باستخدام أُطر ثابتة ما لم تكن بحاجة إلى سلوكيات معيّنة لمكتبة ديناميكية.
يُرجى العِلم أنّه لا يمكن ربط المكتبات التي تم تطويرها خارج GitHub إلا بشكل ثابت، حتى مع الإصدار 1.9.0 من CocoaPods والإصدارات الأحدث. تتضمّن قائمة المكتبة حاليًا
AdMob وAnalytics وFirebase ML وPerformance Monitoring. لا توفّر جميع قنوات التوزيع الأخرى، بما في ذلك ملف ZIP وSwift Package Manager وCarthage، سوى مكتبات مرتبطة بشكل ثابت.
يفترض هذا المستند معرفة عملية بالربط الديناميكي والثابت على منصات Apple. إذا لم تكن على دراية بهذه المفاهيم، يمكنك الاطّلاع على المستندات التالية:
بما أنّ هذا المستند يركّز على أنواع ربط المكتبات وليس على تحميل حِزم الموارد غير القابلة للتنفيذ، يتم استخدام المصطلحَين مكتبة وإطار بشكل تبادلي.
الربط الثابت
يتم تجميع المكتبات المرتبطة بشكل ثابت في ملف تنفيذي للتطبيق في وقت الإنشاء. نتيجةً لذلك، ستكون ملفات العناصر في المكتبة الثابتة متوفّرة في تطبيقك عند تشغيله، ولن يحتاج الرابط الديناميكي إلى حلّها عند تشغيل التطبيق. نتيجةً لذلك، سيتم تشغيل التطبيقات التي تستخدم الربط الثابت بشكل أسرع. ويأتي ذلك على حساب حجم أكبر قليلاً للرمز الثنائي / ملف تنفيذ التطبيق،
مع العلم أنّ حجم ملف التنفيذ الأكبر سيتم تعويضه
بعدم توفّر مكتبات ديناميكية مجمّعة.
يمكنك فرض الربط الثابت لملفات Firebase التابعة من خلال تحديد الربط بشكل صريح في ملف Podfile:
يتم تخزين المكتبات المرتبطة ديناميكيًا في حِزمة تطبيقك بشكل منفصل عن الملف التنفيذي الرئيسي لتطبيقك، ويجب أن يتم تحميلها عند تشغيل التطبيق من خلال أداة الربط الديناميكي. يتم ربط جميع أُطر عمل Apple بشكل ديناميكي لتفعيل مشاركة الرموز بين العمليات. وبالمثل، يمكنك استخدام أُطر العمل الديناميكية لمشاركة الرموز بين أهداف التطبيق والإضافة. لا يمكنك مشاركة حِزم البرامج الديناميكية بين تطبيقات منفصلة، حتى إذا كان المطوّر نفسه قد وقّع عليها.
إذا كنت تريد استخدام Firebase كعنصر تابع لهدف إطار عمل ديناميكي، عليك أيضًا ربط Firebase بشكل ديناميكي، وإلا ستواجه تعريفات مكرّرة للفئات في وقت تشغيل تطبيقك. الربط الديناميكي هو السلوك التلقائي في
use_frameworks!، ولكن يمكنك مع ذلك تحديد الربط الديناميكي بشكل صريح في ملف Podfile:
تاريخ التعديل الأخير: 2025-09-03 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-09-03 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["\u003cbr /\u003e\n\nBeginning with CocoaPods 1.9.0 and Firebase 7, you can choose whether your\nFirebase dependencies are built as static or dynamic frameworks. We recommend\nusing static frameworks unless you require certain dynamic library behaviors.\n\nNote that libraries developed outside of GitHub can only be linked statically\neven with CocoaPods 1.9.0 and later. Currently, this library list includes\nAdMob, Analytics, Firebase ML, and Performance Monitoring. All other distribution\nchannels, including the zip file, Swift Package Manager, and Carthage provide\nstatically linked libraries only.\n\nThis document assumes a working knowledge of dynamic and static linking on\nApple platforms. If you're unfamiliar with these concepts, take a look at the\nfollowing documentation:\n\n- [Mach-O Programming Topics](//developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/MachOTopics/0-Introduction/introduction.html#//apple_ref/doc/uid/TP40001827-SW1)\n- [Dynamic Library Programming Topics](//developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/000-Introduction/Introduction.html)\n- [Using Firebase in libraries](//github.com/firebase/firebase-ios-sdk/blob/master/docs/firebase_in_libraries.md)\n\nSince this document is concerned with the types of library linkage and not the\nloading of non-executable resource bundles, the terms *library* and *framework*\nare used interchangeably.\n\nStatic linking\n\nStatically linked libraries are bundled into your application executable at\nbuild time. As a result, the object files in the static library will be present\nin your app when it launches and do not need to be resolved at app-launch time\nby the dynamic linker. Consequently, apps using static linking will launch\nfaster. This comes at the expense of a slightly larger binary / app executable,\nalthough it should be noted that the larger executable size will be offset by\nthe lack of bundled dynamic libraries.\n\nYou can force static linking of Firebase dependencies by explicitly specifying\nthe linkage in your Podfile: \n\n # cocoapods \u003e= 1.9.0\n use_frameworks! :linkage =\u003e :static\n\n| **Note:** Swift Package Manager, Carthage, and the zip file provide statically linked libraries only.\n\nDynamic linking\n\nDynamically linked libraries are stored in your app bundle separately from your\napp's main executable, and they must be loaded at app-launch time by the dynamic\nlinker. Apple's frameworks are all linked dynamically to enable code-sharing\nbetween processes; similarly, you can use dynamic frameworks to share code\nbetween your app and extension targets. You cannot share dynamic frameworks\nbetween separate applications, even if they are both signed by the same\ndeveloper.\n\nIf you want to use Firebase as a dependency of a dynamic framework target, you\nalso need to link Firebase dynamically; otherwise you'll run into\n[duplicate class definitions](//github.com/firebase/firebase-ios-sdk/blob/master/docs/firebase_in_libraries.md)\nin your app's runtime. Dynamic linking is the default behavior with\n`use_frameworks!`, but you can still explicitly specify dynamic linkage in your\nPodfile: \n\n # cocoapods \u003e= 1.9.0\n use_frameworks! :linkage =\u003e :dynamic\n\nNote that dynamic linking may increase your app's launch time, especially if\nyour app has a lot of dependencies.\n| **Note:** Swift Package Manager, Carthage, and the zip file provide statically linked libraries only."]]