Пример #1
0
        protected override void InternalInit()
        {
#if EM_TAPJOY
            mIsInitialized = true;
            mAdSettings    = EM_Settings.Advertising.Tapjoy;

            mCustomInterstitialPlacements = new Dictionary <AdPlacement, TJPlacement>();
            mCustomRewardedPlacements     = new Dictionary <AdPlacement, TJPlacement>();

            // TapJoy's placements can only be created after the game is successfully connnected to server.
            // If it is already connected when we're initializing this client, create all of them normally...
            if (Tapjoy.IsConnected)
            {
                CreateDefaultAdPlacements(mAdSettings);
            }
            // ...otherwise, we need to wait until it has been connected.
            else
            {
                Tapjoy.OnConnectSuccess += () =>
                {
                    CreateDefaultAdPlacements(mAdSettings);
                };
            }

            // Set GDPR consent (if any) *before* requesting any content from TapJoy.
            // https://dev.tapjoy.com/sdk-integration/#sdk11122_gdpr_release
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            // Subscribe to events.
            SetupTapJoyEventCallbacks();
            SetupTapJoyPlacementEventCallbacks();

            Debug.Log("Tapjoy client has been initialized.");
#endif
        }
Пример #2
0
 /// <summary>
 /// Creates default InterstitialPlacement and RewaredVideoPlacement.
 /// </summary>
 protected virtual void CreateDefaultAdPlacements(TapjoySettings adSettings)
 {
     mDefaultInterstitialPlacement = TJPlacement.CreatePlacement(adSettings.DefaultInterstitialAdId.Id);
     mDefaultRewaredVideoPlacement = TJPlacement.CreatePlacement(adSettings.DefaultRewardedAdId.Id);
 }