1. In Unity, select Assets > Import Package > Custom Package…
2. Choose the Unity Plugin file you downloaded.
3. In the Import Unity Package dialog, click Import
Copy <? xml version = "1.0" encoding = "utf-8" ?>
< dependencies >
< androidPackages >
</ androidPackages >
< iosPods >
< iosPod name = "bidapp" addToAllTargets = "false" />
<!--iosPod name="bidapp/Applovin" addToAllTargets="false" /-->
< iosPod name = "bidapp/ApplovinMax" addToAllTargets = "false" />
<!--iosPod name="bidapp/Unity" addToAllTargets="false" /-->
< iosPod name = "bidapp/Liftoff" addToAllTargets = "false" />
< iosPod name = "bidapp/Chartboost" addToAllTargets = "false" />
<!--iosPod name="bidapp/AdMob" addToAllTargets="false" /-->
</ iosPods >
</ dependencies >
Copy using UnityEngine ;
using System ;
using Bidapp ;
public class DemoGUI : MonoBehaviour
{
// Use this for initialization
void Start ()
{
var sdkDelegate = BidappSDKDelegate . CreateInstance ( this );
sdkDelegate.OnInterstitialDidLoadAd += (interstitialIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnInterstitialDidLoadAd: interstitialId {0}, providerId: {1}", interstitialIdentifier, providerId));
sdkDelegate.OnInterstitialDidFailToLoadAd += (interstitialIdentifier, providerId, errorDescription) => Debug.Log(String.Format("BIDUnity OnInterstitialDidFailToLoadAd: interstitialId {0}, providerId: {1}, errorDescription: {2}", interstitialIdentifier, providerId, errorDescription));
sdkDelegate.OnInterstitialDidDisplayAd += (interstitialIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnInterstitialDidDisplayAd: interstitialId {0}, providerId: {1}", interstitialIdentifier, providerId));
sdkDelegate.OnInterstitialDidClickAd += (interstitialIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnInterstitialDidClickAd: interstitialId {0}, providerId: {1}", interstitialIdentifier, providerId));
sdkDelegate.OnInterstitialDidHideAd += (interstitialIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnInterstitialDidHideAd: interstitialId {0}, providerId: {1}", interstitialIdentifier, providerId));
sdkDelegate.OnInterstitialDidFailToDisplayAd += (interstitialIdentifier, providerId, errorDescription) => Debug.Log(String.Format("BIDUnity OnInterstitialDidFailToDisplayAd: interstitialId {0}, providerId: {1}, errorDescription: {2}", interstitialIdentifier, providerId, errorDescription));
sdkDelegate.OnInterstitialAllNetworksFailedToDisplayAd += (interstitialIdentifier) => Debug.Log(String.Format("BIDUnity OnInterstitialAllNetworksFailedToDisplayAd: interstitialId {0}, providerId: {1}", interstitialIdentifier));
sdkDelegate.OnRewardedDidLoadAd += (rewardedIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnRewardedDidLoadAd: rewardedId {0}, providerId: {1}", rewardedIdentifier, providerId));
sdkDelegate.OnRewardedDidFailToLoadAd += (rewardedIdentifier, providerId, errorDescription) => Debug.Log(String.Format("BIDUnity OnRewardedDidFailToLoadAd: interstitialId {0}, providerId: {1}, errorDescription: {2}", rewardedIdentifier, providerId, errorDescription));
sdkDelegate.OnRewardedDidDisplayAd += (rewardedIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnRewardedDidDisplayAd: rewardedId {0}, providerId: {1}", rewardedIdentifier, providerId));
sdkDelegate.OnRewardedDidClickAd += (rewardedIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnRewardedDidClickAd: rewardedId {0}, providerId: {1}", rewardedIdentifier, providerId));
sdkDelegate.OnRewardedDidHideAd += (rewardedIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnRewardedDidHideAd: rewardedId {0}, providerId: {1}", rewardedIdentifier, providerId));
sdkDelegate.OnRewardedDidFailToDisplayAd += (rewardedIdentifier, providerId, errorDescription) => Debug.Log(String.Format("BIDUnity OnRewardedDidDisplayAd: interstitialId {0}, providerId: {1}, errorDescription: {2}", rewardedIdentifier, providerId, errorDescription));
sdkDelegate.OnRewardedAllNetworksFailedToDisplayAd += (rewardedIdentifier) => Debug.Log(String.Format("BIDUnity OnRewardedAllNetworksFailedToDisplayAd: rewardedId {0}", rewardedIdentifier));
sdkDelegate.OnUserDidReceiveReward += (rewardedIdentifier) => Debug.Log(String.Format("BIDUnity OnUserDidReceiveReward: rewardedId {0}", rewardedIdentifier));
sdkDelegate.OnBannerDidDisplayAd += (bannerIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnBannerDidDisplayAd: bannerId {0}, providerId: {1}", bannerIdentifier, providerId));
sdkDelegate.OnBannerFailedToDisplayAd += (bannerIdentifier, providerId, errorDescription) => Debug.Log(String.Format("BIDUnity OnBannerDidDisplayAd: bannerId {0}, providerId: {1}, errorDescription: {2}", bannerIdentifier, providerId, errorDescription));
sdkDelegate.OnBannerClicked += (bannerIdentifier, providerId) => Debug.Log(String.Format("BIDUnity OnBannerClicked: bannerId {0}, providerId: {1}", bannerIdentifier, providerId));
sdkDelegate.OnBannerAllNetworksFailedToDisplayAd += (bannerIdentifier) => Debug.Log(String.Format("BIDUnity OnBannerAllNetworksFailedToDisplayAd: bannerId {0}", bannerIdentifier));
BidappBinding . Instance . SetCallbacks (sdkDelegate);
//BidappBinding.Instance.SetLogging(true);//Uncomment if you need debug logs
string adContentType = BidappContentType . Interstitial + BidappContentType . Banner + BidappContentType . Rewarded ;
string pubid = "" ;
# if UNITY_ANDROID
pubid = "15ddd248-7acc-46ce-a6fd-e6f6543d22cd" ;
# endif
# if UNITY_IOS || UNITY_IPHONE
pubid = "15ddd248-7acc-46ce-a6fd-e6f6543d22cd" ;
# endif
//BidappBinding.Instance.setTestMode(true);//Uncomment if you need test mode
BidappBinding . Instance . RequestTrackingAuthorization ();
BidappBinding . Instance . Start (pubid , adContentType);
Debug . Log ( "Started with pubid = " + pubid);
}
....
}