1
グルーオンでアンドロイド通知を使用するにはどうすればよいですか? 以下のコードを使用しましたが、通知は実行されません。 LocalNotificationサービスが見つからないことがありますか?グロンアンドロイド通知が実行されない
Services.get(LocalNotificationsService.class).ifPresent(service
->
{
service.getNotifications().add(new Notification(
notificationId, "Sample Notification Text",
ZonedDateTime.now().plusSeconds(10),()
->
{
Alert alert = new Alert(AlertType.INFORMATION,
"You have been notified!");
Platform.runLater(() -> alert.showAndWait());
}));
});
manifiest:あなたはアンドロイドのものを追加していない、あなたの依存関係のリストに基づいて
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.gluonhq:charm:4.2.0'
compile 'com.gluonhq:charm-down-common:2.0.1'
compile group: 'com.gluonhq', name: 'charm-down-plugin-local-notifications', version: '3.1.0'
compile 'org.apache.commons:commons-lang3:3.5'
desktopRuntime 'org.xerial:sqlite-jdbc:3.15.1'
androidRuntime 'org.sqldroid:sqldroid:1.0.3'
}
あなたはあなたのために働いていないものを指定することはできますか?私はちょうどあなたのコードをテストして、それは私のためにうまくいく(私はマニフェストからサービスを削除した)。 build.gradleファイルのプラグインリストに '' local-notifications''を追加してください。 –
コンパイルグループ 'com.gluonhq'、名前: 'charm-down-plugin-local-notifications'、バージョン: '3.1.0'を追加しましたが、動作しません – user2880318
プラグインを追加する必要はありません。自分のためにやれ。あなたの 'build.gradle'ファイルを投稿し、あなたの依存関係に' charm-down-plugin-local-notifications-android-3.1.0.jar'があるかどうかを確認してください。 –