Assign the required values to the fields, and only then make the request.
using UnityEngine;
using AdManagerPro;
using UnityEngine.UI;
using TMPro;
public class Test : MonoBehaviour
{
[SerializeField] Image imageNative;
[SerializeField] TMP_Text headerNative, bodyNative;
private void Start()
{
NativeAdManager.adImage = imageNative;
NativeAdManager.adBodyText = bodyNative;
NativeAdManager.adHeadlineText = headerNative;
// Request to download native ad
NativeAdManager.RequestNativeAd();
}
}
Availability of Native Ads
If you need to check the availability/loading status of the ad, include the following code snippet:
using UnityEngine;
using AdManagerPro;
public class Test : MonoBehaviour
{
private void Start()
{
if(AppOpenAdManager.isAdmobAppOpenReady){
Debug.Log("The ad is available.");
}
}
}
IMPORTANT! Native ads are loaded only within the actual application, so you won't see them in the Unity editor. Consequently, checking for ad availability will always return "false" in the editor. Make sure to test the ads by creating a test version of your app.