Server to Phonegap push: SignalR vs Azure Notification Hub

前端 未结 1 546
野的像风
野的像风 2021-02-05 20:51

Well, I\'m in a kind of a dilemma to go on with my Phonegap application development: for real time event notification, should I go with Azure Notification Hub or SignalR?

相关标签:
1条回答
  • 2021-02-05 21:08

    Both technologies have their pros and cons on mobile platforms:

    SignalR

    Pros:

    • Well suited for real-time delivery where time or receiving notifications from the server is important.
    • Web clients are supported by all major browsers, IE8+, FireFox, Chrome, Safari and Android WebView, iOS Safari, IE mobile, so they are working well.
    • Solution could be written in JS, without need for the knowing

    Cons:

    • Required dedicated server, but possible hosting with shared hosting probably, since not performance hungry.
    • In Cordova particularly requires manual connection management for better user experience, instead of relying on the re-connection mechanism which SignalR provides (This is required for iOS which could drop network connection for battery preserving, on Android not an issue so far).
    • It has a known issue with Safari on iOS (which needs to run with long polling configuration, you can find more on that issue here) which - on real world scenarios with frequent ajax requests - forces you to use a different IP address for the SignalR Server for a seamless experience on iOS.

    Azure Notification Hub

    Pros:

    • Use existing infrastructure of Google, Apple and MS to deliver notifications to the user and each of them not guarantee immediate delivery of the notifications. You have to read each platforms separately:
      • Apple: Quality Service section of APNS docs
      • Google: GCM Advanced Topics
    • No need for the dedicated server

    Cons:

    • No guarantee for the immediate deleivery.
    • Required working with each native platform's languages. (There excellent plugin for Cordova https://github.com/sgrebnov/cordova-plugin-azure-notificationhub, but it is does not allow receiving notifications when application paused on Android and don't have 64 bit build on iOS)
    0 讨论(0)
提交回复
热议问题