This is a migrated thread and some comments may be shown as answers.

Simulating IsTrialMode property?

1 Answer 35 Views
TrialFeatureReminder
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shannon Stewart
Top achievements
Rank 1
Shannon Stewart asked on 29 Jul 2013, 04:17 PM
I'm building an app where, during a trial period, I will display ads and only allow the user to save a single item to a list. The paid version will be ad-free and allow users to save multiple items. I would like the trial reminder to occur once a week, with the option to disable further reminders. I'm not sure what the best way to check if the application has been purchased, as the IsTrialExpired property only lets me know if the trial period has expired. Would the below configuration allow me to handle this situation. It seems like it will notify the user every time the app starts, and with testing that is what is happening. What's the best way to configure my requirements?

var trialMessageBox = new MessageBoxInfoModel()
    {
        Buttons = MessageBoxButtons.YesNo,
        Content = AppResource.App_TrialReminder_Text,
        SkipFurtherRemindersMessage = AppResource.App_TrialReminder_SkipMessage,
        Title = AppResource.App_TrialReminder_Title
    };
 
_TrialApplicationReminder = new RadTrialApplicationReminder
    {
        AllowedTrialPeriod = TimeSpan.FromSeconds(1),
        FreePeriod = TimeSpan.FromSeconds(1),
        OccurrencePeriod = TimeSpan.FromDays(7),
        AllowUsersToSkipFurtherReminders = true,
#if DEBUG
        SimulateTrialForTests = true,
#endif
        TrialReminderMessageBoxInfo = trialMessageBox,
        TrialExpiredMessageBoxInfo = trialMessageBox
    };

1 Answer, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 30 Jul 2013, 02:21 PM
Hello Shannon,

The trial reminders automatically check if your application is purchased or it is in trial mode. The SimulateTrialForTests property helps you while you are testing your application and what it does is to skip the check if the application is paid and always display the reminder, so you have correctly set it to true only for the debug mode.

The IsTrialExpired property is true only if the application is in trial mode and the trial has expired. When the application is purchased, IsTrialExpired is always false, so the better approach to check this is to use LicenseInformation.IsTrial.

With your configuration, it seems that all of your requirements are met. If you want to understand more about the customization of the reminders, you can read this blog post.

I hope this information helps.

Regards,
Todor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
TrialFeatureReminder
Asked by
Shannon Stewart
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or