Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for newsstand notifications

Closes #51
  • Loading branch information...
commit 48655448c50503754f437c3d01c268169f8af644 1 parent ac7f264
Mahmood Ali authored
1  README.markdown
View
@@ -15,6 +15,7 @@ Features:
* Easy to use, high performance APNS Service API
* Supports Apple Feedback service
* Support Enhanced Apple Push Notification
+ * Support MDM and Newstand Notifications
* Easy to use with Apple certificates
* Easy to extend and reuse
* Easy to integrate with dependency injection frameworks
13 src/main/java/com/notnoop/apns/PayloadBuilder.java
View
@@ -142,6 +142,19 @@ public PayloadBuilder noActionButton() {
}
/**
+ * Sets the notification type to be a 'newstand' notification.
+ *
+ * A Newstand Notification targets the Newstands app so that the app
+ * updates the subscription info and content.
+ *
+ * @return this
+ */
+ public PayloadBuilder forNewsstand() {
+ aps.put("content-available", 1);
+ return this;
+ }
+
+ /**
* Set the notification localized key for the alert body
* message.
*
8 src/test/java/com/notnoop/apns/PayloadBuilderTest.java
View
@@ -419,5 +419,13 @@ public void supportsMDM() {
assertEqualsJson(expected, mdm);
}
+ @Test
+ public void supportsNewsstand() {
+ String news = APNS.newPayload().forNewsstand().toString();
+
+ String expected = "{\"aps\":{\"content-available\":1}}";
+ assertEqualsJson(expected, news);
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.