![JAR search and dependency download from the Maven repository](/logo.png)
com.windowsazure.messaging.MpnsNotification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Notification-Hubs-java-sdk Show documentation
Show all versions of Notification-Hubs-java-sdk Show documentation
Azure Notification Hubs Java SDK for interacting with the data and management plane operations.
The newest version!
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------
package com.windowsazure.messaging;
import org.apache.hc.core5.http.ContentType;
/**
* This class represents a Windows Phone notification.
*/
public class MpnsNotification extends Notification {
/**
* Creates a new instance of the MpnsNotification class.
* @param body The XML body for the Windows Phone PNS.
*/
public MpnsNotification(String body) {
this.body = body;
this.headers.put("ServiceBusNotification-Format", "windowsphone");
if (body.contains("")) {
this.headers.put("X-WindowsPhone-Target", "toast");
this.headers.put("X-NotificationClass", "2");
}
if (body.contains("")) {
this.headers.put("X-WindowsPhone-Target", "tile");
this.headers.put("X-NotificationClass", "1");
}
if (body.startsWith("<")) {
this.contentType = ContentType.APPLICATION_XML;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy