Initially I have used btford socket.io library for my ionic project, but I am having trouble working with it. Now I am trying to install socket.io directly to an ionic project. However I am not sure whether it should installed as an npm install which will store it in the node_modules folder, or should i store the library in ionicprj/www/lib ?
相关问题
- Plugin with id 'com.google.gms.google-services
- angularJS: ui-router equivalent to $location.searc
- Separate AngularJS Controllers Into Separate Files
- How to pass form data from Ionic 3 to PHP file?
- Angular ngAnimate not working first time on page l
相关文章
- Passing variable through URL with angular js
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- Ionic 4: Hardware Back Button Reloading Applicatio
- Can ng-show directive be used with a delay
- AngularJS $routeParams vs $stateParams
- Multiple parameters in AngularJS $resource GET
- How to set class/style of accordion heading in Ang
socket.io client library should go in
www/lib/
to emit events from the ionic app. On the server you'll want socket.io as an npm module.There's a helpful tutorial here: http://www.htmlxprs.com/post/6/creating-a-realtime-image-sharing-app-with-ionic-and-socketio-tutorial
cordova-plugin-whitelist seems to be "mandatory" at present.
install it
configure config.xml
You can keep your current setup with * or change for more restrictive rules
add a html policy on index.html, you shall add a Policy also. To authorise everything, here it is :