feat: Move over the service/background service API

This commit is contained in:
2023-09-09 00:28:01 +02:00
parent 42ff70a966
commit dfbb64c8ae
19 changed files with 1137 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/pigeon/background_service.g.dart',
kotlinOut:
'android/src/main/kotlin/org/moxxy/moxxy_native/service/background/BackgroundServiceApi.kt',
kotlinOptions: KotlinOptions(
package: 'org.moxxy.moxxy_native.service.background',
),
),
)
@HostApi()
abstract class MoxxyBackgroundServiceApi {
int getHandler();
String getExtraData();
void setNotificationBody(String body);
void sendData(String data);
void stop();
}

23
pigeon/service.dart Normal file
View File

@@ -0,0 +1,23 @@
import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/pigeon/service.g.dart',
kotlinOut:
'android/src/main/kotlin/org/moxxy/moxxy_native/service/ServiceApi.kt',
kotlinOptions: KotlinOptions(
package: 'org.moxxy.moxxy_native.service',
),
),
)
@HostApi()
abstract class MoxxyServiceApi {
void configure(int handle, String extraData);
bool isRunning();
void start();
void sendData(String data);
}