Learning How to License My Extensions and Need Help


#1

Continuing the discussion from Licensing errors passing undetected:

The update has been released and I managed to successfully test the Temporary License feature. But, I have the following questions.

When I test the Trial License it puts “The license will expire in 2 days.” with the following code…


ext_id = "40404040404040404040404040404040404" # Fake id...
license = Sketchup::Licensing.get_extension_license(ext_id)  
 
if license.days_remaining != 0
  puts "The license will expire in #{license.days_remaining} days."
end

# returns "The license will expire in 2 days."

Questions so far…

  1. Why is the trial license test outputs 2 days remaining and how can we set the time period ourselves?
  2. How to download the Plugin from Extension Warehouse without spending money?
  3. How does the trial license work exactly…Do I create a separate extension with a Free to download page that directs people to the paid Extension page once the trial expires?

Thanks in Advance :smiley:



Here is all the Code I am using for the License...
ext_id = "40404040404040404040404040404040404040404" # Fake id...
license = Sketchup::Licensing.get_extension_license(ext_id)
unless license.licensed?
  # The following 'dialog'  was suggested by eneroth3
  msg = "Extension isn't licensed. \n\n Do you want to open the Extension Warehouse to get a license?"

  if UI.messagebox(msg, MB_YESNO) == IDYES
    ew_identifier = "iselect-0"
    html = <<-HTML
    <a href="skp:launchEW@#{ew_identifier}">Show in Extension Warehouse</a>
    <script type="text/javascript">document.getElementsByTagName('a')[0].click()</script>
    HTML
    dlg = UI::WebDialog.new("iSelect", true, nil, 0, 0, 100_000, 0, true)
    dlg.set_html(html)
    dlg.show
  end
  Sketchup.send_action('selectSelectionTool:')
  return
end

if license.days_remaining != 0
  # Thinking of what to put here...
  puts "The license will expire in #{license.days_remaining} days."
end

if license.state == Sketchup::Licensing::TRIAL_EXPIRED
  # Thinking of what to put here...
  puts "Trial period has expired."
end

#2

Facepalm!

In the Extension ‘Edit Details’ page, there is a very clear instruction on how to set the Trial Period …

Question #1 is checked, but I still don’t know the answer for #2 and #3.

Thanks! :smiley:


#3

@ChrisFullmer - can you shed some light on this?

I think that when you enable the trial users are allowed to download without purchase and they will be issued a trial license. Which they then need to purchase a full license to continue using the extension (provided you implemented the License API)

Take my response here with a grain of salt, this isn’t my area of expertice. Chris will be able to provide a better answer.

@eneroth3 might have some insight as she’s recently been through this herself.

(We need to improve the documentation to how this all works. I appologise for the inconveniense. I’ll be monitoring this thread and taking notes of what needs improving.)


#4

The same extension can both have trial license and paid licenses so no duplicated extension page is needed. The buy and install trial buttons are placed next to each other. If you click Install Trial you get a trial license that should expire in the days set by the extension developer.

trial


#5

@ChrisFullmer, I would suggest that the Trial button get an red outline as large as the Purchase button.
(Ie, it doesn’t currently look like a button, and could be mistaken for a comment beneath the Purchase button.)


#6

Multiple call to action buttons is a bit unconventional but I still agree it could very well be styled like a button. Mixing links and buttons for similar elements make the pager harder to parse.

This is what the call to action and secondary button look like in the extension manager.

buttons


#7

The secondary button there is also disabled.


#8

Oh, my bad.

Anyway, this is what secondary buttons could look like. It’s clear what is the call to action, but also what elements are buttons.

I struggled quite a bit to find the secondary “buttons” myself in Generate Report, where they do not look anything like buttons (I even closed the whole window and re-launched the feature just to go back one step). I share Dan’s view that buttons should look like buttons.


#9

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.