Closed DouglasHennrich closed 6 years ago
Hey, could you provide a little more detail? Did you integrate the module into your own app? If so, can you post a code excerpt? Or did you try to run the example app?
I follow these steps:
Place the downloaded module into app/modules/iphone
Clone this repo
use carthage bootstrap under ios
folder
move all files from carthage/builds/ios
to app/modules/iphone/ti.socketio/1.0.0/platform
appc ti clean
on my root project
appc run -p ios -T simulator
My app doesn't start, it get stuck under splash screen and shutdown after a while without any errors on terminal
Why not using one of the official prepackaged releases? It also looks like you might forgot an $.index.open()
in your application. The module is used internally already (as part of automated Karma unit-testing), so there must be a env-issue on your end. Let us know if you can share a sample project, but we will close the issue for now.
Hii All
I'm having the same issue. I've downloaded the iOS and Android package from https://github.com/appcelerator-modules/titanium-socketio/releases
When I run the app on the simulator, it just gets stock on the splash screen. When the app is installed on a device it just opens and closes right aways after the Splash screen gets visible.
If I remove the Modules from the tiapp.xml the my app work perfekt again.
Same thing for me, if I remove the module, it works. It’s the same behavior that Lukic.
Reopening for further investigation! It looks like the Swift version may not be picked up correctly. Underlaying error:
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/hknoechel/Library/Developer/CoreSimulator/Devices/C02D33D2-92F2-490F-A2A8-D978B36B0626/data/Containers/Bundle/Application/A14A0BA3-106C-4EC0-9462-2EB95E3B39B7/test_socketio.app/Frameworks/SocketIO.framework/SocketIO
Reason: image not found
(lldb)
Please try out the 1.0.1 version added to the above PR.
I just added ios 1.0.1 to my APP and there is no code beside the declaration of the module inside the tiapp.xml.
Simulator : Still stops at the splash screen. Device: Is now working.
The Simulator is not outputting any error at all.
@Lukic Make sure to reset the Sim to have a fresh version installed. Also make sure you have Swift 4.1 installed e.g. by using swift -v
I'm running : Apple Swift version: 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2) Simulator : iPhone 8 (v11.3) Ti SDK: 7.1.1 GA
I've uninstalled the app from the simulator. Cleaned the App Project but the app still stops at the splash screen.
@hansemannn I do a full clean up simulator and ti clean on my app and now it's working!
btw how can I use these events connect_error reconnect_failed reconnecting
that it's listen into socket.io.on
?
const io = require ('ti.socketio');
const socket = io.connect(Alloy.CFG.socket.wss, Alloy.CFG.socket.opts);
socket.io.on // undefined is not an object (evaluating 'socket.io.on')
@DouglasHennrich I belive you have to use :
socket.on('connect_error', function() {});
socket.on('pong', (e) => {
console.warn('============');
console.warn(`socket.io - ping ${e}ms`);
});
//
socket.on('connect_error', (e) => {
App.Log('[Socket Manager] Connect error:', e);
});
socket.on('reconnect_failed', () => {
console.warn('============');
console.warn('socket.io - reconnect_failed');
});
socket.on('reconnecting', (n) => {
console.warn('============');
console.warn('socket.io - reconnecting:', n);
});
I don't think so, since it's crashing the app now
@DouglasHennrich is that on your Simulator or Device that the app is crashing?
Simulator
@DouglasHennrich wicked. I'm testing the same code on my device and it doesn't crash.
But I still cant make the app run on my simulator. Ohh what a happy joy !!
try to erase all contents from simulator
@DouglasHennrich did you try
socket.on('connect_error', function(error) { Ti.API.log(error); });
I just add these events listeners and the app crashs.
pong, connect_error, reconnect_failed, reconnecting, disconnect, error, reconnect, connect
const io = require('ti.socketio');
const socket = io.connect('wss://devnode.fleeterapp.com', {
"transports" : [ "websocket" ]
, "secure": true
, "reconnection": true
, "reconnectionDelay": 7000
, "reconnectionDelayMax": 15000
});
socket.on('connect', () => {
console.log('connected');
});
and the app crashs
@DouglasHennrich I just tryed to connect to your server with this code. And there was no isses. I get connected.
var io = require('ti.socketio'); var socket = io.connect("wss://devnode.fleeterapp.com");
socket.on('connect', function() { Ti.API.log("Socket connected"); });
socket.on('connect_error', function(error) {
Ti.API.log("connect_error");
});
maybe there's a problem with secure: true
flag; that ensures SSL protocol
seems like it's because transports : [ 'websocket' ]
and secure: true
options
@DouglasHennrich That works fine for me. Although "reconnectionDelayMax" is not supported on iOS (per native library limitation). Also note that you really need Swift 4.1 in order to get the Swift binary to work. Closing this issue again as the initial issue is fixed now.
@hansemannn I'm using Apple Swift version: 4.1.2
and the apps crash when I set up the transports
and secure
flags =/
@DouglasHennrich That's because the iOS client has slightly different options. For now you have to use forceWebsockets: true
and secure: true
on iOS (see https://nuclearace.github.io/Socket.IO-Client-Swift/Enums/SocketIOClientOption.html#/s:8SocketIO0A14IOClientOptionO15forceWebsocketsACSbcACmF). Android should be fine with transports
and secure
since that is supported on the native client.
If you still experience issues can you please open a new one here on GitHub so we can track it in a dedicated thread. Thank you!
Hi @janvennemann , @hansemannn, @Lukic and other people
First of all, thanks for this module ;-)
I have installed 1.0.1 module version for both android & iphone. On Android, it works fine.
But on iphone (simulator & iPhone SE device), same problem as @DouglasHennrich ! It builds successfully, but when i open the app, i see a black screen, and the app closes. Absolutely nothing to see in logs when i launch the app.
I have installed Swift 4.1.0 : Apple Swift version 4.1 (swift-4.1-RELEASE) Target: x86_64-apple-darwin16.7.0
The controller that uses socket.io module functions is completely commented right now (to be sure that it's not a code issue).
I tried to delete / download new simulator, and build on it -> same problem.
When i build without the socket.io module, everything works fine.
These logs appears at the end of the compilation (and i think this is the issue) :
[TRACE] Requested Swift ABI version based on scanned binaries: 6 [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCore.dylib 5 (requested 6) [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftCoreFoundation.dylib 5 (requested 6) [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftDarwin.dylib 5 (requested 6) [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftDispatch.dylib 5 (requested 6) [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftFoundation.dylib 5 (requested 6) [TRACE] Found library with mismatched Swift ABI version: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/libswiftObjectiveC.dylib 5 (requested 6)
Something interesting : i follow this tutorial to install Swift 4.1 version (which worked) : https://medium.com/xcblog/switching-swift-versions-inside-xcode-using-toolchains-755b28831c43
But when i close the terminal, and opens a new, my previous swift version has been reset : Swift 4.0.0. I search for titanium documentation to force build for Swift specific version, but nothing ...
Please help :-)
All right guys, i found the solution ! Maybe this will help for next developers.
The problem was xcode. I used xcode v9.0.1, and i installed Swift 4.1 toolchain then, switch on it (because default Swift version was 4.0 for xcode 9.0.1).
In terminal, swift --version outputs "4.1" -> but the problem is that xcode use its default swift 4.0 for build my titanium app through.
So, i decided to ununistall current xcode, then install the corresponding xcode version for defaut swift 4.1 -> It is xcode 9.3
PS : I also update titanium SDK from 7.1.1.GA to 7.2.0.GA (i don't know if it changes something)
And it works fine now.
Hope this helps !
Thanks again for this module :-)
I have downloaded the module, cloned this repo, use
carthage bootstrap
under iOS folder to donwload dependencies, move to module's platform folder, replacing any framework already there and tried to run the app. I got stuck under splash screen and nothing happens. I'm using TiSDK7.1.1.GA
log: