mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00

* fix the crash * chore: update MaterialComponents pod (#8176) * chore: update MaterialComponents pod * chore: remove copy of pod file in build script * chore: cut the 6.3.0 release (#8174) * hore: cut the 6.3.1 release * fix: handle fake attach after FragMgr is destroyed (#8200) * fix: check is disposed fragment is in the FragmentManager (#8201) * release: cut the 6.3.2 release Co-authored-by: hamidbsd <50081218+hamidbsd@users.noreply.github.com> Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com> Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { ios } from "./native-helper";
|
|
import {
|
|
write as traceWrite, categories as traceCategories, messageType as traceMessageType
|
|
} from "../trace";
|
|
|
|
export { ios };
|
|
export * from "./utils-common";
|
|
|
|
export function openFile(filePath: string): boolean {
|
|
try {
|
|
const appPath = ios.getCurrentAppPath();
|
|
const path = filePath.replace("~", appPath);
|
|
|
|
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
|
|
controller.delegate = <UIDocumentInteractionControllerDelegate>new ios.UIDocumentInteractionControllerDelegateImpl();
|
|
|
|
return controller.presentPreviewAnimated(true);
|
|
}
|
|
catch (e) {
|
|
traceWrite("Error in openFile", traceCategories.Error, traceMessageType.error);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
export function GC() {
|
|
__collect();
|
|
}
|
|
|
|
export function releaseNativeObject(object: NSObject) {
|
|
__releaseNativeCounterpart(object);
|
|
}
|
|
|
|
export function openUrl(location: string): boolean {
|
|
try {
|
|
const url = NSURL.URLWithString(location.trim());
|
|
if (UIApplication.sharedApplication.canOpenURL(url)) {
|
|
return UIApplication.sharedApplication.openURL(url);
|
|
}
|
|
}
|
|
catch (e) {
|
|
// We Don't do anything with an error. We just output it
|
|
traceWrite("Error in OpenURL", traceCategories.Error, traceMessageType.error);
|
|
}
|
|
|
|
return false;
|
|
}
|