Skip to content

Commit ffebe5c

Browse files
bparrishMinesyutaaraki-toydium
authored andcommitted
[webview_flutter_wkwebview] Return an NSNumber that represents a bool (flutter#5968)
1 parent 3bf0189 commit ffebe5c

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

+2
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

+1-1
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)