Minor fixes to clipboard and Linking to remove TODOs
Reviewed By: nicklockwood Differential Revision: D2921782 fb-gh-sync-id: e387b720421ed6ed03a50633d71e08791f87c761 shipit-source-id: e387b720421ed6ed03a50633d71e08791f87c761
This commit is contained in:
parent
ab09ff53d4
commit
d96a4ba94d
|
@ -77,10 +77,8 @@ RCT_EXPORT_METHOD(openURL:(NSURL *)URL
|
|||
resolve:(RCTPromiseResolveBlock)resolve
|
||||
reject:(__unused RCTPromiseRejectBlock)reject)
|
||||
{
|
||||
// TODO: we should really report success/failure via the promise here
|
||||
// Doesn't really matter what thread we call this on since it exits the app
|
||||
[RCTSharedApplication() openURL:URL];
|
||||
resolve(@YES);
|
||||
BOOL opened = [RCTSharedApplication() openURL:URL];
|
||||
resolve(@(opened));
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL
|
||||
|
|
|
@ -26,14 +26,14 @@ RCT_EXPORT_MODULE()
|
|||
RCT_EXPORT_METHOD(setString:(NSString *)content)
|
||||
{
|
||||
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
|
||||
clipboard.string = content;
|
||||
clipboard.string = (content ? : @"");
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(getString:(RCTPromiseResolveBlock)resolve
|
||||
rejecter:(__unused RCTPromiseRejectBlock)reject)
|
||||
{
|
||||
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
|
||||
resolve(RCTNullIfNil(clipboard.string));
|
||||
resolve((clipboard.string ? : @""));
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue