mirror of
https://github.com/lampaa/com.lampa.startapp.git
synced 2024-10-06 15:52:06 +08:00
introduce 'go' method for iOS to launch app without calling canOpenURL for unwhitelisted custom schemes
This commit is contained in:
parent
116ad62b6d
commit
cecbb1e821
@ -4,5 +4,6 @@
|
||||
|
||||
- (void)check:(CDVInvokedUrlCommand*)command;
|
||||
- (void)start:(CDVInvokedUrlCommand*)command;
|
||||
- (void)go:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
@ -38,4 +38,21 @@
|
||||
|
||||
}
|
||||
|
||||
- (void)go:(CDVInvokedUrlCommand*)command {
|
||||
|
||||
CDVPluginResult* pluginResult = nil;
|
||||
|
||||
NSString* scheme = [command.arguments objectAtIndex:0];
|
||||
|
||||
if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:scheme]]) {
|
||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:(true)];
|
||||
}
|
||||
else {
|
||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsBool:(false)];
|
||||
}
|
||||
|
||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue
Block a user