File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Sources/InternalAWSPinpoint/Endpoint
Tests/InternalAWSPinpointUnitTests Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,10 @@ actor EndpointClient: EndpointClientBehaviour {
191
191
endpointProfile. effectiveDate. asISO8601String
192
192
}
193
193
194
- nonisolated private func getOptOut( from endpointProfile: PinpointEndpointProfile ) -> String {
194
+ nonisolated private func getOptOut( from endpointProfile: PinpointEndpointProfile ) -> String ? {
195
+ if endpointProfile. deviceToken == nil {
196
+ return nil
197
+ }
195
198
return endpointProfile. isOptOut ? EndpointClient . Constants. OptOut. all : EndpointClient . Constants. OptOut. none
196
199
}
197
200
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ class EndpointClientTests: XCTestCase {
188
188
XCTAssertEqual ( publicEndpoint. attributes? . count, 0 )
189
189
XCTAssertEqual ( publicEndpoint. metrics? . count, 0 )
190
190
XCTAssertNil ( publicEndpoint. channelType)
191
- XCTAssertEqual ( publicEndpoint. optOut, " NONE " )
191
+ XCTAssertNil ( publicEndpoint. optOut)
192
192
XCTAssertEqual ( publicEndpoint. demographic? . appVersion, mockModel. appVersion)
193
193
XCTAssertEqual ( publicEndpoint. demographic? . make, " apple " )
194
194
XCTAssertEqual ( publicEndpoint. demographic? . model, mockModel. model)
You can’t perform that action at this time.
0 commit comments