تحسين عملية الإعداد وتحميل الإعلانات
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختيار النظام الأساسي:
Android
Unity
بدءًا من الإصدار 21.0.0 من حزمة تطوير البرامج (SDK) لإعلانات Google على الأجهزة الجوّالة، يمكنك تفعيل ميزة تحسين تهيئة حزمة تطوير البرامج وتحميل الإعلانات لتحسين استجابة الإعلانات بشكل عام والمساعدة في منع حدوث أخطاء "التطبيق لا يستجيب" (ANR) في تطبيقك. يوضّح هذا الدليل التغييرات التي عليك إجراؤها لتفعيل هذه التحسينات.
المتطلبات
- الإصدار 7.2.0 أو إصدار أحدث من إضافة Google Mobile Ads Unity
تعديل إعدادات "إعلانات Google على الأجهزة الجوّالة"
تتيح
حزمة "SDK لإعلانات Google على الأجهزة الجوّالة"
إمكانية التحسين تلقائيًا، وتوجّه الحزمة إلى تنفيذ مهام الإعداد وتحميل الإعلانات في سلاسل التعليمات البرمجية التي تعمل في الخلفية.
تتوفّر العلامات التالية لكائن إعدادات حزمة تطوير البرامج (SDK) لإعلانات Google على الأجهزة الجوّالة القابل للبرمجة:
- إيقاف تحسين عملية الإعداد
- إيقاف ميزة تحسين تحميل الإعلانات
تحقَّق من هذه الإعدادات لتوجيه حزمة تطوير البرامج (SDK) بتهيئة الإعلانات وتحميلها في سلسلة التعليمات الرئيسية:
الإعداد | السلوك |
إيقاف عملية إعداد "أدوات تحسين الأداء" |
يؤدي ذلك إلى إيقاف تحسين طلب الإعداد MobileAds.initialize() . |
إيقاف ميزة تحسين تحميل الإعلانات
|
تحسين طلبات تحميل الإعلانات لجميع أشكال الإعلانات |
يؤدي ذلك إلى إيقاف تحسين طلب تحميل الإعلان. |
يمكنك الوصول إلى إعدادات "إعلانات Google على الأجهزة الجوّالة" من خلال قائمة مواد العرض في Unity:
مواد العرض > "إعلانات Google على الأجهزة الجوّالة" > الإعدادات
بعد الاختيار، ستظهر واجهة مستخدم الإعدادات في نافذة "الفحص" في Unity Editor.

يُرجى العِلم أنّه يمكنك تفعيل أحد الخيارَين أو كليهما في التطبيق نفسه.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-27 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eStarting with Google Mobile Ads SDK version 21.0.0, you can optimize SDK initialization and ad loading to enhance ad responsiveness and mitigate ANR errors.\u003c/p\u003e\n"],["\u003cp\u003eThese optimizations are enabled through two flags within the Google Mobile Ads settings: \u003cstrong\u003eOptimize Initialization\u003c/strong\u003e and \u003cstrong\u003eOptimize AdLoading\u003c/strong\u003e, which offload time-consuming tasks to background threads.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and modify these settings via the Unity asset menu: \u003cstrong\u003eAssets > Google Mobile Ads > Settings\u003c/strong\u003e, enabling either or both options based on your needs.\u003c/p\u003e\n"],["\u003cp\u003eBy default, both optimization flags are set to \u003ccode\u003efalse\u003c/code\u003e, requiring you to manually enable them to leverage these improvements.\u003c/p\u003e\n"]]],["Optimized SDK initialization and ad loading can be enabled in Google Mobile Ads (GMA) SDK version 21.0.0 and higher, preventing \"Application Not Responding\" (ANR) errors. To activate, update to Google Mobile Ads Unity plugin version 7.2.0 or higher. In Unity's **Assets \u003e Google Mobile Ads \u003e Settings**, enable **Optimize Initialization** and/or **Optimize AdLoading**. These settings offload initialization and ad loading to background threads. Both flags are `false` by default.\n"],null,["# Optimize initialization and ad loading\n\nSelect platform: [Android](/admob/android/optimize-initialization \"View this page for the Android platform docs.\") [Unity](/admob/unity/optimize-initialization \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\nStarting from Google Mobile Ads (GMA) SDK version 21.0.0, you can enable\noptimized SDK initialization and ad loading to improve the overall\nresponsiveness of ads and help prevent [\"Application Not Responding\"\n(ANR)](//developer.android.com/topic/performance/vitals/anr) errors on your app.\nThis guide outlines the changes you need to make to enable these optimizations.\n\nRequirements\n------------\n\n- Complete the [Get Started guide](/admob/unity/quick-start).\n\n\u003c!-- --\u003e\n\n- Google Mobile Ads Unity plugin version 7.2.0 or higher.\n\nUpdate your Google Mobile Ads settings\n--------------------------------------\n\nThe\n\nGoogle Mobile Ads SDK\n\nenables optimization by default, and instructs the SDK to\nperform initialization and ad loading tasks processing on background threads.\n\nThe following flags are available for the\n\nGoogle Mobile Ads SDK\n\nsettings scriptable\nobject:\n\n- Disable initialization optimization\n- Disable ad loading optimization\n\nCheck these settings to instruct the SDK to initialize and load ads on the main\nthread:\n\n| Setting | Behavior |\n|---------------------------------|-----------------------------------------------------------------------|------------------------------------------|\n| Disable Optimize Initialization | Disables optimizing the `MobileAds.initialize()` initialization call. |\n| Disable ad loading optimization | Optimizes ad load calls for all ad formats. | Disables optimizing the ad loading call. |\n\nYou can access the Google Mobile Ads settings through the Unity asset menu:\n\n**Assets \\\u003e Google Mobile Ads \\\u003e Settings**\n\nOnce selected, the settings UI appears in your Unity Editor inspector window.\n\nNote that you can turn on one or both options in the same app."]]