החל מגרסה 21.0.0 של Google Mobile Ads (GMA) SDK, אפשר להפעיל את האופטימיזציה של הטעינה של המודעות וההפעלה של ה-SDK כדי לשפר את היכולת של המודעות להגיב, ולמנוע שגיאות מסוג 'האפליקציה לא מגיבה' (ANR) באפליקציה. במדריך הזה מוסבר מה צריך לשנות כדי להפעיל את האופטימיזציות האלה.
הפלאגין של Google Mobile Ads ל-Unity בגרסה 7.2.0 ואילך.
עדכון ההגדרות של Google Mobile Ads
יש שני דגלים של אופטימיזציה שזמינים באובייקט הניתן לתכנות של הגדרות Google Mobile Ads: Optimize Initialization ו-Optimize AdLoading. אחרי שהן מופעלות, משימות האינטראקציה הראשונית וטעינת המודעות שדורשות זמן עיבוד ארוך מועברות לשרשור ברקע.
הגדרה
התנהגות
אופטימיזציה של האתחול
אופטימיזציה של קריאת האתחול MobileAds.initialize().
אופטימיזציה של AdLoading
אופטימיזציה של הקריאות לטעינת מודעות בכל הפורמטים של המודעות.
אפשר לגשת להגדרות של Google Mobile Ads דרך תפריט הנכסים של Unity:
נכסים > Google Mobile Ads > הגדרות
אחרי הבחירה, ממשק המשתמש של ההגדרות יופיע בחלון הבודק של Unity Editor.
לתשומת ליבכם: אפשר להפעיל אחת מהאפשרויות או את שתיהן באותה אפליקציה.
[null,null,["עדכון אחרון: 2025-02-08 (שעון UTC)."],[[["Starting 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."],["These optimizations are enabled through two flags within the Google Mobile Ads settings: **Optimize Initialization** and **Optimize AdLoading**, which offload time-consuming tasks to background threads."],["You can access and modify these settings via the Unity asset menu: **Assets \\\u003e Google Mobile Ads \\\u003e Settings**, enabling either or both options based on your needs."],["By default, both optimization flags are set to `false`, requiring you to manually enable them to leverage these improvements."]]],["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"]]