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

feat(ios): move to swift, update native SDK to latest #174

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

hansemannn
Copy link
Contributor

@hansemannn hansemannn commented May 11, 2022

  • Create swift project
  • Move module class to swift
  • Move manager class to swift
  • Move client class to swift
  • Test properly

@hansemannn
Copy link
Contributor Author

@m1ga @caspahouzer The core migration is now done and it could probably get into the first testing. I assume there is some kind of bugs in the initial migration (as always), but if someone could start testing it already or provide me an app.js that I could test without setting up an additional server env, that'd be great!

@hansemannn hansemannn marked this pull request as ready for review May 15, 2022 08:27
@m1ga
Copy link
Contributor

m1ga commented May 15, 2022

can you provide a binary test file than I can test it later with my demo project

@m1ga
Copy link
Contributor

m1ga commented Jul 7, 2022

@hansemannn could you upload a binary please. It would be great to have this and the Android PR merged soon. then we can update module like tidev/ti.map#573 (comment) because the latest karma uses v4.

…nto feature/swift

# Conflicts:
#	.github/workflows/android.yml
#	.github/workflows/ios.yml
@m1ga
Copy link
Contributor

m1ga commented Aug 3, 2022

@hansemannn can you attach a binary please? Could give it a test run with my demo project

@hansemannn
Copy link
Contributor Author

This should should be up to date: https://www.dropbox.com/s/yfwqxn8s6mnyjti/ti.socketio-iphone-4.0.0.zip?dl=1

@m1ga
Copy link
Contributor

m1ga commented Aug 4, 2022

Thanks. Its not connecting to my test server (https://github.com/m1ga/socket_io_demo/tree/master/socketServer).
I've tried:

old module version 3 with the workaround

const io = new Server(httpServer, {
  allowEIO3: true // false by default
});

-> connects fine

new version with and without the workaround (shouldn't be needed) -> no connection.

Android connects fine. If you run into cors issues change it to

const io = new Server(server, {
	cors: {
    origin: "*"
  }
});

@cucumbra
Copy link

Hi @hansemannn I just tried to download the binary without success. Can you please update the link?

@hansemannn
Copy link
Contributor Author

The native library hasn't been updated / maintained since over two years, so it seems like it's no longer supported. What are the reasons for still using the library? I was not able to build it locally since a while as well due to Swift incompatibility, so I'm not sure if it's worth to invest more time into this project, while other socket libraries like Pusher and PubNub are well-supported in Ti.

@m1ga
Copy link
Contributor

m1ga commented Mar 18, 2023

we had a simple local socket.io server running to send around messages. Pusher or PubNub don't allow to connect to other socket servers, right?

@hansemannn
Copy link
Contributor Author

I don't think so, they are rather SaaS models. And to catch up: The existing version does not work anymore?

@m1ga
Copy link
Contributor

m1ga commented Mar 18, 2023

the existing iOS version only supports v3 of socket.io and not v4. I've updated the Android version last year to have v4 included.
Side note: the karma tests use it too. At least on Android (infos in this ti.map comment)

@hansemannn
Copy link
Contributor Author

Okay, got it. And v3 is not working anymore? I will definitely need to finish this - just checking how critical it is looking at it as a feature or required upgrade

@m1ga
Copy link
Contributor

m1ga commented Mar 18, 2023

If you have control over the server you can run it in a compatibility mode to support v3 in v4 (https://socket.io/blog/socket-io-4-release/ - allowEIO3: true ) but since v4 was introduced two years ago it would be nice to have support for it.

I don't have a project using it at the moment but since it was asked Slack and people use the Android version (see the old upgrade issue for details #168)

@hansemannn
Copy link
Contributor Author

I have the project running again, but the connect events and overall messaging does not work..

@hansemannn
Copy link
Contributor Author

Weird - your Android version bundled with the example project does also not connect properly.

@m1ga
Copy link
Contributor

m1ga commented Mar 19, 2023

Screenshot_20230319_120119

but have to check if that is the same version that is online 😄

edit: updated the example repo

@cucumbra
Copy link

@hansemannn We already have production environment with our own socket io server and android and ios socket io client which we want to keep. It was using the net.iamyellow.tiws module which is very old implementation (we have build newer version) and we have some issues from time to time(the client get disconnected). We want to replace the old one with this one. I already installed the android module which works great. I tried the iOS module also and I can connect successfully to the server, but after a couple of emitted events I do get disconnect event from the client with message “Namespace leave”. I also tried to make build, but I have several errors.
I tried with xcode 13.4.1 and 14.1. It looks like there are missing frameworks in the module source code:
[TRACE] [xcode-sim] error: There is no XCFramework found at '/Users/v/Documents/Projects/titanium-socketio-feature-swift/ios/platform/SocketIO.xcframework'. (in target 'TiSocketio' from project 'ti.socketio') [TRACE] [xcode-sim] error: There is no XCFramework found at '/Users/v/Documents/Projects/titanium-socketio-feature-swift/ios/platform/Starscream.xcframework'. (in target 'TiSocketio' from project 'ti.socketio')
When I build with xcode 14.1 I get additional error:
[ERROR] [xcode-sim] 2023-03-16 13:04:28.564 xcodebuild[30576:982158] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
I don't have experience in native development with iOS so I am not really able to help in that part.
But, if you are able to make the build, I will test it out with our server and share my findings.

@hansemannn
Copy link
Contributor Author

@cucumbra Thanks for the insight! I just pushed my wip-changes so you can check it out. It has extensive logging included, but it seems like the initial connect just doesn't work, which is odd because I moved over the ObjC changes one by one.

@cucumbra
Copy link

cucumbra commented Mar 20, 2023

@hansemannn Thanks for the update. I just tried to build it with xcode 13 and 14, the same error still appears to me. Can you please share the build for iOS?

@hansemannn
Copy link
Contributor Author

ti.socketio-iphone-4.0.0.zip

But as I mentioned earlier, the connect does not seem to happen

@cucumbra
Copy link

You are right, it can not connect to the server. I got disconnect message "Namespace leave". I checked the server and the event does not get to it

@cucumbra
Copy link

cucumbra commented Oct 6, 2023

Hi @hansemannn and @m1ga, is there any progress on this one? Is there any way I can help?

@hansemannn
Copy link
Contributor Author

Hi there! You can definitely help: The connect event does not fire and we need to figure out why :)

@cucumbra
Copy link

cucumbra commented Oct 6, 2023

As I mentioned earlier, although I don't have experience in native development with iOS, I tried to build the module from my local environment so I can try something out, but I have some errors that I am not able to fix. So I couldn't be of a much help in that part, but I can test the module for all of it's functionalities. We use the module for transmitting text, images, and videos across various connectivity settings, which means I'll be subjecting it to a wide range of testing scenarios.

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

Successfully merging this pull request may close these issues.

None yet

3 participants