About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
windows_tools
⚠️
windows_heavy_examples
⚠️
missing_linux_example
Summary:
The documentation page demonstrates a Windows bias by consistently presenting Windows (WNS, MPNS) examples and terminology before or more prominently than Linux/Android/iOS equivalents. Windows-specific notification types and credentials are shown first in code samples, and the sample links at the end are all Windows/.NET focused. There are no Linux-specific instructions, nor are there examples or references to Linux command-line tools or environments. The only build instruction ('mvn package') is platform-neutral, but otherwise, the documentation assumes familiarity with Windows notification systems and does not provide parity for Linux users.
Recommendations:
- Reorder examples to present cross-platform (Android/iOS) or platform-neutral examples before Windows-specific ones.
- Add explicit Linux/Unix usage notes or examples, such as running the SDK on Linux, or using Linux-based tools for related tasks (e.g., generating SAS tokens, managing storage).
- Include links to Linux/Android/iOS sample projects, not just Windows/.NET ones.
- Balance the coverage of notification platforms in code samples (e.g., show Android/iOS registration and notification examples before or alongside Windows examples).
- Mention that the SDK and examples work on Linux and provide troubleshooting tips for common Linux environments.
Create pull request
Flagged Code Snippets
NotificationHubDescription hub = new NotificationHubDescription("hubname");
hub.setWindowsCredential(new WindowsCredential("sid","key"));
hub = namespaceManager.createNotificationHub(hub);
WindowsRegistration reg = new WindowsRegistration(new URI(CHANNELURI));
reg.getTags().add("myTag");
reg.getTags().add("myOtherTag");
hub.createRegistration(reg);
WindowsTemplateRegistration reg = new WindowsTemplateRegistration(new URI(CHANNELURI), WNSBODYTEMPLATE);
reg.getHeaders().put("X-WNS-Type", "wns/toast");
hub.createRegistration(reg);
String id = hub.createRegistrationId();
WindowsRegistration reg = new WindowsRegistration(id, new URI(CHANNELURI));
hub.upsertRegistration(reg);
Notification n = Notification.createWindowsNotification("WNS body");
hub.sendNotification(n, "InstallationId:{installation-id}");
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, 1);
Notification n = Notification.createWindowsNotification("WNS body");
hub.scheduleNotification(n, c.getTime());
String toast = "<toast><visual><binding template=\"ToastText01\"><text id=\"1\">Hello from Java!</text></binding></visual></toast>";
Notification n = Notification.createWindowsNotification(toast);
hub.sendNotification(n);
String toast = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>Hello from Java!</wp:Text1>" +
"</wp:Toast> " +
"</wp:Notification>";
Notification n = Notification.createMpnsNotification(toast);
hub.sendNotification(n);