Getting Started with Ionic 4 and Socket.io

  Рет қаралды 18,598

Simon Grimm

Simon Grimm

Күн бұрын

In this tutorial we build a simple Ionic 4 chat using Sockets! Learn to build mobile apps with Ionic in my Ionic Academy: ionicacademy.com/
The training platform for everything Ionic. 40+ Ionic Courses, Ionic tutorials and private community to help you learn Ionic fast.
#############################
Want to read instead of watch? Here's the full tutorial: devdactic.com/...
Want more tutorials? Here you go! devdactic.com/
Just getting started? Take my 7 Day Ionic Crash Course: ionicacademy.c...
#############################
You can also find me...
on / simongrimm_
on / schlimmson
on / devdactic
#############################

Пікірлер: 80
@rollerflax555
@rollerflax555 4 жыл бұрын
I'm learning English and you're the first youtuber that I can understand. Just that, a curiosity. Thanks for the video.
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Glad to hear that!
@uzroot
@uzroot 5 жыл бұрын
Thank you very much I was expecting this tutorial.
@axrorabduganiyevich6667
@axrorabduganiyevich6667 4 жыл бұрын
Woow great video Mr.Simon.
@SinaAmini-hl1vo
@SinaAmini-hl1vo 3 жыл бұрын
Very very good
@mpakoenongeneivo
@mpakoenongeneivo 3 ай бұрын
please simon when i host my application on heroku, socket io stops working. what can i do to solve that issue.
@patrickpalomares7257
@patrickpalomares7257 Жыл бұрын
Hi simon, how did you do the "Open Editors" and "Socket server?"
@Akeshma
@Akeshma 3 жыл бұрын
I'm looking for TCP socket connection in ionic angular.. any help please
@felixsagno6965
@felixsagno6965 2 жыл бұрын
hello thank you for tutorial, i'm doing something similar to this, so i need help if possible, i have a ionic app that must listen to a port to receveive data from a web app and it has to take that data every time when it comes to the port and store it, and i don't know how to make my ionic app listening to port and receive the data .thank you in advance .
@dennisxu7780
@dennisxu7780 4 жыл бұрын
The problem is that socket needs lots of resources, for example if you have 10000 users using socket, do you know how many resource needed?
@graceamegboh9101
@graceamegboh9101 4 жыл бұрын
hi Simon i am getting error saying: WARNING: This is a simple server for use in testing or debugging Angular applications [ng] locally. It hasn't been reviewed for security issues. [ng] Binding this server to an open connection can result in compromising your application or [ng] computer. Using a different host than the one passed to the "--host" flag might result in [ng] websocket connection issues. You might need to use "--disableHostCheck" if that's the [ng] case. [ng] i 「wds」: Project is running at 0.0.0.0:8100/webpack-dev-server/ [ng] i 「wds」: webpack output is served from / [ng] i 「wds」: 404s will fallback to //index.html
@fatenrhaiem368
@fatenrhaiem368 3 жыл бұрын
Property 'fromEvent' does not exist on type 'Socket'. !!!!
@argelpamintuango1956
@argelpamintuango1956 2 жыл бұрын
how possible to make websocket to some part of rest api if application is a .NET app?
@jaiharshagottumukkala6538
@jaiharshagottumukkala6538 4 жыл бұрын
Superb tutorial ....
@TheJou1001
@TheJou1001 3 жыл бұрын
I couldn't make it work in android device. It works fine at web browser
@techbuddiesit6330
@techbuddiesit6330 4 жыл бұрын
Very good tuts. You are master of ionic.
@Prash3393
@Prash3393 5 жыл бұрын
Thanks Simon
@tolutronics
@tolutronics 5 жыл бұрын
Great... Thanks Simon..
@edwardramos2971
@edwardramos2971 5 жыл бұрын
Nice! Works for me!
@jngomezd
@jngomezd 4 жыл бұрын
I have one app for clients (APP1), and other for servers (APP2). I want notify "especific" users, about related transactions. Questions: Need I other "server agent" to manage communications? Sockets is the best solution? Fifebase (FCM) apply? ¿Other Suggest?
@jorgetawnan
@jorgetawnan 4 жыл бұрын
Very good! Thank you very much for your content. In Brazil, the IOnic community is still small. Can I do a real-time CHAT with more than one room?
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Yeah I think that should be possible, you just need to join them in your server into the same room with socket!
@brownwolfgaming4773
@brownwolfgaming4773 2 жыл бұрын
it's possible to using the socket event in service ? to get more clean code 🤔
@galaxies_dev
@galaxies_dev 2 жыл бұрын
Yes definitely!
@paragbhide1695
@paragbhide1695 3 жыл бұрын
Sir. I have build a huge social communication app on android and ios. I have one tense question, will this socket io work successfully on the scale. Even if messages are slow, still will it work successfully in ios and android.
@rubentorres
@rubentorres 5 жыл бұрын
I want to develop a guitar tuner with ionic, how can I achieve it?
@AmitKumar1995
@AmitKumar1995 4 жыл бұрын
Hi Sir, I am creating video calling feature in ionic but I m unable to make call a person when he is not using his phone or app in background. I want to show calling screen with ringtone like whatsapp call, how can do it in ionic ?
@kgermando
@kgermando 4 жыл бұрын
Great! Thanks you!
@yoppysantoso4276
@yoppysantoso4276 2 жыл бұрын
Hi Simon, I am new with ionic, but your tutorial help me to understand. with sockets, is possible for send / display image or video?
@galaxies_dev
@galaxies_dev 2 жыл бұрын
I guess you could send the image blob data through your socket connection, but perhaps having a URL to the image to load from would be easier!
@chiragjoshi3493
@chiragjoshi3493 4 жыл бұрын
hey simon great work but i'm getting error while i'm typing socket.username it's saying that proprty username does not exits on type 'Socket' please help me on this
@axrorabduganiyevich6667
@axrorabduganiyevich6667 4 жыл бұрын
Hi Simon. I have this problem, Can you help me? Refused to load the image 'localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback. localhost/:1 Failed to load resource: the server responded with a status of 404 (Not Found)
@Modady-games
@Modady-games 4 жыл бұрын
Welcome Sir, how can Ionic run on more than the Android version
@chandratumuluri6447
@chandratumuluri6447 Жыл бұрын
Hi Simon, I am using Ionic 6 (Capacitor 4) with ngx-socket-io and I keep getting CORS error (Origin 'capacitor://localhost' not allowed by Access-Control-Allow-Origin) though on the server-side "*" is given for Access-Control-Allow-Origin. Did you face this issue before? Appreciate your help.
@galaxies_dev
@galaxies_dev Жыл бұрын
Maybe this guide from Ionic helps: ionicframework.com/docs/troubleshooting/cors
@uzroot
@uzroot 5 жыл бұрын
Now we should implement one to one conversation and history of chat saving. For having offline messages stored somewhere on server side for example redis or mongodb
@galaxies_dev
@galaxies_dev 5 жыл бұрын
Yes you would have to connect a database to your server and save every message that is emitted. Then you can also have a route to load all past messages for a conversation!
@pinyin1
@pinyin1 4 жыл бұрын
@@galaxies_dev how can you do that sir
@manuelmariscal7286
@manuelmariscal7286 5 жыл бұрын
Hey Simon, recently did it but im facing the problem of CORS policy, i did it on Heroku, it's not the first time that i see that (situations on the past) maybe its some stupid thing that i'm forgeting, do you have any idea? Thank you so much
@galaxies_dev
@galaxies_dev 5 жыл бұрын
With Node or Express you can easily add the CORS headers to your API using a package. You have to make your server CORS ready, the app can't do this in general!
@murendeninemaheni4387
@murendeninemaheni4387 3 жыл бұрын
Do you have anything on this using real database data from an API? How would one integrate it with my rest API
@murendeninemaheni4387
@murendeninemaheni4387 3 жыл бұрын
POST localhost:3000/socket.io/?EIO=3&transport=polling&t=NRJp-x8 400 (Bad Request) Any help will do. Followed Tut but I run page i get this
@ersaurabher
@ersaurabher 4 жыл бұрын
At which place do I save a message in MySQL using PHP ? I wish to save the message, i know how to do that but I am confused how to do it here, I mean when do I trigger that ?
@galaxies_dev
@galaxies_dev 4 жыл бұрын
I would say when there's a new message send from the user (which you can catch in the socket functions before you emit it to a group)!
@rakshay34
@rakshay34 5 жыл бұрын
Hi Simon, I followed the instructions here and it is working like a breeze for me on browser and ios devices. But strangely socket connection is not being established in android devices. Is there a fix for it?
@galaxies_dev
@galaxies_dev 5 жыл бұрын
Most likely an issue that your server is not on https!
@pinyin1
@pinyin1 4 жыл бұрын
how can you create privacy
@MissileBoy
@MissileBoy 3 жыл бұрын
Hello, thanks for this tutorial, this is working in a mobile application? I am migrating a web game with a node.js backend (very similar to this backend) to Ionic, but websockets is not working on android phones, I really dont know what i am doing wrong.
@galaxies_dev
@galaxies_dev 3 жыл бұрын
It should work, yes. Did you use a secure HTTPS connection?
@MissileBoy
@MissileBoy 3 жыл бұрын
​@@galaxies_dev I used HTTPS in production and HTTP in localhost, but looks like definitivaly is a bug on my side as I reproducing the same behavior as a single web page, so is not a mobile app specific issue. I will check again my code, thanks!
@ciro726
@ciro726 5 жыл бұрын
But if I want to execute not in localhost but on a server online like myserver.com?
@sunilmanipara7273
@sunilmanipara7273 5 жыл бұрын
Hii, when i can disconnection internet and again connect then socket connection is not connecting. if you know how to reconnect socket connection then please tell me. thank you!
@galaxies_dev
@galaxies_dev 5 жыл бұрын
You can pass a manager object during initialisation where you can specify the disconnect and retry behaviour like described here: github.com/socketio/socket.io-client/blob/master/docs/API.md#new-managerurl-options
@ersaurabher
@ersaurabher 4 жыл бұрын
Hii please call me for custom work @ 9216142737
@brixylive606
@brixylive606 4 жыл бұрын
is live streaming possible for socketio?
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Hmm I think it could be possible in a native app!
@vajidali9764
@vajidali9764 5 жыл бұрын
Hello team ionic today I am the first time in mac create a new project, Project is serve successful but I got an error to build apk please help Error is : You have been opted out of telemetry. To change this, run: cordova telemetry on. CordovaError: Promise rejected with non-error: 'xcode-select: error: tool \'xcodebuild\' requires Xcode, but active developer directory \'/Library/Developer/CommandLineTools\' is a command line tools instance ' at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:29:15) at process._tickCallback (internal/process/next_tick.js:68:7) [ERROR] An error occurred while running subprocess cordova. cordova build ios exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
@galaxies_dev
@galaxies_dev 5 жыл бұрын
Hey, I'm not part of the official Ionic company! But regarding your error, check out this fix: github.com/nodejs/node-gyp/issues/569
@JavierRodriguez-co2mv
@JavierRodriguez-co2mv 3 жыл бұрын
'localhost:3001/socket.io/?EIO=3&transport=polling&t=NUh0gaT' from origin 'localhost:8100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Can you help me please, Mr. Simon
@galaxies_dev
@galaxies_dev 3 жыл бұрын
Then you have to add CORS support to your socket server!
@marcelocch
@marcelocch 3 жыл бұрын
I have the exact same problem :( and adding cors to nodejs server wont fix it
@JavierRodriguez-co2mv
@JavierRodriguez-co2mv 3 жыл бұрын
@@marcelocch I had to install a lower version of socket.io
@marcelocch
@marcelocch 3 жыл бұрын
@@JavierRodriguez-co2mv what version did u install?
@JavierRodriguez-co2mv
@JavierRodriguez-co2mv 3 жыл бұрын
@@marcelocch 2.0.0
@axrorabduganiyevich6667
@axrorabduganiyevich6667 4 жыл бұрын
Does this project work in real device?
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Yes it should, but of course you need to use the real URL of your server then and not just localhost.
@axrorabduganiyevich6667
@axrorabduganiyevich6667 4 жыл бұрын
@@galaxies_dev hm thank you.
@pedrocarbon
@pedrocarbon 5 жыл бұрын
How can I host the socket.io part?
@galaxies_dev
@galaxies_dev 5 жыл бұрын
For example on Heroku, but you can use all kind of hosting for your server if they allow NodeJs environments. But Heroku is my favorite.
@aliazzoug4947
@aliazzoug4947 4 жыл бұрын
please try to explain more slowly. It's hard to understand for beginners !
@galaxies_dev
@galaxies_dev 4 жыл бұрын
Will do Ali, sorry!
@aneeshbhat28
@aneeshbhat28 5 жыл бұрын
super
@nmanikiran
@nmanikiran 5 жыл бұрын
Group chat Create a group -> add / invite members A basic Skype clone 🤔
@galaxies_dev
@galaxies_dev 5 жыл бұрын
Yeah that would be a good tutorial indeed!
Building an Ionic 4 Pokédex with Search & Infinite Scroll
30:36
Simon Grimm
Рет қаралды 12 М.
5 React Native Tips to WOW Your Users
16:36
Simon Grimm
Рет қаралды 24 М.
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 58 МЛН
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 1,5 МЛН
How to scale WebSockets to millions of connections
14:01
Ably Realtime
Рет қаралды 25 М.
Best way to learn Socket IO | complex chat app
19:52
Hitesh Choudhary
Рет қаралды 104 М.
How to Localise Your Ionic 4 App with ngx-translate
18:14
Simon Grimm
Рет қаралды 23 М.
How to build an Ionic 4 Theme Switcher & Dynamic CSS Variables
15:25
Angular for Beginners - Let's build a Tic-Tac-Toe PWA
20:46
Fireship
Рет қаралды 484 М.
Polling vs WebSockets vs Socket.IO (Simple Explanation) - Chat App Part11
6:05
React Native vs Flutter - Which should you use?
22:31
Simon Grimm
Рет қаралды 31 М.
10 Expo Router Tips You Need to Know
18:07
Simon Grimm
Рет қаралды 11 М.