diff --git a/app/app_mobile_ios.go b/app/app_mobile_ios.go index 82b8d25f49..833ae4fdfa 100644 --- a/app/app_mobile_ios.go +++ b/app/app_mobile_ios.go @@ -8,7 +8,6 @@ package app #include -char *documentsPath(void); void openURL(char *urlStr); void sendNotification(char *title, char *content); */ diff --git a/app/app_mobile_ios.m b/app/app_mobile_ios.m index d1e6ab48b6..bfdbfebef0 100644 --- a/app/app_mobile_ios.m +++ b/app/app_mobile_ios.m @@ -8,8 +8,3 @@ void openURL(char *urlStr) { [app openURL:url options:@{} completionHandler:nil]; } -char *documentsPath() { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *path = paths.firstObject; - return [path UTF8String]; -} diff --git a/internal/app/config_mobile_ios.go b/internal/app/config_mobile_ios.go index 193063e76b..0516fe1c10 100644 --- a/internal/app/config_mobile_ios.go +++ b/internal/app/config_mobile_ios.go @@ -6,6 +6,13 @@ import ( "path/filepath" ) +/* +#include + +char *documentsPath(void); +*/ +import "C" + func rootConfigDir() string { root := C.documentsPath() return filepath.Join(C.GoString(root), "fyne") diff --git a/internal/app/config_mobile_ios.m b/internal/app/config_mobile_ios.m new file mode 100644 index 0000000000..059005aa8a --- /dev/null +++ b/internal/app/config_mobile_ios.m @@ -0,0 +1,9 @@ +//go:build !ci && ios + +#import + +char *documentsPath() { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *path = paths.firstObject; + return [path UTF8String]; +} \ No newline at end of file