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:
Dave Miller 2016-02-10 09:25:30 -08:00 committed by facebook-github-bot-7
parent ab09ff53d4
commit d96a4ba94d
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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