ralscha/blog

sw-push not works

Closed this issue · 1 comments

   void sendPushMessage(IcndbJoke joke) throws InterruptedException, ExecutionException {
    Map<String, String> data = new HashMap<>();
    data.put("id", String.valueOf(joke.getValue().getId()));
    data.put("joke", joke.getValue().getJoke());
    data.put("seq", String.valueOf(this.seq++));
    data.put("ts", String.valueOf(System.currentTimeMillis()));

    System.out.println("Sending chuck joke...");
    this.fcmClient.send(data);
}

These line errors: Cannot access getId() and cannot Access getJoke(), can you please help to check?

   data.put("id", String.valueOf(joke.getValue().getId()));
    data.put("joke", joke.getValue().getJoke());

Are IcndbJoke and PushChuckJokeService in the same package?
The class Joke is package protected.

You can change the visibility of the class to public
https://github.com/ralscha/blog/blob/master/sw-push/src/main/java/ch/rasc/swpush/IcndbJoke.java#L34

public static class Joke {