TrialApplicationReminder Not working

5 posts, 1 answers
  1. Rich
    Rich avatar
    8 posts
    Member since:
    Jul 2011

    Posted 12 Mar 2013 Link to this post

    I am trying to get the TrialApplicationReminder working, but it is defying logic.  Here's what I want from it:

    • For two weeks, no reminders.
    • After that, one reminder every two weeks
    • Allow users to not be reminded again

    For testing purposes, I modified the code in Application.xaml.cs in the WP8 Examples application.  I figured that since in the SimulateTrialExpiration event you just set the AllowedTrailPeriod to zero and call reminder.Notify, I should be able to just set my AllowedTrialPeriod to what I want (15 seconds in this case, for testing), and call reminder.Notify.  So I added two lines to your code.  Here's what I have:

    public Application()
        {
            InitializeComponent();
            reminder = new RadTrialApplicationReminder();
            reminder.AllowedTrialPeriod = new TimeSpan(0, 0, 15);
            reminder.OccurrenceUsageCount = 1;
            reminder.SimulateTrialForTests = true;
            InstallationDate = ApplicationUsageHelper.InitialInstallationDate;
            ApplicationRunsTotal = ApplicationUsageHelper.ApplicationRunsCountTotal;
            reminder.Notify();
        }

    I would expect that when I deploy the app fresh, the first run would give me no notification.  After that (since 15 seconds would have passed), I would receive a notification.  I don't get anything.  I have tried setting other parameters, but I just can't seem to make it work. 

    Why in the world does setting AllowedTrialPeriod to zero work, but setting it to 15 seconds and letting that much time elapse doesn't?  I've also tried a couple minutes for the TimeSpan as well, but the results were the same.

    Thanks for any help.

    Rich

  2. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 13 Mar 2013 Link to this post

    Hello Rich,

    Thank you for contacting us.

    You can have a look at this blog post to understand what is expected from RadTrialApplicationReminder. For your scenario, where you want to have no reminders for two weeks, you have to set the FreePeriod to two weeks. To display the reminder on every two weeks, set the OccurrencePeriod to two weeks as well. Please note, that the reminder will not be displayed unless you call Notify, and this is why you get no reminder after 15 seconds have elapsed.

    I hope this information helps. Let me know if you need further assistance.

    Kind regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Rich
    Rich avatar
    8 posts
    Member since:
    Jul 2011

    Posted 13 Mar 2013 Link to this post

    Todor, thanks.  I got it going with your help.  One thing has me confused, though...  In the example you cite, a private static variable is instantiated:
    private static RadTrialApplicationReminder trialReminder;

    This variable is never set.  It looks like someone started writing the code with plans to do one thing, and did another.  ;)
  5. Rich
    Rich avatar
    8 posts
    Member since:
    Jul 2011

    Posted 13 Mar 2013 Link to this post

    One more question.  I am planning to do a free version and a paid/trial version.  Is it possible to rewire the Yes button in the reminder of the free version so that it will link to the paid version in the Windows Phone Store?  And I guess before that, one more question - can I use the SimulateTrialForTests in a deployed free version to cause it to show the message, since there is no trail flag for a free version?

    Or.... Hmmm....  I don't see a LicenseInformation.IsFree() method....  Is there a way to detect if the app is the free version (so that I can use the same code for both the free and the trail/paid submissions)?
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 14 Mar 2013 Link to this post

    Hi Rich,

    Though it is not their initial purpose, I guess you could use our reminders in free applications as well by setting SimulateTrialForTests to true. In order to display the paid application instead of the free when user taps yes on the reminder, you can add an event handler for the ReminderClosed event of RadTrialFearureReminder. Something like:
    private void OnReminder_ReminderClosed(object sender, ReminderClosedEventArgs e)
    {
        if (e.MessageBoxEventArgs.Result == DialogResult.OK)
        {
            MarketplaceDetailTask task = new MarketplaceDetailTask();
            task.ContentIdentifier = "the content identifier for the paid app";
            task.ContentType = MarketplaceContentType.Applications;
            task.Show();
        }
                 
        e.Cancel = true; //Cancel the display of the default task for the free app.
    }

    The way you identify if your app is free or paid is up to you depending on the way that you make the difference between the two versions.

    Greetings,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner