cagdasc/godot-location-plugin

support iOS

Closed this issue · 0 comments

What is the structure to add another platform?

Implement an interface? That would be easiest.

For example:

interface LocationTracker {
  fun start(callbacks: Any)
  fun stop()
}

// implementation for iOS platform
class LocationTrackerIOS : PlatformLocationTracker {
	fun start(callbacks: Any) {
		// todo: call into native
	}
	fun stop() {
		// todo: call into native
	}
}

This kotlin code would call into my Swift code for iOS. I could also expose public C methods if better.

Can you point me in the right direction? If better, maybe iOS should be a separate module? Idk how godot modules work yet.