void Start () { sponsorPayPlugin = SponsorPayPluginMonoBehaviour.PluginInstance; // Initialize GUI reqVideo = GameObject.Find("RequestVideo").GetComponent<Button>(); showVideo = GameObject.Find("ShowVideo").GetComponent<Button>(); reqVideo.interactable = false; showVideo.interactable = false; reqVideo.onClick.RemoveAllListeners(); reqVideo.onClick.AddListener(delegate { sponsorPayPlugin.RequestBrandEngageOffers (null, true); }); showVideo.onClick.RemoveAllListeners(); showVideo.onClick.AddListener(delegate { sponsorPayPlugin.StartBrandEngage(); showVideo.interactable = false; }); //Fyber SDK callbacks sponsorPayPlugin.OnNativeExceptionReceived += new SponsorPay.NativeExceptionHandler (OnNativeExceptionReceivedFromSDK); sponsorPayPlugin.OnSuccessfulCurrencyRequestReceived += new SponsorPay.SuccessfulCurrencyResponseReceivedHandler(OnSuccessfulCurrencyResponseReceived); sponsorPayPlugin.OnDeltaOfCoinsRequestFailed += new SponsorPay.ErrorHandler(OnSPDeltaOfCoinsRequestFailed); sponsorPayPlugin.OnBrandEngageRequestResponseReceived += new SponsorPay.BrandEngageRequestResponseReceivedHandler (OnSPBrandEngageResponseReceived); sponsorPayPlugin.OnBrandEngageRequestErrorReceived += new SponsorPay.BrandEngageRequestErrorReceivedHandler (OnSPBrandEngageErrorReceived); sponsorPayPlugin.OnBrandEngageResultReceived += new SponsorPay.BrandEngageResultHandler (OnMBEResultReceived); // Initialize Fyber SDK with your App ID, Security Token, and User ID sponsorPayPlugin.Start(APP_ID, USER_ID, SECURITY_TOKEN); // Initialize SOOMLA Store SoomlaStore.Initialize(new YourStoreAssetsImplementation()); }
// Called when the script instance is being loaded void Awake() { if (PluginInstance == null) { PluginInstance = new SponsorPay.SponsorPayPlugin(gameObject.name); } }
// Use this for initialization void Start() { sponsorPayPlugin = SponsorPayPluginMonoBehaviour.PluginInstance; sponsorPayPlugin.OnNativeExceptionReceived += new SponsorPay.NativeExceptionHandler(OnNativeExceptionReceivedFromSDK); sponsorPayPlugin.OnOfferWallResultReceived += new SponsorPay.OfferWallResultHandler(OnOFWResultReceived); sponsorPayPlugin.Start(appId, userId, securityToken); sponsorPayPlugin.LaunchOfferWall(null, customCurrencyName, placementId); }
// Start: Use this for initialization void Start() { print("SponsorPaySDKDemo's Start invoked"); // get a hold of the SponsorPay plugin instance (SponsorPayPluginMonoBehaviour must be attached to a scene object) sponsorPayPlugin = SponsorPayPluginMonoBehaviour.PluginInstance; sponsorPayPlugin.EnableLogging(true); sponsorPayPlugin.SetLogLevel(SPLogLevel.Debug); // Register delegates to be notified of the result of the "get new coins" request sponsorPayPlugin.OnSuccessfulCurrencyRequestReceived += new SponsorPay.SuccessfulCurrencyResponseReceivedHandler(OnSuccessfulCurrencyRequestReceived); sponsorPayPlugin.OnDeltaOfCoinsRequestFailed += new SponsorPay.ErrorHandler(OnSPDeltaOfCoinsRequestFailed); // Register delegates to be notified of the result of a BrandEngage request sponsorPayPlugin.OnBrandEngageRequestResponseReceived += new SponsorPay.BrandEngageRequestResponseReceivedHandler(OnSPBrandEngageResponseReceived); sponsorPayPlugin.OnBrandEngageRequestErrorReceived += new SponsorPay.BrandEngageRequestErrorReceivedHandler(OnSPBrandEngageErrorReceived); // Register delegates to be notified when a native exception occurs on the plugin sponsorPayPlugin.OnNativeExceptionReceived += new SponsorPay.NativeExceptionHandler(OnNativeExceptionReceivedFromSDK); sponsorPayPlugin.OnOfferWallResultReceived += new SponsorPay.OfferWallResultHandler(OnOFWResultReceived); sponsorPayPlugin.OnBrandEngageResultReceived += new SponsorPay.BrandEngageResultHandler(OnMBEResultReceived); //Interstitial delegates sponsorPayPlugin.OnInterstitialRequestResponseReceived += new SponsorPay.InterstitialRequestResponseReceivedHandler(OnSPInterstitialResponseReceived); sponsorPayPlugin.OnInterstitialRequestErrorReceived += new SponsorPay.InterstitialRequestErrorReceivedHandler(OnSPInterstitialErrorReceived); sponsorPayPlugin.OnInterstitialStatusCloseReceived += new SponsorPay.InterstitialStatusCloseHandler(OnSPInterstitialStatusCloseReceived); sponsorPayPlugin.OnInterstitialStatusErrorReceived += new SponsorPay.InterstitialStatusErrorHandler(OnSPInterstitialStatusErrorReceived); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("additional_param", "WOOT"); dictionary.Add("another_one", "ImHERE"); sponsorPayPlugin.AddParameters(dictionary); }
// Start: Use this for initialization void Start() { print ("SponsorPaySDKDemo's Start invoked"); // get a hold of the SponsorPay plugin instance (SponsorPayPluginMonoBehaviour must be attached to a scene object) sponsorPayPlugin = SponsorPayPluginMonoBehaviour.PluginInstance; sponsorPayPlugin.EnableLogging(true); sponsorPayPlugin.SetLogLevel(SPLogLevel.Debug); // Register delegates to be notified of the result of the "get new coins" request sponsorPayPlugin.OnSuccessfulCurrencyRequestReceived += new SponsorPay.SuccessfulCurrencyResponseReceivedHandler(OnSuccessfulCurrencyRequestReceived); sponsorPayPlugin.OnDeltaOfCoinsRequestFailed += new SponsorPay.ErrorHandler(OnSPDeltaOfCoinsRequestFailed); // Register delegates to be notified of the result of a BrandEngage request sponsorPayPlugin.OnBrandEngageRequestResponseReceived += new SponsorPay.BrandEngageRequestResponseReceivedHandler(OnSPBrandEngageResponseReceived); sponsorPayPlugin.OnBrandEngageRequestErrorReceived += new SponsorPay.BrandEngageRequestErrorReceivedHandler(OnSPBrandEngageErrorReceived); // Register delegates to be notified when a native exception occurs on the plugin sponsorPayPlugin.OnNativeExceptionReceived += new SponsorPay.NativeExceptionHandler(OnNativeExceptionReceivedFromSDK); sponsorPayPlugin.OnOfferWallResultReceived += new SponsorPay.OfferWallResultHandler(OnOFWResultReceived); sponsorPayPlugin.OnBrandEngageResultReceived += new SponsorPay.BrandEngageResultHandler(OnMBEResultReceived); //Interstitial delegates sponsorPayPlugin.OnInterstitialRequestResponseReceived += new SponsorPay.InterstitialRequestResponseReceivedHandler(OnSPInterstitialResponseReceived); sponsorPayPlugin.OnInterstitialRequestErrorReceived += new SponsorPay.InterstitialRequestErrorReceivedHandler(OnSPInterstitialErrorReceived); sponsorPayPlugin.OnInterstitialStatusCloseReceived += new SponsorPay.InterstitialStatusCloseHandler(OnSPInterstitialStatusCloseReceived); sponsorPayPlugin.OnInterstitialStatusErrorReceived += new SponsorPay.InterstitialStatusErrorHandler(OnSPInterstitialStatusErrorReceived); Dictionary<string, string> dictionary = new Dictionary<string, string>(); dictionary.Add("additional_param", "WOOT"); dictionary.Add("another_one", "ImHERE"); sponsorPayPlugin.AddParameters(dictionary); }