Comments (5)
Yes, I am doing exactly like above, what you mentioned
notification.headers.put("ServiceBusNotification-Apns-Expiry", expiryString);
notification.headers.put("apns-push-type", "alert");
notification.headers.put("apns-priority", "10");
I have printed the same in the log before sending the push notification also.
{apns-push-type=alert, ServiceBusNotification-Apns-Expiry=10/23/2019 03:35:56, ServiceBusNotification-Format=apple, apns-priority=10}
It gives tracking id as 0d104017-4d70-44d3-86c6-ee9581157bf0
but I don't get any push notification, i have iOS 13.x apple device.
from azure-notificationhubs-java-backend.
@avramanaareddy can you provide a link to the StackOverflow post?
Have you tried setting the apns-priority
value to 10
? As per Apple documentation, a value of 10
is appropriate for "alert" notifications. Notifications sent with a value of 5
are subject to batching, throttling, or being dropped.
Your code snippet is referencing a private member of the Notification
class:
notification.headers.put(...);
Are you instead using the following?
notification.getHeaders().put(...);
from azure-notificationhubs-java-backend.
Let me try
from azure-notificationhubs-java-backend.
Is there any update?, I'm having same issue
from azure-notificationhubs-java-backend.
Cannot reproduce the issue. Complete with verified code:
package com.microsoft.azure;
import com.windowsazure.messaging.*;
import java.util.HashMap;
import java.util.Map;
class Program {
public static void main(String [] arguments) {
String connectionString = "xxxx";
String hubName = "xxxx";
String apnsBody = "{\"aps\":{\"alert\":\"Notification Hub test notification\"}}";
Map<String, String> headers = new HashMap<>();
headers.put("ServiceBusNotification-Format", "apple");
headers.put("apns-push-type", "alert");
headers.put("apns-priority", "5");
headers.put("ServiceBusNotification-DeviceHandle", "xxxx");
NotificationHubClient client = new NotificationHub(connectionString, hubName);
Notification n = Notification.createAppleNotification(apnsBody, headers);
try {
NotificationOutcome outcome = client.sendNotification(n);
System.out.println("Tracking ID: " + outcome.getTrackingId());
} catch (NotificationHubsException e) {
e.printStackTrace();
}
}
This works with both apns-priority
set to 5
or 10
.
from azure-notificationhubs-java-backend.
Related Issues (20)
- When trying making a new NotificationHub programmatically, it causes 401 Unauthorized Error. HOT 1
- [BUG] 400 Bad Request when exporting registrations HOT 1
- iOS not receiving pending push after turn on Internet from Azure Notification Hub
- extra dependency needed: org.apache.httpcomponents.client5 httpclient5 HOT 2
- [BUG] : java.lang.RuntimeException: org.apache.hc.core5.http.ParseException: Invalid protocol version; error at offset 0: <[0x2e][0x2f][0x30][0x31][0x32][0x33][0x34][0x35][0x36][0x37][0x38][0x39][0x3a][0x3b][0x3c][0x3d][0x3e]> HOT 4
- [BUG] sendDirectNotification for batch of devices is returning 500 status for FCM notifications HOT 1
- [BUG] Notification Hubs incompatible with Spring? java.lang.RuntimeException: org.apache.hc.core5.http.ParseException: Invalid protocol version; error at offset 0: <[0x2e][0x2f][0x30][0x31][0x32][0x33][0x34][0x35][0x36][0x37][0x38][0x39][0x3a][0x3b][0x3c][0x3d][0x3e]> HOT 1
- [BUG] Caused by: java.lang.ClassNotFoundException: org.apache.hc.client5.http.entity.mime.ContentBody with 1.0.4 of azure notificationhub sdk HOT 1
- Unable to successfully send android notification HOT 1
- [BUG] Connection closed while dispatching a push notification
- [BUG] Get a notification hub by the hub path not working HOT 2
- [QUERY] Missing notifications on ios 13+ with apns HOT 1
- [BUG] Can not send message to Baidu PNS server.
- XML Injection for all registrations HOT 4
- Can't send UWP notification when toast tag with parameters HOT 5
- Getting 401 - Invalid token HOT 1
- Error: 400 Bad Request - notificationhub job payload is invalid HOT 2
- NotificationHub.createOrUpdateInstallation got Internal server error. HOT 3
- Bintray and JCenter Decommissioning HOT 3
- createWindowsNotification doesn't add X-WNS-Type header when the message body has xml prolog HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-notificationhubs-java-backend.