Beispiel #1
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
#if SILVERLIGHT
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
#else
            var license = Windows.ApplicationModel.Store.CurrentApp.LicenseInformation;
#endif
            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
#if SILVERLIGHT
            if (!license.IsTrial() &&
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch &&
#else
            if (!license.IsTrial &&
#warning The app state is no longer checked, this needs a review
#endif
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }
Beispiel #2
0
        public static bool IsTrialFromLicence()
        {
#if TRIAL_SIMULATION && !RELEASE
            return(trialSimulationValue);
#endif
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            return(license.IsTrial());
        }
        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
#if TRIAL_LICENSE
            IsTrial = true;
#else
            var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = licenseInfo.IsTrial();
#endif
        }
Beispiel #4
0
        private void DetermineIsTrail()
        {
#if TRIAL
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
        }
Beispiel #5
0
 static TrialHelper()
 {
     #if TRIAL
     // return true if debugging with trial enabled (DebugTrial configuration is active)
     IsTrial = true;
     #else
       var license = new Microsoft.Phone.Marketplace.LicenseInformation();
       IsTrial = license.IsTrial();
     #endif
 }
Beispiel #6
0
        static TrialHelper()
        {
#if TRIAL
            // return true if debugging with trial enabled (DebugTrial configuration is active)
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
        }
        /// <summary>
        /// This should only be called when the app is Launching
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if not trial
            if(!license.IsTrial())
                this.LoadState();

            // Uncomment for testing
            // this._state = FeedbackState.FirstReview;
            // this._state = FeedbackState.SecondReview;
        }
Beispiel #8
0
        /// <summary>
        /// This should only be called when the app is Launching
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if not trial
            if (!license.IsTrial())
            {
                this.LoadState();
            }

            // Uncomment for testing
            // this._state = FeedbackState.FirstReview;
            // this._state = FeedbackState.SecondReview;
        }
Beispiel #9
0
        private void DetermineIsTrail()
        {
#if TRIAL
            IsTrial = true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            IsTrial = license.IsTrial();
#endif
            try
            {
                EmulatorSettings.Current.IsTrial = IsTrial;
            }
            catch (Exception) { }
        }
Beispiel #10
0
        public void CheckPurchases()
        {
                        #if WINDOWS_PHONE
            try
            {
                //                if (InstalledProductKind == ProductKind.unknown) return;

                        #if !DEBUG
                if (InstalledProductKind == ProductKind.Trial)
                {
                    var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
                    if (!licenseInfo.IsTrial())
                    {
                        SessionLog.RecordMilestone("Converted from Trial to Paid", SessionId.ToString());
                        InstalledProductKind = ProductKind.Paid;
                        Save();
                    }
                }
                        #endif

                if (InstalledProductKind == ProductKind.Free && AdShows)
                {
                    var productLicenses = CurrentApp.LicenseInformation.ProductLicenses;
                    foreach (var license in productLicenses.Values)
                    {
                        if (license.IsActive && license.ProductId == RemoveAdsProduct)
                        {
                            SessionLog.RecordMilestone("RemoveAdsProduct Purchased", AppStats.Current.SessionId.ToString());
                            InstalledProductKind = ProductKind.Paid;
                            AdShows = false;
                            Save();
                        }

                        if (license.IsActive && license.ProductId.StartsWith(PremiumProduct))
                        {
                            SessionLog.RecordMilestone(license.ProductId + " Purchased", AppStats.Current.SessionId.ToString());
                            InstalledProductKind = ProductKind.Paid;
                            AdShows         = false;
                            MultiMealHidden = false;
                            Save();
                        }
                    }
                }
            }
            catch (Exception ex) { LittleWatson.ReportException(ex); }
                        #endif
        }
Beispiel #11
0
        public static void ReloadTrialInfo()
        {
            if (IsFull)
            {
                if (Config.TrialStart == DateTime.MaxValue)
                {
                    Config.TrialStart = DateTime.Now;
                }

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                IsTrial = license.IsTrial();
            }
            else
            {
                IsTrial = false;
            }
        }
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
            if (!license.IsTrial() && 
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch && 
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }
Beispiel #13
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();

            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
            if (!license.IsTrial() &&
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch &&
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }
        /// <summary>
        /// Checks whether or not this app is in trial mode.
        /// </summary>
        /// <returns></returns>
        public static bool IsTrial()
        {
            var isTrial = false;

            try
            {
                // 1. Force trial experience ?
                if (Settings.ForceTrialExperience)
                    return true;

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                isTrial = license.IsTrial();
            }
            catch (Exception)
            {
                // If license access fails for any reason...
                // don't like it crash the app.
            }
            return isTrial;
        }
