Skip to content

Commit d924658

Browse files
committed
Fix license key bug.
1 parent ca240b0 commit d924658

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Shared/SamplesApp.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@ extension SamplesApp {
3737
/// a watermark on the map view).
3838
func license() {
3939
if let licenseStringLiteral = String.licenseKey,
40-
let licenseKey = LicenseKey(licenseStringLiteral),
41-
let extensionLicenseStringLiteral = String.extensionLicenseKey,
42-
let extensionLicenseKey = LicenseKey(extensionLicenseStringLiteral) {
43-
// Set both keys to access all samples, including utility network
44-
// capability.
45-
_ = try? ArcGISEnvironment.setLicense(with: licenseKey, extensions: [extensionLicenseKey])
40+
let licenseKey = LicenseKey(licenseStringLiteral) {
41+
// Sets the license with an extension if one is included. An
42+
// advanced editing extension is required to access all the samples,
43+
// such as ones with utility network capabilities.
44+
if let extensionLicenseStringLiteral = String.extensionLicenseKey,
45+
let extensionLicenseKey = LicenseKey(extensionLicenseStringLiteral) {
46+
_ = try? ArcGISEnvironment.setLicense(
47+
with: licenseKey,
48+
extensions: [extensionLicenseKey]
49+
)
50+
} else {
51+
_ = try? ArcGISEnvironment.setLicense(with: licenseKey)
52+
}
4653
}
4754
// Authentication with an API key or named user is required to access
4855
// basemaps and other location services.

0 commit comments

Comments
 (0)