I am trying to add a custom capacitor plugin to my android app. Works for iOS, currently I am integrating it into android.
I am no Java developer, my Java knowledge is fairly old.
The build step of the app that builds the plugin alongside throws
request.addOnCompleteListener(task -> {
^
(use -source 8 or higher to enable lambda expressions)
- Where can I amp up my Java version to 8 in my ionic project to build with lambdas? Where is that version set? I can not find the maven config (if that is related).
- How could I make this compatible with
-source 7
?
Activity activity = this.cordova.getActivity();
ReviewManager manager = ReviewManagerFactory.create(activity);
Task<ReviewInfo> request = manager.requestReviewFlow();
request.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
ReviewInfo reviewInfo = task.getResult();
Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo);
flow.addOnCompleteListener(launchTask -> {
if (task.isSuccessful()) {
callbackContext.success();
} else {
Exception error = task.getException();
callbackContext.error("Failed to launch review - " + error.getMessage());
}
});
} else {
Exception error = task.getException();
callbackContext.error("Failed to launch review flow - " + error.getMessage());
}
});
This is a cross post on SO
The code is essentially the bare google api example