Beispiel #15
0
 private void DetermineIsTrail()
 {
     #if TRIAL
     IsTrial = true;
     #else
     var license = new Microsoft.Phone.Marketplace.LicenseInformation();
     IsTrial = license.IsTrial();
     #endif
     try
     {
         EmulatorSettings.Current.IsTrial = IsTrial;
     }
     catch (Exception) { }
 }
Beispiel #16
0
        private void GetInstalledProductKind()
        {
                        #if DEBUG
            InstalledProductKind = ProductKind.Free;            //.Trial;
                        #endif

            if (InstalledProductKind != ProductKind.unknown)
            {
                return;
            }

                        #if SUPPORTTRIAL
            if (LicensedProducts != null && LicensedProducts.Length > 0)             // legacy, free with ads
            {
                InstalledProductKind = ProductKind.Free;
                return;
            }

            try
            {
                var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
                if (licenseInfo.IsTrial())
                {
                    InstalledProductKind = ProductKind.Trial;
                }
                else
                {
                    // if paid, we need to figure out if it was free (ads supported), or paid for (remove all ads)

                    var listing = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync();

                    foreach (var letter in listing.FormattedPrice)
                    {
                        if (letter != '0' && char.IsDigit(letter))
                        {
                            InstalledProductKind = ProductKind.Paid;
                            SessionLog.CurrentScreen.RecordMilestone("Paid w/o trial", listing.FormattedPrice);
                        }
                    }

                    if (InstalledProductKind == ProductKind.unknown)
                    {
                        InstalledProductKind = ProductKind.Free;
                    }
                }
                try
                {
                    Save();
                }
                catch (Exception ex) { LittleWatson.ReportException(ex); }
                CheckPurchases();
            }
            catch (Exception ex)
            {
                LittleWatson.ReportException(ex);
                SessionLog.CurrentScreen.RecordMilestone("GetInstalled Product Exception: giveaway", ex.Message);
                InstalledProductKind = ProductKind.Paid;
            }
                        #else
            InstalledProductKind = ProductKind.Free;
                        #endif
        }
Beispiel #17
0
        private static bool getIsTrilaFromLicenseInformation()
        {
#if FAKESTORE
            return !_fakeActivated;
#elif TRIAL
            return true;
#else
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
            return license.IsTrial();
#endif
        }
Beispiel #18
0
        private void UpdateCachedTrialResult()
        {
#if Iron7Free
            CachedTrialResult = TrialResult.Trial;
#else
            if (CachedTrialResult == TrialResult.Unknown)
            {
                Microsoft.Phone.Marketplace.LicenseInformation license = new Microsoft.Phone.Marketplace.LicenseInformation();
                if (license.IsTrial())
                    CachedTrialResult = TrialResult.Trial;
                else
                    CachedTrialResult = TrialResult.Full;
            }
#endif
        }
 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     #if TRIAL_LICENSE
     IsTrial = true;
     #else
     var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
     IsTrial = licenseInfo.IsTrial();
     #endif
 }
Beispiel #20
0
        public static void ReloadTrialInfo()
        {
            if (IsFull)
            {
                if (Config.TrialStart == DateTime.MaxValue)
                    Config.TrialStart = DateTime.Now;

                var license = new Microsoft.Phone.Marketplace.LicenseInformation();
                IsTrial = license.IsTrial();
            }
            else
            {
                IsTrial = false;
            }
        }
Beispiel #21
0
        /// <summary>
        /// Called when FeedbackLayout control is instantiated, which is
        /// supposed to happen when application's main page is instantiated.
        /// </summary>
        public void Launching()
        {
#if SILVERLIGHT		
            var license = new Microsoft.Phone.Marketplace.LicenseInformation();
#else
			var license = Windows.ApplicationModel.Store.CurrentApp.LicenseInformation;
#endif
            // Only load state if app is not trial, app is not activated after
            // being tombstoned, and state has not been loaded before.
#if SILVERLIGHT		
            if (!license.IsTrial() && 
                PhoneApplicationService.Current.StartupMode == StartupMode.Launch && 
#else
            if (!license.IsTrial && 
#warning The app state is no longer checked, this needs a review
#endif
                State == FeedbackState.Active)
            {
                LoadState();
            }

            // Uncomment for testing
            // State = FeedbackState.FirstReview;
            // State = FeedbackState.SecondReview;
        }