Skip to content

Commit 117a0a3

Browse files
authored
Merge pull request #1250 from Esri/v.next
200.8 Release
2 parents 472d484 + 0f32d99 commit 117a0a3

File tree

225 files changed

+9557
-5799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+9557
-5799
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## App Secrets
2+
.secrets
3+
14
.DS_Store
25
/.build
36
xcuserdata/

.swiftpm/xcode/xcshareddata/xcschemes/arcgis-runtime-toolkit-swift.xcscheme

Lines changed: 0 additions & 120 deletions
This file was deleted.

Tests/ArcGISToolkitTests/APIKey.swift renamed to AppSecrets.swift.masque

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Esri
1+
// Copyright 2025 Esri
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -15,6 +15,6 @@
1515
import ArcGIS
1616

1717
extension APIKey {
18-
/// The default API key.
19-
static let `default` = APIKey("<#API Key#>")
18+
/// The API key for development of the package and projects in this repository.
19+
static let development = APIKey("{{ ARCGIS_API_KEY_DEVELOPMENT }}")
2020
}

AuthenticationExample/AuthenticationExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,12 @@
349349
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
350350
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
351351
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
352+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
352353
LD_RUNPATH_SEARCH_PATHS = (
353354
"$(inherited)",
354355
"@executable_path/Frameworks",
355356
);
356-
MARKETING_VERSION = 200.7.0;
357+
MARKETING_VERSION = 200.8.0;
357358
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
358359
PRODUCT_NAME = "$(TARGET_NAME)";
359360
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
@@ -386,11 +387,12 @@
386387
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
387388
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
388389
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
390+
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
389391
LD_RUNPATH_SEARCH_PATHS = (
390392
"$(inherited)",
391393
"@executable_path/Frameworks",
392394
);
393-
MARKETING_VERSION = 200.7.0;
395+
MARKETING_VERSION = 200.8.0;
394396
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
395397
PRODUCT_NAME = "$(TARGET_NAME)";
396398
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";

AuthenticationExample/AuthenticationExample/AuthenticationApp.swift

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ import SwiftUI
1818

1919
@main
2020
struct AuthenticationApp: App {
21-
@StateObject private var authenticator = Authenticator(
22-
// If you want to use OAuth, uncomment this code:
23-
// oAuthUserConfigurations: [.arcgisDotCom]
24-
)
21+
@StateObject private var authenticator = Authenticator()
2522

2623
@State private var isSettingUp = true
2724

@@ -43,6 +40,10 @@ struct AuthenticationApp: App {
4340
.authenticator(authenticator)
4441
.task {
4542
isSettingUp = true
43+
// If you want to use OAuth, uncomment this code:
44+
// authenticator.oAuthUserConfigurations.append(.oAuthUserConfiguration)
45+
// If you want to use Identity-Aware Proxy (IAP), uncomment this code:
46+
// try? await authenticator.iapConfigurations.append(.iapConfiguration)
4647
ArcGISEnvironment.authenticationManager.handleChallenges(using: authenticator)
4748
// Here we setup credential stores to be persistent, which means that it will
4849
// synchronize with the keychain for storing credentials.
@@ -58,7 +59,7 @@ struct AuthenticationApp: App {
5859

5960
private extension OAuthUserConfiguration {
6061
// If you want to use OAuth, uncomment this code:
61-
// static let arcgisDotCom = OAuthUserConfiguration(
62+
// static let oAuthUserConfiguration = OAuthUserConfiguration(
6263
// portalURL: .portal,
6364
// clientID: "<#Your client ID goes here#>",
6465
// // Note: You must have the same redirect URL used here
@@ -68,6 +69,17 @@ private extension OAuthUserConfiguration {
6869
// )
6970
}
7071

72+
private extension IAPConfiguration {
73+
// If you want to use Identity-Aware Proxy (IAP), uncomment this code:
74+
// static var iapConfiguration: IAPConfiguration {
75+
// get async throws {
76+
// try await .configuration(
77+
// from: URL(filePath: "/path/to/IAP configuration/file.json")!
78+
// )
79+
// }
80+
// }
81+
}
82+
7183
extension URL {
7284
// If you want to use your own portal, provide your own URL here:
7385
static let portal = URL(string: "https://www.arcgis.com")!

AuthenticationExample/AuthenticationExample/HomeView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ struct HomeView: View {
3737
.sheet(isPresented: $showProfile) {
3838
ProfileView(portal: portal) {
3939
self.portal = nil
40+
self.showProfile = false
4041
}
4142
}
4243
}

AuthenticationExample/AuthenticationExample/ProfileView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ struct ProfileView: View {
7272
func signOut() {
7373
isSigningOut = true
7474
Task {
75-
await ArcGISEnvironment.authenticationManager.revokeOAuthTokens()
76-
await ArcGISEnvironment.authenticationManager.clearCredentialStores()
75+
await ArcGISEnvironment.authenticationManager.signOut()
7776
isSigningOut = false
7877
signOutAction()
7978
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configure App Secrets
2+
3+
As a best-practice principle, our project conceals app secrets from source code by generating and compiling an `AppSecrets.swift` source code file at build time using a custom build rule. The same pattern can be applied to your app development as well.
4+
5+
This build rule looks for a secrets file stored in the toolkit's root directory, `/.secrets`.
6+
7+
Note: License strings are not required for development. When no license or an invalid license key is applied, an app will fall back to Developer Mode (which will display a watermark on the map and scene views). Apply the license strings when your app is ready for deployment.
8+
9+
1. Create a hidden secrets file in your project's root directory.
10+
11+
```sh
12+
touch .secrets
13+
```
14+
15+
2. Add your **API Key** access token to the secrets file.
16+
17+
```sh
18+
echo ARCGIS_API_KEY_DEVELOPMENT=your-api-key >> .secrets
19+
```
20+
21+
> Replace 'your-api-key' with your keys.
22+
23+
Visit the developer's website to learn more about [Deployment](https://developers.arcgis.com/swift/license-and-deployment/) and [Security and authentication](https://developers.arcgis.com/documentation/security-and-authentication/).
24+
25+
To learn more about `masquerade`, consult the [documentation](https://github.com/Esri/data-collection-ios/tree/main/docs#masquerade) of Esri's Data Collection app.

0 commit comments

Comments
 (0)