app_mobile_ios.go 701 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //go:build !ci && ios
  2. // +build !ci,ios
  3. package app
  4. /*
  5. #cgo CFLAGS: -x objective-c
  6. #cgo LDFLAGS: -framework Foundation -framework UIKit -framework UserNotifications
  7. #include <stdlib.h>
  8. char *documentsPath(void);
  9. void openURL(char *urlStr);
  10. void sendNotification(char *title, char *content);
  11. */
  12. import "C"
  13. import (
  14. "net/url"
  15. "path/filepath"
  16. "unsafe"
  17. "fyne.io/fyne/v2"
  18. )
  19. func rootConfigDir() string {
  20. root := C.documentsPath()
  21. return filepath.Join(C.GoString(root), "fyne")
  22. }
  23. func (a *fyneApp) OpenURL(url *url.URL) error {
  24. urlStr := C.CString(url.String())
  25. C.openURL(urlStr)
  26. C.free(unsafe.Pointer(urlStr))
  27. return nil
  28. }
  29. func defaultVariant() fyne.ThemeVariant {
  30. return systemTheme
  31. }