File tree 4 files changed +15
-5
lines changed
source/examples/generated/code/start 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -109,11 +109,17 @@ class RealmAppTest: XCTestCase {
109
109
let configuration = AppConfiguration ( baseURL: " http://localhost:80 " )
110
110
let edgeApp = App ( id: EDGE_SERVER_APP_ID, configuration: configuration)
111
111
112
+ // You can check the `baseURL` of an app to define app logic.
113
+ if edgeApp. baseURL == " http://localhost:80 " {
114
+ print ( " Client app is currently connected to a local Edge Server instance " )
115
+ }
116
+ XCTAssertEqual ( edgeApp. baseURL, " http://localhost:80 " ) // :remove:
112
117
// ... log in a user and use the app...
113
118
// ... some time later...
114
119
115
120
try await edgeApp. updateBaseUrl ( to: " https://services.cloud.mongodb.com " )
116
121
// :snippet-end:
122
+ XCTAssertEqual ( edgeApp. baseURL, " https://services.cloud.mongodb.com " )
117
123
let user = try await edgeApp. login ( credentials: Credentials . anonymous)
118
124
XCTAssertNotNil ( user)
119
125
XCTAssert ( user. isLoggedIn)
Original file line number Diff line number Diff line change 1499
1499
isa = XCRemoteSwiftPackageReference;
1500
1500
repositoryURL = "https://github.com/realm/realm-swift.git";
1501
1501
requirement = {
1502
- kind = exactVersion ;
1503
- version = 10.49.3 ;
1502
+ kind = upToNextMajorVersion ;
1503
+ minimumVersion = 10.50.1 ;
1504
1504
};
1505
1505
};
1506
1506
917CA79427ECADC200F9BDDC /* XCRemoteSwiftPackageReference "facebook-ios-sdk" */ = {
Original file line number Diff line number Diff line change 1
1
// Specify a baseURL to connect to a server other than the default.
2
2
// In this case, an Edge Server instance running on the device.
3
3
let configuration = AppConfiguration ( baseURL: " http://localhost:80 " )
4
- let app = App ( id: YOUR_APP_SERVICES_APP_ID , configuration: configuration)
4
+ let edgeApp = App ( id: EDGE_SERVER_APP_ID , configuration: configuration)
5
5
6
+ // You can check the `baseURL` of an app to define app logic.
7
+ if edgeApp. baseURL == " http://localhost:80 " {
8
+ print ( " Client app is currently connected to a local Edge Server instance " )
9
+ }
6
10
// ... log in a user and use the app...
7
11
// ... some time later...
8
12
9
- try await app . updateBaseUrl ( to: " https://services.cloud.mongodb.com " )
13
+ try await edgeApp . updateBaseUrl ( to: " https://services.cloud.mongodb.com " )
Original file line number Diff line number Diff line change 2
2
// In this case, an Edge Server instance running on the device.
3
3
let configuration = AppConfiguration ( baseURL: " http://localhost:80 " )
4
4
5
- let app = App ( id: EDGE_SERVER_APP_ID, configuration: configuration)
5
+ let edgeApp = App ( id: EDGE_SERVER_APP_ID, configuration: configuration)
You can’t perform that action at this time.
0 commit comments