Documentation
¶
Overview ¶
Package mobile is the gomobile-bind entry point used by the iOS Swift app and the Android app. It wraps internal/web.Server so the HTTP server runs in-process via a JNI .so — no subprocess, no exec from nativeLibraryDir, no PIE/page-size/SELinux pitfalls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageNotifier ¶ added in v0.25.9
type MessageNotifier interface {
OnNewMessages(count int)
}
MessageNotifier is implemented on the native side (Kotlin/Swift). The Go background chat poll loop calls OnNewMessages when it discovers new messages, so the native app can post a system notification while it's backgrounded (the in-app, foreground case is handled by the web UI). The implementation must be cheap and non-blocking — it runs on a Go poll goroutine.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a running thefeed-client instance bound to 127.0.0.1.
func NewAndroidServer ¶ added in v0.20.0
NewAndroidServer is NewServer for per-ABI APK builds: the update prompt points at the matching ABI asset.
func NewAndroidUniversalServer ¶ added in v0.20.0
NewAndroidUniversalServer is NewServer for the universal APK build: the update prompt keeps the user on the universal asset.
func NewServer ¶
NewServer starts a server on 127.0.0.1. preferredPort=0 picks a kernel-assigned port; a positive value is tried first and falls back to kernel-assigned on bind failure. dataDir must be a writable app-private directory (e.g. NSDocumentDirectory on iOS).
func (*Server) SetMessageNotifier ¶ added in v0.25.9
func (s *Server) SetMessageNotifier(n MessageNotifier)
SetMessageNotifier registers (or, with nil, clears) the native new-message notifier. Safe to call after the server is running.