Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This package is not working for IOS #28

Closed
harshaIOT opened this issue May 31, 2019 · 3 comments
Closed

This package is not working for IOS #28

harshaIOT opened this issue May 31, 2019 · 3 comments

Comments

@harshaIOT
Copy link

harshaIOT commented May 31, 2019

I am trying to implement this socket io package in IOS platform, but its throwing error, I have followed the suggestions and implementation part like in the document ( Instructions they gave ), still not working.

Error msg:

CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Finding Podfile changes
      A Socket.IO-Client-Swift
      A flutter_socket_io
      - Flutter
      - fluttertoast
      - map_view
      - path_provider
      - share
      - sqflite
      - url_launcher
    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `flutter_socket_io` from `.symlinks/plugins/flutter_socket_io/ios`
    -> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
    -> Fetching podspec for `map_view` from `.symlinks/plugins/map_view/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `share` from `.symlinks/plugins/share/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
    Resolving dependencies of `Podfile`
    Comparing resolved specification to the sandbox manifest
      A FMDB
      A Flutter
      A GoogleMaps
      A Socket.IO-Client-Swift
      A Starscream
      A flutter_socket_io
      A fluttertoast
      A map_view
      A path_provider
      A share
      A sqflite
      A url_launcher
    Downloading dependencies
    -> Installing FMDB (2.7.5)
      > Copying FMDB from `/Users/harshavardhan/Library/Caches/CocoaPods/Pods/Release/FMDB/2.7.5-2ce00` to `Pods/FMDB`
    -> Installing Flutter (1.0.0)
    -> Installing GoogleMaps (2.7.0)
      > Copying GoogleMaps from `/Users/harshavardhan/Library/Caches/CocoaPods/Pods/Release/GoogleMaps/2.7.0-f79af` to `Pods/GoogleMaps`
    -> Installing Socket.IO-Client-Swift (13.3.1)
      > Copying Socket.IO-Client-Swift from `/Users/harshavardhan/Library/Caches/CocoaPods/Pods/Release/Socket.IO-Client-Swift/13.3.1-79f8f` to `Pods/Socket.IO-Client-Swift`
    -> Installing Starscream (3.0.6)
      > Copying Starscream from `/Users/harshavardhan/Library/Caches/CocoaPods/Pods/Release/Starscream/3.0.6-ef3ec` to `Pods/Starscream`
    -> Installing flutter_socket_io (0.0.1)
    -> Installing fluttertoast (0.0.2)
    -> Installing map_view (0.0.12)
    -> Installing path_provider (0.0.1)
    -> Installing share (0.5.2)
    -> Installing sqflite (0.0.1)
    -> Installing url_launcher (0.0.1)
      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:
    - `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:115:in `verify_swift_pods_swift_version'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:459:in `validate_targets'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:138:in `install!'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `<main>'
Error output from CocoaPods:
↳
    [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone Xʀ.
Exited (sigterm)
@vinters768
Copy link

@harshaIOT found solution for me, try this:

IO.Socket socket = IO.io('http://192.1.1.1:3000', <String, dynamic>{
    'transports': ['websocket']
  });

note the 'transports' parameter.

@jumperchen
Copy link
Member

jumperchen commented Jun 4, 2019

FYI: If in flutter, you have to put <String, dynamic>{'transports': ['websocket']}); as an option,
for example - https://github.com/rikulo/socket.io-client-dart/blob/master/test/io_client.dart#L8

@aurbina83
Copy link

For mobile this is 100% fine. The reason socket.io has fallbacks to other Thea sport methods is because some older browsers don’t support websockets.

This will be an issue for people trying to use this on Flutter web though, I’d imagine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants