Skip to content

Commit fa0dbdd

Browse files
iOS: Fixes #12331: Fix sharing to Joplin (#12334)
1 parent 77a07c9 commit fa0dbdd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/app-mobile/ios/ShareExtension/Source/ShareExtension/ShareViewController.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,18 @@ - (void)launchMainApp {
132132
UIResponder* responder = self;
133133
while (responder != nil) {
134134
if ([responder respondsToSelector:selector]) {
135-
[responder performSelector:selector withObject:[NSURL URLWithString:ShareExtensionShareURL]];
135+
UIApplication *app = (UIApplication*) responder;
136+
NSURL *url = [NSURL URLWithString:ShareExtensionShareURL];
137+
[app openURL:url options:@{} completionHandler:^(BOOL success) {
138+
if (success) {
139+
NSLog(@"Opened URL successfully!");
140+
} else {
141+
NSLog(@"Failed to open URL.");
142+
}
143+
}];
136144
break;
137145
}
138-
146+
139147
responder = responder.nextResponder;
140148
}
141149
}

0 commit comments

Comments
 (0)