/// <summary> /// Call first to load the offerwall in the background, it also has callbacks to let you know once it was successfull and if it failed /// so you can try again. /// </summary> /// <param name="wallCode"></param> /// <param name="userId"></param> /// <param name="subIds"></param> /// <param name="onOfferWallLoadedSuccess"></param> /// <param name="onOfferWallLoadingFailed"></param> public static void LoadOfferWall(string wallCode, string userId, List <string> subIds = null, Action onOfferWallLoadedSuccess = null, Action <int> onOfferWallLoadingFailed = null) { CheckIntialisedState(); wallCodeCache = wallCode; userIdCache = userId; subIdsCache = subIds; webViewPrefab = webViewPrefab == null?Resources.Load <GameObject>("AdGameOfferView") : webViewPrefab; uniWebViewComponent = Instantiate(webViewPrefab).GetComponent <UniWebView>(); OfferWallRequest.LoadOfferWall(uniWebViewComponent, wallCode, userId, onOfferWallLoadedSuccess, onOfferWallLoadingFailed, subIds); }
/// <summary> /// Once you have loaded and confirmed an offer is available, you can call this to display the offerwall to user. You also get callbacks /// for when showing offer was successfull or if it failed /// </summary> /// <param name="onOfferWallShown"></param> /// <param name="onOfferWallClosed"></param> public static void ShowOfferWall(Action onOfferWallShown = null, Action onOfferWallClosed = null) { CheckIntialisedState(); AdGateManager.onOfferWallClosed = onOfferWallClosed; if (uniWebViewComponent != null) { OfferWallRequest.ShowOfferWall(uniWebViewComponent); } else { onOfferWallShown?.Invoke(); } }
/// <summary> /// This is used to get the conversion details for a user and code /// </summary> /// <param name="wallCode"></param> /// <param name="userId"></param> /// <param name="onConversionDetailsAvailable"></param> /// <param name="onConversionDetailsFailedToLoad"></param> /// <param name="subIds"></param> public static void GetConversionDetails(string wallCode, string userId, List <string> subIds = null, Action <AdGateConversionResponse> onConversionDetailsAvailable = null, Action <string, int> onConversionDetailsFailedToLoad = null) { CheckIntialisedState(); OfferWallRequest.GetConversionDetails(_Instance, wallCode, userId, onConversionDetailsAvailable, onConversionDetailsFailedToLoad, subIds); }