Skip to content

FIX: Point the examples at contact-us when a key lacks a paid property - #303

Merged
jwrosewell merged 3 commits into
rcfrom
fix/examples-contact-us
Dec 5, 2026
Merged

jwrosewell merged 3 commits into
rcfrom
fix/examples-contact-us

Conversation

@Rakesh51D

@Rakesh51D Rakesh51D commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

The examples now meet the examples' rules for a key, a paid property, and the closing section.

  • The cloud examples (Device Detection getting started, metadata, minimal, and IP Intelligence get all properties and metadata) ask for a property only a paid Resource Key returns. Where the key's known properties lack it, one message names the missing properties, says a paid key needs them added on the configuration page, and gives the link to contact us about a paid key.
  • The Human Confidence web example, run with no key, says how to get one and exits cleanly, and ends with the Find out more section on the console and on its page.
  • The location web examples read the key from _51DEGREES_RESOURCE_KEY rather than a placeholder in their configuration file, start with no key and say how to get one, run from the repository root, and end with Find out more. The location console examples give the same paid property message. Their pages label Country and County correctly and no longer fail on empty location data.
  • The client-side element web example finds its web application folder from any folder and ends with Find out more.

New tests check each message and link, using stand-in cloud answers for a free and a paid key, and that nothing is said about paid properties when the key's property list could not be read. Every example link now carries the five campaign tags. Everything builds with JDK 17 with every warning as an error, the changed tests pass, and the link lint passes.

Rakesh51D and others added 3 commits December 5, 2026 07:59
…y, and start every example from the repository root
…urns

A free resource key returns IsMobile and DeviceType. It does not
return PlatformName, PlatformVersion, BrowserName, BrowserVersion,
HardwareVendor, or HardwareName, which start with the lowest paid plan.
The examples had this the wrong way around in two places. They called
DeviceType paid, and GettingStartedCloud read the platform and browser
values straight off the result, so with a free key it stopped with an
error before it reached the paid note.

GettingStartedCloud now gives the six paid properties the same
handling the hardware ones had, so a free key prints "needs a paid
Resource Key" for each and the note lists them, and it prints Device
Type as an ordinary value. The paid list in DataFileHelper, which
MetadataCloud also uses, is now those six.

MinimalExample goes back to printing IsMobile only, as it did before
this pull request. Its DeviceType check was only there because
DeviceType was thought to be paid.

The javadoc of the configuration page constant, the class comment of
GettingStartedCloud, and the message for a missing test key no longer
say the page gives a free key with every property the examples use.
The javadoc also says that the paid ones need a License Key.

The stand-in's free key now lists IsMobile and DeviceType, and the
tests check the new output.
@jwrosewell
jwrosewell marked this pull request as ready for review December 5, 2026 14:53
@jwrosewell
jwrosewell merged commit 2f724a1 into rc Dec 5, 2026
9 checks passed
@jwrosewell
jwrosewell deleted the fix/examples-contact-us branch December 5, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants