private static void bannerClickCallback(IntPtr bannerHandlePtr, string networkName) { GCHandle bannerHandle = (GCHandle)bannerHandlePtr; AMRBannerViewDelegate delegateObject = bannerHandle.Target as AMRBannerViewDelegate; delegateObject.didClickBanner(networkName); }
private static void bannerFailCallback(IntPtr bannerHandlePtr, string error) { GCHandle bannerHandle = (GCHandle)bannerHandlePtr; AMRBannerViewDelegate delegateObject = bannerHandle.Target as AMRBannerViewDelegate; delegateObject.didFailtoReceiveBanner(error); }
private static void bannerSuccessCallback(IntPtr bannerHandlePtr, string networkName, double ecpm) { GCHandle bannerHandle = (GCHandle)bannerHandlePtr; AMRBannerViewDelegate delegateObject = bannerHandle.Target as AMRBannerViewDelegate; delegateObject.didReceiveBanner(networkName, ecpm); }
public void loadBannerForZoneId(string zoneId, AMR.Enums.AMRSDKBannerPosition position, int offset, AMRBannerViewDelegate delegateObject) { delegateObj = delegateObject; banner.Call("create", new object[4] { zoneId, 50, (int)position, offset }); }
public void loadBannerForZoneId(string zoneId, AMR.Enums.AMRSDKBannerPosition position, int offset, AMRBannerViewDelegate delegateObject) { #if UNITY_IOS _setBannerSuccessCallback(bannerSuccessCallback); _setBannerClickCallback(bannerClickCallback); _setBannerFailCallback(bannerFailCallback); GCHandle handle = GCHandle.Alloc(delegateObject); IntPtr parameter = (IntPtr)handle; // call WinAPi and pass the parameter here bannerPtr = _loadBannerForZoneId(zoneId, position, offset, parameter); #endif }