Skip to content

[QUERY] Missing notifications on ios 13+ with apns #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
splatch opened this issue Apr 2, 2024 · 1 comment
Open
2 tasks done

[QUERY] Missing notifications on ios 13+ with apns #186

splatch opened this issue Apr 2, 2024 · 1 comment

Comments

@splatch
Copy link

splatch commented Apr 2, 2024

Query/Question
I have a notification hub which is able to deliver notifications for old iOS versions. I began updating gaps introduced by later releases of ios, but I can't get it to work.

My code is quite basic:

public class App {

  public static void main(String[] args) throws Exception {
    String hubId = "...";
    NotificationHub hub = new NotificationHub(
        "Endpoint=sb://...",
        hubId);

    Map<String, String> headers = new HashMap<>();
    headers.put("apns-push-type", "alert");
    headers.put("apns-priority", "10");

    String src = "{'aps': {'title': 'Alert notification', 'body': '" + LocalDateTime.now() + ", have (" + new Random().nextInt(10) + ") alerts'}}";
    String body = src.replaceAll("\'", "\"");

    Notification notification = Notification.createAppleNotification(body, headers);
    NotificationOutcome outcome = hub.sendNotification(notification, new HashSet<>(Arrays.asList("_valid_azure_device_tag_")));
    System.out.println(outcome.getNotificationId() + " " + outcome.getTrackingId());

    if (outcome.getNotificationId() != null) {
      NotificationTelemetry telemetry = hub.getNotificationTelemetry(outcome.getNotificationId());
      System.out.println(telemetry);
    }
  }

}

Why is this not a Bug or a feature Request?
I am not quite sure if above method is supported given #48 is closed. I do get a tracking id but no notification id. Repeating same operation via azure console returns "Successfully sent test message. Outcome: {0 passed, 0 failed}. Please see result section for details."

Setup (please complete the following information if applicable):

  • Notification-Hubs-java-sdk v 1.1.0
  • Java 11

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issue as an incomplete report. Please do not provide any private information in this bug report.

  • Query Added
  • Setup information Added
@splatch splatch changed the title [QUERY] Missing notifications on ios 13+ with apns do not work for iOS 13.x [QUERY] Missing notifications on ios 13+ with apns Apr 2, 2024
@splatch
Copy link
Author

splatch commented Apr 3, 2024

Diving more into issue I've found that registrations for new ios version have two "tags" while old one had just an uuid. When I use uuid format (value of the $UserId) then my notifications do not pass. If I use full format $UserId: xyz, they are dispatched properly. Kind of surprising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant