public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            // setup data
            SetFont(txtSettings, TypefaceStyle.Bold);

            // ipAddress
            if (Resources.GetBoolean(Resource.Boolean.is_test_release))
            {
                SetFont(edtIPAddress, TypefaceStyle.Normal);
                txtIPAddress.Visibility = ViewStates.Visible; // it is used for our testing purpose please igonre it
                edtIPAddress.Visibility = ViewStates.Visible;
            }

            // application id
            SetFont(edtApplicationID, TypefaceStyle.Normal);
            edtApplicationID.Text = PokktStorage.GetAppId(this.Activity);

            // security key
            SetFont(edtSecurityKey, TypefaceStyle.Normal);
            edtSecurityKey.Text = PokktStorage.GetSecurityKey(this.Activity);

            // export log
            SetFont(btnExportLog, TypefaceStyle.Normal);
            btnExportLog.Text   = GetString(Resource.String.txt_export_log);
            btnExportLog.Click += ExportLog;

            // export log to cloud
            SetFont(btnExportLogToCloud, TypefaceStyle.Normal);
            btnExportLogToCloud.Text   = GetString(Resource.String.txt_export_to_cloud);
            btnExportLogToCloud.Click += ExportLogToCloud;
        }
        public override void OnDestroy()
        {
            base.OnDestroy();

            if (TextUtils.IsEmpty(edtApplicationID.Text))
            {
                Toast.MakeText(this.Activity, "Please Enter Application Id", ToastLength.Short).Show();
                return;
            }

            if (TextUtils.IsEmpty(edtSecurityKey.Text))
            {
                Toast.MakeText(this.Activity, "Please Enter Security Key", ToastLength.Short).Show();
                return;
            }

            // saving applicationID and SecurityKey for SDK locally
            String applicationId = edtApplicationID.Text.Trim();
            String securityKey   = edtSecurityKey.Text.Trim();

            PokktStorage.SetAppId(this.Activity, applicationId);
            PokktStorage.SetSecurityKey(this.Activity, securityKey);

            // Updating PokktConfig in PokktSDk in case it is changed from this screen.
            PokktAds.SetPokktConfig(applicationId, securityKey);
        }
Example #3
0
 private void InItPokktSDK()
 {
     PokktAds.SetNativeExtentions(new AndroidExtension(this));                                // Required for communication with PokktSDK. Should be the first line
     PokktAds.SetThirdPartyUserId("123456");                                                  // optional
     PokktAds.Debugging.ShouldDebug(true);                                                    // optional, set it to true if you want to enable logs for PokktSDK
     PokktAds.SetPokktConfig(PokktStorage.GetAppId(this), PokktStorage.GetSecurityKey(this)); // required
 }
 public void AdGratified(String screenName, bool isRewarded, float reward)
 {
     if (this.Activity == null)
     {
         return;
     }
     Toast.MakeText(this.Activity, "Points Earned " + reward, ToastLength.Short).Show();
     PokktStorage.StoreVideoPoints(this.Activity, (float)reward);
 }
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            // setup data

            // ad Type
            SetFont(txtAdType, TypefaceStyle.Bold);

            // screen name
            SetFont(edtScreenName, TypefaceStyle.Normal);
            SetFont(txtScreenName, TypefaceStyle.Normal);

            // earned points
            SetFont(txtEarnedPoints, TypefaceStyle.Normal);
            txtEarnedPoints.Text = GetString(Resource.String.txt_earned_points).Replace("%s", Convert.ToString(PokktStorage.GetVideoPoints(this.Activity)));

            // cache rewarded
            SetFont(btnCacheRewarded, TypefaceStyle.Normal);
            SetProgressbarColor(progressCacheRewarded);
            btnCacheRewarded.Text   = GetString(Resource.String.txt_btn_cache_rewarded);
            btnCacheRewarded.Click += CacheRewarded;

            // show rewarded
            SetFont(btnShowRewarded, TypefaceStyle.Normal);
            SetProgressbarColor(progressShowRewarded);
            btnShowRewarded.Text   = GetString(Resource.String.txt_btn_show_rewarded);
            btnShowRewarded.Click += ShowRewarded;

            // cache non rewarded
            SetFont(btnCacheNonRewarded, TypefaceStyle.Normal);
            SetProgressbarColor(progressCacheNonRewarded);
            btnCacheNonRewarded.Text   = GetString(Resource.String.txt_btn_cache_non_rewarded);
            btnCacheNonRewarded.Click += CacheNonRewarded;

            // show non rewarded
            SetFont(btnShowNonRewarded, TypefaceStyle.Normal);
            SetProgressbarColor(progressShowNonRewarded);
            btnShowNonRewarded.Text   = GetString(Resource.String.txt_btn_show_non_rewarded);
            btnShowNonRewarded.Click += ShowNonRewarded;

            // OPTIONAL but we SUGGEST you to implement actions as it will help you to determine the status of your request
            PokktAds.Interstitial.AdAvailabilityEvent     += AdAvailabilityStatus;
            PokktAds.Interstitial.AdCachingCompletedEvent += AdCachingCompleted;
            PokktAds.Interstitial.AdCachingFailedEvent    += AdCachingFailed;
            PokktAds.Interstitial.AdDisplayedEvent        += AdDisplayed;
            PokktAds.Interstitial.AdFailedToShowEvent     += AdFailedToShow;
            PokktAds.Interstitial.AdSkippedEvent          += AdSkipped;
            PokktAds.Interstitial.AdCompletedEvent        += AdCompleted;
            PokktAds.Interstitial.AdClosedEvent           += AdClosed;
            PokktAds.Interstitial.AdGratifiedEvent        += AdGratified;
        }
 public void AdCompleted(String screenName, bool isRewarded)
 {
     if (this.Activity == null)
     {
         return;
     }
     HideProgress();
     txtEarnedPoints.Text = GetString(Resource.String.txt_earned_points).Replace("%s", Convert.ToString(PokktStorage.GetVideoPoints(this.Activity)));
     Toast.MakeText(this.Activity, "Interstitial Ad Completed", ToastLength.Short).Show();
 }