feat: Move over the service/background service API
This commit is contained in:
25
pigeon/background_service.dart
Normal file
25
pigeon/background_service.dart
Normal 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
23
pigeon/service.dart
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user