Giter VIP home page Giter VIP logo

Comments (4)

brannon avatar brannon commented on June 2, 2024

Hi @timnot90, moving from certificate-based auth to token-based auth should "just work". We would need more information in order to investigate your issue. Can you create a support request in the Azure Portal for this? When viewing your Hub resource, you can click "New support request" in the left menu. That will route to the service team.

Thanks!

from azure-notificationhubs-dotnet.

timnot90 avatar timnot90 commented on June 2, 2024

Hi @brannon, thanks for your fast reply.

Since we're currently not production ready with our product, we don't have a subscription plan which allows us to ask for technical support.

But I don't think that the problem is on our side, because:

  • When using certificate-based authentication, our coding works as expected. => Our coding cannot cause the problem.
  • After switching to token-based authentication, the "Test Send" on the Azure portal still works. => The APNs, our Notification Hub instance and the client devices should be configured correctly.
  • I was even able to send a notification manually using the REST API.

Therefore it appears to me that the only party left is the Notification Hub SDK.

from azure-notificationhubs-dotnet.

timnot90 avatar timnot90 commented on June 2, 2024

After some more debugging, I now finally managed to get it running.

It seems that the "apns-topic" header breaks the request. As soon as I remove it, the request passes.

Which is interesting, because when we send the request directly to APNs with the following curl command, it's working.

curl --verbose \ --header "content-type: application/json" \ --header "authorization: bearer $jwt" \ --header "apns-topic: $bundleId" \ --data "$payload" \ $endpoint/3/device/$deviceToken

In the documentation of Notification Hub I cannot find any hint that there should be some special treatment for this header.

Do you have any idea why you cannot set the header and what you can do instead? I cannot find any property on an AppleNotification or something similar.

from azure-notificationhubs-dotnet.

timnot90 avatar timnot90 commented on June 2, 2024

Just stumbled over the following stackoverflow question: https://stackoverflow.com/a/44115101

It seems that Notification Hub internally sets the apns-topic header according to the configuration you make on the portal.

I guess the documentation for token-based authentication should include this little detail. :-)

from azure-notificationhubs-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.