public static int SendRequest(PlayHavenBinding.RequestType type, string placement, bool showsOverlayImmediately) { IPlayHavenRequest request = null; switch (type) { case PlayHavenBinding.RequestType.Open: request = new OpenRequest(placement); // placement is actually customUDID request.OnSuccess += HandleOpenRequestOnSuccess; request.OnError += HandleOpenRequestOnError; break; case PlayHavenBinding.RequestType.Metadata: request = new MetadataRequest(placement); request.OnSuccess += HandleMetadataRequestOnSuccess; request.OnError += HandleMetadataRequestOnError; request.OnWillDisplay += HandleMetadataRequestOnWillDisplay; request.OnDidDisplay += HandleMetadataRequestOnDidDisplay; break; case PlayHavenBinding.RequestType.Content: request = new ContentRequest(placement); request.OnError += HandleContentRequestOnError; request.OnDismiss += HandleContentRequestOnDismiss; request.OnReward += HandleContentRequestOnReward; request.OnPurchasePresented += HandleRequestOnPurchasePresented; request.OnWillDisplay += HandleContentRequestOnWillDisplay; request.OnDidDisplay += HandleContentRequestOnDidDisplay; break; case PlayHavenBinding.RequestType.Preload: request = new ContentPreloadRequest(placement); request.OnError += HandleContentRequestOnError; request.OnSuccess += HandlePreloadRequestOnSuccess; break; case PlayHavenBinding.RequestType.CrossPromotionWidget: request = new ContentRequest("more_games"); request.OnError += HandleCrossPromotionWidgetRequestOnError; request.OnDismiss += HandleCrossPromotionWidgetRequestOnDismiss; request.OnWillDisplay += HandleCrossPromotionWidgetRequestOnWillDisplay; request.OnDidDisplay += HandleCrossPromotionWidgetRequestOnDidDisplay; break; } if (request != null) { request.Send(showsOverlayImmediately); return(request.HashCode); } return(0); }
public static int SendRequest(PlayHavenBinding.RequestType type, string placement) { return(SendRequest(type, placement, false)); }