javapns.notification.management.APNPayload Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javapns-jdk16 Show documentation
Show all versions of javapns-jdk16 Show documentation
Library to send notifications using APNS
package javapns.notification.management;
import java.util.*;
import org.json.*;
/**
* An MDM payload for APN (Access Point Name).
*
* @author Sylvain Pedneault
*/
public class APNPayload extends MobileConfigPayload {
public APNPayload(int payloadVersion, String payloadOrganization, String payloadIdentifier, String payloadDisplayName, Map defaultsData, String defaultsDomainName, Map[] apns, String apn, String username) throws JSONException {
super(payloadVersion, "com.apple.apn.managed", payloadOrganization, payloadIdentifier, payloadDisplayName);
JSONObject payload = getPayload();
payload.put("DefaultsData", defaultsData);
payload.put("defaultsDomainName", defaultsDomainName);
for (Map apnsEntry : apns)
payload.put("apns", apnsEntry);
payload.put("apn", apn);
payload.put("username", username);
}
public void setPassword(APNPayload value) throws JSONException {
getPayload().put("password", value);
}
public void setProxy(String value) throws JSONException {
getPayload().put("proxy", value);
}
public void setProxyPort(int value) throws JSONException {
getPayload().put("proxyPort", value);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy