web-push-libs / webpush-java

Web Push library for Java
MIT License
315 stars 113 forks source link

Requires parameters that aren't provided by client side #199

Open Oberonc opened 1 year ago

Oberonc commented 1 year ago

This library force the user to get 2 parameters from the client side that simply dont exist in other implementations:

// Get public key and user auth from the subscription object
    var key = subscription.getKey ? subscription.getKey('p256dh') : '';
    var auth = subscription.getKey ? subscription.getKey('auth') : '';

For example, nothing about these parameters shows here. In Elemental2 there is no "getKey" in the API as seen here:

@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public class PushSubscription {
  public String endpoint;
  public PushSubscriptionOptions options;
  public String subscriptionId;

  public native Promise<Boolean> unsubscribe();
}