Right way to start gomobile in IOS

203 views
Skip to first unread message

Higherous

unread,
Aug 25, 2021, 4:31:31 PM8/25/21
to golang-nuts
Hello all.  How do I need to start my server written in Go and used in the iOS app?
I tried as in many tutorials, just

ServerStartArg("8090", documentDirectory[0])

This starts the server, but the application freezes.

Next, tried  to do this in background thread

DispatchQueue.global(qos: .background).async {

          ServerStartArg("8090", documentDirectory[0])

}

The server starts and the application works. But there is a problem. When application un tray (not opened, but also not closed) server don't respond

And here's is a question: How to start a server without these two problems?

ma...@eliasnaur.com

unread,
Aug 28, 2021, 3:39:35 AM8/28/21
to golang-nuts

"Return from applicationDidEnterBackground: as quickly as possible. Your implementation of this method has approximately five seconds to perform any tasks and return. If the method doesn’t return before time runs out, your app is terminated and purged from memory."

Elias
Reply all
Reply to author
Forward
0 new messages