Skip to content

Commit 3b183f7

Browse files
[webview_flutter_wkwebview] Return an NSNumber that represents a bool (#5968)
1 parent 1410600 commit 3b183f7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ - (void)testRemoveDataOfTypes {
7070
blockError = error;
7171
}];
7272
XCTAssertEqualObjects(returnValue, @YES);
73+
// Asserts whether the NSNumber will be deserialized by the standard codec as a boolean.
74+
XCTAssertEqual(CFGetTypeID((__bridge CFTypeRef)(returnValue)), CFBooleanGetTypeID());
7375
XCTAssertNil(blockError);
7476
}
7577
@end

packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebsiteDataStoreHostApi.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ - (void)createDefaultDataStoreWithIdentifier:(nonnull NSNumber *)identifier
6060
modifiedSince:[NSDate dateWithTimeIntervalSince1970:
6161
modificationTimeInSecondsSinceEpoch.doubleValue]
6262
completionHandler:^{
63-
completion(@(records.count > 0), nil);
63+
completion([NSNumber numberWithBool:(records.count > 0)], nil);
6464
}];
6565
}];
6666
}

0 commit comments

Comments
 (0)