I'm evaluating SignalR technology for use in our new product (mobile web application for the broad audience, among other things it needs a real-time chat on some pages).
I've followed the guide to create a very basic chat demo.
Then I deployed the demo on my IIS, and started chatting to myself.
All clients were on the same WiFi network.
Desktop browsers worked more or less OK.
However, Safari on iOS 4.2, and IE on WP7.10 - they both sucked.
Sometimes nothing happened when I pressed the "post" button.
Sometimes outgoing messages were sent OK to the desktop firefox, however there was no incoming messages.
Maybe I'm missing something obvious? Maybe I need jquery mobile instead of the normal one? Maybe I should just tune the IIS/web.config/whatever, and the SignalR will flourish and start to work flawlessly even through the crappy mobile internet?
Or does it mean that since it doesn't work even while on WiFi within a single hop from the web server, I should throw SignalR away and just write some JavaScript to poll a JSON endpoint for new messages?
Thanks in advance!
I have been developing an app with phonegap (that means that uses the Safari browser) and SignalR for Android and IPhone. The major issue I had was with iOS 6.x because SignalR did not connect with default config. I have found a workaround for that and I had explained it here. Let me know if you find it useful.
This code will simulate a connect, check for messages, disconnect and wait 5 secs to solve the iOS issue.
In js add
$.connection.hub.start({ transport: 'longPolling' }).done(function (myHubConnection) { });
and in Application_Start() add
GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(1);
Microsoft.AspNet.SignalR.Transports.LongPollingTransport.LongPollDelay = 5000;
RouteTable.Routes.MapHubs();
Not all mobile browsers (e.g. android, opera mini) support websockets. You'll find a nice chart of supporting browsers at http://www.hanselman.com/blog/YourUsersDontCareIfYouUseWebSockets.aspx
Related
There is an important application in my iphone and I don't want to miss any messages from this App, but the App is not available on PC (even no api for PC user), so is there any ways to get message from my iphone in my PC?
I am familiar to java and learning javascript, may be I can develop something to help myself?
Thanks for help
I am looking for a way to send and display notifications on ios pwa apps.
I know it is not possible since the ios safari (and non of the other browsers on ios) support neither the push api nor the notification api.
I am wondering if there was a workaround to do that.
I have already taken a look at this answer, but honestly didn't understand at all.
The truth is NOT for mobile Safari, at the time I write this answer. I am doing a long research... The Apple PWA on Safari increased a lot, but is not comparable to others like Google Chrome browser. As It was said in the article:
At this point in time Apple's iPhone and iPads do not support native
push notifications. You can gracefully fallback to SMS notifications.
So, till the moment I have this resume to share:
Do Progressive Web Apps (PWA) work on iOS? YES...
Apple may wants to turn the PWA as an alternative to the Apple Store.
We still can’t open an external link in Safari
Still can’t use Push Notifications
There is a 50MB service worker cache limit
Web apps that have not been used will have their cached assets purged after 7 days
Fonts:webkit.org,developer.apple.com,brainhub.eu,love2dev.com,firt.dev
NEW:
Push API is currently in development for Safari (including iOS). It is not currently finished but should be available for testing in a Safari Technology Preview within the next few months.
OLD:
It is not possible to have Push Notifications on Safari. It's been brought up many times and has even been a topic of this years WWDC.
See the following threads:
https://developer.apple.com/forums/thread/681575
https://developer.apple.com/forums/thread/681748
If developers want push notifications in Safari we'll need to have a much louder voice. As stated in the link above, native apps got notifications in 2009, it's 2021 and Apple has not even indicated if they are willing to work on it.
My app, Python/Flask and vanilla Javascript, is running just fine on my Mac's browsers and I have previously also been able, making sure I'm on the right network, to test my app on Safari on my iPhone 6. I did this by pointing my mobile browser to the IP given by ifconfig on my Mac and correct port. However, after adding Flask-SocketIO, which should allow for Websocket support or atleast long polling, I am no longer able to test my app on my iPhone. All is still fine on Macs browsers but all I get on my iPhone is "Safari could not open the page...".
My app is served over port 5000 but Ive also tried over 80 without any success. I've cleared cache and cookies as well, of course.
Has anyone experienced something similar or have any idea what is going on?
Mobile Safari needs a Content-Security-Policy meta tag. See more at https://developers.google.com/web/fundamentals/security/csp/
Are there any Firefox / Google Chrome plugin for quickly testing Socket.io server implementations?
http://amritb.github.io/socketio-client-tool
I built this tool for the same, its not a plugin but can used for the same purpose (even if it was a plugin, it would open up a new tab in the browser with the UI).
Advantages of making it available online is, the links can be shared among teams - teammates can directly click and use without filling any of the text fields.
For contributions, issues, feature request, please post via https://github.com/amritb/socketio-client-tool
I think it is a late reply but may help someone. I am using this App on my Mac Pro.
https://electronjs.org/apps/socket-io-tester
Firecamp, Here is the website.
Real-time programming is easy but too hard in terms of testing and debugging, This is the main reason I have built Firecamp, It's a visual testing dev tool for any RealTime technology or platform like Socket.IO, WebSocket, Ably, Pusher and lot more.
To test a SocketIO backend, you just need to follow 3 steps,
Connect server end-point
Add/Listen listeners
Emit emitter with a payload
Then you can save the whole configuration to use it in the future, save emitters payload and export/import for the mobility purpose would be very handy features for sharing.
I have also created my own Chrome and Firefox extension. You can also run it from command line.
It is available here:
https://github.com/serajhqi/socketio-test-client
Firefox addon:
https://addons.mozilla.org/en-US/firefox/addon/socketio-client/
Chrome extension:
https://chrome.google.com/webstore/detail/socketio-test-client/ophmdkgfcjapomjdpfobjfbihojchbko
I am experiencing a problem with accessing an application from the Android-browser.
The application uses DWR to persist connections to the clients that are connected with it.
Everything works fine for me, except that if the application does not send any data to the client on the Android-phone for 2 minutes, the connection seems to be lost and no data arrive at the client. The same scenario works just fine on Firefox, Opera and Chrome. If the pause between two data transfers is less than 2 minutes, it works just fine.
So, now my question:
Is there some timeout setting for the android browser that I am missing? Or is this some built-in bug/feature/whatever that I cannot circumvent?
I know that I could prevent this from happening with some sort of heartbeat, I would just like to why this is happening.
Thanks in advance, Max
btw: Everything (server, clients) runs on my machine and I am testing this on the android emulator with Windows XP
Android emulator version 1.10 (build_id CUPCAKE-150240)
Could it be that the Android system is garbage collecting your activity and thus loosing your web browser and closing the persistent connection?
Perhaps you could check this by looking in you logcat (on android end) or webserver logs (on remote end)?
if this is the case, you would need to add reconnect code into the onresume/onstart method in android.