This version is a major rewrite of the library and adds support for the full REST API, including Notifications, Subscriptions, Projects and Senders.
This version has some breaking changes:
- The recommended installation method has changed: the library is now available on Maven Central (use Maven/Gradle instead of downloading the JAR manually).
- Dropped the dependency on
JSON.simpleand usingJacksoninstead (it is included inpom.xmlas a dependency). - Imports are now split across domain packages (e.g.
xyz.pushpad.notification,xyz.pushpad.subscription), so update imports accordingly. - When you create a client with
new Pushpad(...), theprojectIdargument is now aLonginstead of aString(or you can omit it and pass the project id per request). Notificationis now used only for API responses, not for API requests. To create / send a notification, usepushpad.notifications().create(new NotificationCreateParams().setBody("Hello")).- The
deliverTo()/broadcast()methods were removed; set.setUids(...)and.setTags(...)onNotificationCreateParamsinstead. - Arrays like
uids,tags, andcustomMetricsare nowListvalues (e.g.setUids(List.of("user1"))). - Action buttons are now
setActions(List.of(new NotificationActionParams()...))instead ofActionButton[]. - Numeric fields like
ttlnow useLong(e.g.setTtl(604800L)). - Time fields like
sendAtnow useOffsetDateTimeinstead ofInstant. - The response to the creation of a notification is now a
NotificationCreateResponseinstead of aJSONObject(use getters likegetId(),getScheduled(),getUids(),getSendAt()). - Errors are now raised as
ApiException(HTTP errors) orPushpadException(network/other), instead ofDeliveryException.