{"id":17650753,"url":"https://github.com/eaceto/jas.io","last_synced_at":"2025-03-30T08:22:21.117Z","repository":{"id":23294281,"uuid":"26653430","full_name":"eaceto/JAS.io","owner":"eaceto","description":"(just another) Socket.io client for iOS","archived":false,"fork":false,"pushed_at":"2014-11-19T17:50:54.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T07:52:05.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eaceto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-14T19:13:53.000Z","updated_at":"2018-06-18T08:30:13.000Z","dependencies_parsed_at":"2022-07-25T12:32:47.273Z","dependency_job_id":null,"html_url":"https://github.com/eaceto/JAS.io","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FJAS.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FJAS.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FJAS.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2FJAS.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eaceto","download_url":"https://codeload.github.com/eaceto/JAS.io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246291983,"owners_count":20753984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T11:39:23.193Z","updated_at":"2025-03-30T08:22:21.092Z","avatar_url":"https://github.com/eaceto.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"JAS.io\n======\n(just another) Socket.io client - based on Socket.io v1.x client for iOS.\n\nWhy it is not just another Socket.io client?\n--------------------------------------------\n\nJAS.io does not include the Socket.io client file inside your iOS project. It relies on the client being hosted where you have the Socket.io server providing the following beneficts.\n\n1) You can use SSL without problems. Your iOS client loads a wrapper using HTTPS, that wrapper uses SSL to communicate with the server. Other approches fail to achieve this because they include the client script inside the app.\n\n2) You can upgrade your Socket.io server and/or client version without the need of modifiying your application.\n\n\nRequirements\n------------\n\n1) iOS 7.0 or later, JAS.io uses JavaScript Framework.\n2) Socket.io 1.0 or later, on the server side.\n3) Access to the server where Socket.io server is installed, in order to drop a file there.\n\nHow to install\n--------------\n\n1) From \"web\" copy \"jasio-wrapper.html\" into the server where the socket.io server is present. You can use nginx (http://nginx.org/) to serve this file.\n\n2) Modify, if necessary, the socket.io script version in \"jasio-wrapper.html\".\n\n\u003e   \u003cscript src=\"https://cdn.socket.io/socket.io-1.1.0.js\"\u003e\u003c/script\u003e\n\n\n3) From \"ios/JAS.io\" copy \"JASio.h\" and \"JASio.m\" to your project folder\n\n4) Import JavaScript Framework to your project\n\nHow to use\n----------\n\n1) Import the header file\n\n\u003e        #import \"JASio.h\"\n\n2) Create an instance of JAS.io and load the remote script\n\n\u003e        self.jasio = [[JASio alloc] init];\n\u003e        // enable or disable JAS.io log. This will help you to find issues\n\u003e        [self.jasio setLogEnabled:YES];\n\u003e        // load the remote script\n\u003e        [self.jasio loadRemoteScriptURL:kRemoteScriptURL readyToConnect:^() {\n\u003e           \n\u003e        // assign blocks to handle events (connection, disconnect, errors, etc)\u003e                       \n\u003e        // ready to execute\n\u003e        } onLoadError:^(NSDictionary* error) {\n\u003e            NSLog(@\"Client did receive an error when loading remote script: %@\",error);\n\u003e        }];\n\n3) When the script is loaded register blocks for general purposes events (connection, disconnect, errors, etc)\n\n\u003e        __weak JASio* weakJasio = self.jasio;\n\u003e            \n\u003e        // a block for handling connections.\n\u003e        // start sending messages when the client is connected\n\u003e        self.jasio.onConnect = ^() {\n\u003e            NSLog(@\"Client connected\");\n\u003e        };\n\u003e           \n\u003e        // a block for handling disconnections\n\u003e        self.jasio.onDisconnect = ^() {\n\u003e            NSLog(@\"Client disconnected\");\n\u003e                \n\u003e            /// here you can fire a reconnection if needed\n\u003e            /// if ([weakJasio reconnect]) NSLog(@\"reconnected\");\n\u003e        };\n\u003e               \n\u003e        // a block for handling errors\n\u003e        self.jasio.onError = ^(NSString* tag, NSDictionary* error) {\n\u003e            NSLog(@\"Client onError %@ - %@\",tag,error);\n\u003e        };\n\u003e                \n\u003e        // a block for handling connection errors\n\u003e        self.jasio.onConnectError = ^(NSDictionary* error) {\n\u003e            NSLog(@\"Connection failed with error: %@\",error);\n\u003e        };\n\u003e                \n\u003e        // a block for handling timeout\n\u003e        self.jasio.onTimeout = ^() {\n\u003e            NSLog(@\"Connection failed with timeout\");\n\u003e        };\n           \n4) Once the onConnect event is received you can register for events and start emitting\n\n\u003e        BOOL eventRegistered = [weakJasio on:@\"message\" callback:^(NSArray* args) {\n\u003e            NSLog(@\"Client received message with args: %@\",args);\n\u003e        }];\n\u003e        // check if remote host could register the event\n\u003e        if (!eventRegistered) NSLog(@\"Not listening for events\");\n\n\u003e        // send a hello message\n\u003e        BOOL sent = [weakJasio emit:@\"message\" json:@{@\"text\":@\"Hello JAS.io!\"}];\n\u003e        if (!sent) NSLog(@\"Message not sent\");\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fjas.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feaceto%2Fjas.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fjas.io/lists"}