Problem using FeatureReminder

3 posts, 1 answers
  1. Eric Schoenholzer
    Eric Schoenholzer avatar
    138 posts
    Member since:
    Mar 2004

    Posted 16 Feb 2012 Link to this post

    Hi,
    My Idea is to allow a base functionality in my app, but some feature should be disabled until the app is bought.
    So I added the FeatureReminder to my app.

    I tried to set the FeeUsageCount to null, 0 and 1, but no dialog is shown, when I call my "disabled" function.
    When calling Notify(), no message is shown.
    Testing for IsTrialExpired , value is always false.

    return new RadTrialFeatureReminder()
                   {
                       FeatureId = 1,
                       AllowedTrialUsageCount = 1, // maximum number of app runs until trial is expired
                       FreeUsageCount = 1, // number of app runs when no reminder will be displayed
                       OccurrenceUsageCount = 1 // reminder will be displayed on every run after the free usage is over
                   };


    So my questions:
    - How I should implement it (Trial reminder should be shown after first use)?
    - What are the init values for the reminder?
    - What should I do, when the app is bought? Does the TrialFeauteReminder test the internal value IsTrail() ?


    Thanks
    Eric



  2. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 17 Feb 2012 Link to this post

    Hello Eric,

    To enable the trial reminder the application should run in Trial mode. This is not the case when the application is not installed as a trial from marketplace. To simulate the trial mode you need to set the SimulateTrialForTests property to true (but please do it when DEBUG symbols are on, so you don't forget to remove it when you deploy your application to the marketplace).

    Here is the full code needed. I'm also attaching a sample project for your reference. This is rather new feature so please let us know if you have any feedback.
    public MainPage()
            {
                InitializeComponent();
     
                paidFeatureReminder = new RadTrialFeatureReminder()
                {
                    FreeUsageCount = 0,
                    AllowedTrialUsageCount =1,
                    FeatureId = 1,
    #if DEBUG
                    SimulateTrialForTests = true
    #endif
                };
     
                if (paidFeatureReminder.IsTrialExpired)
                {
                    FeatureButton.IsEnabled = false;
                }
            }
     
            private void Button_Click(object sender, RoutedEventArgs e)
            {
                paidFeatureReminder.UsageCount++;
                paidFeatureReminder.Notify();
     
                if (paidFeatureReminder.IsTrialExpired)
                {
                    FeatureButton.IsEnabled = false;
                    return;
                }
     
                // perform the feature actions
     
            }

    Greetings,
    Valentin.Stoychev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Eric Schoenholzer
    Eric Schoenholzer avatar
    138 posts
    Member since:
    Mar 2004

    Posted 17 Feb 2012 Link to this post

    Hello Valentin,

    Great, works like a charm.
    I failed to see the use of "SimulateTrialForTests".

    I started with the beta, now I'm using the release version.
    My goal is to use all all the new building blocks.
    What I have seen and implemented until now, is very useful.

    Regards
    Eric 

Back to Top