diff --git a/.gitignore b/.gitignore index 94fc867..c4b7a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,9 @@ -# OSX -# -.DS_Store - # Xcode -# -build/ +!**/*.xcodeproj +!**/*.pbxproj +!**/*.xcworkspacedata +!**/*.xcsettings +!**/*.xcscheme *.pbxuser !default.pbxuser *.mode1v3 @@ -22,13 +21,19 @@ DerivedData *.xcuserstate project.xcworkspace -# Android/IJ -# +# Xcode, Gradle +build/ + +# Android .idea .gradle local.properties +*.iml -# node.js -# -node_modules/ -npm-debug.log +# Node +node_modules +*.log +.nvm + +# OS X +.DS_Store diff --git a/ios/UdpSocketClient.m b/ios/UdpSocketClient.m index 4181eae..ba0be3a 100644 --- a/ios/UdpSocketClient.m +++ b/ios/UdpSocketClient.m @@ -21,7 +21,7 @@ NSString *const RCTUDPErrorDomain = @"RCTUDPErrorDomain"; NSString* _address; GCDAsyncUdpSocket *_udpSocket; id _clientDelegate; - NSMutableDictionary* _pendingSends; + NSMutableDictionary *_pendingSends; long tag; } diff --git a/ios/UdpSockets.h b/ios/UdpSockets.h index 487174d..6d5e7a8 100644 --- a/ios/UdpSockets.h +++ b/ios/UdpSockets.h @@ -16,6 +16,6 @@ @interface UdpSockets : NSObject -+(NSMutableDictionary *)clients; ++(NSMutableDictionary *)clients; @end diff --git a/ios/UdpSockets.m b/ios/UdpSockets.m index feb6677..dd66c35 100644 --- a/ios/UdpSockets.m +++ b/ios/UdpSockets.m @@ -44,7 +44,7 @@ RCT_EXPORT_METHOD(createSocket:(nonnull NSNumber*)cId withOptions:(NSDictionary* { // if (!UdpSockets._clients) UdpSockets._clients = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* _clients = [UdpSockets clients]; + NSMutableDictionary *_clients = [UdpSockets clients]; if (!cId) { RCTLogError(@"%@.createSocket called with nil id parameter.", [self class]); return; @@ -126,8 +126,8 @@ RCT_EXPORT_METHOD(dropMembership:(nonnull NSNumber*)cId - (void) onData:(UdpSocketClient*) client data:(NSData *)data host:(NSString *)host port:(uint16_t)port { - NSMutableDictionary* _clients = [UdpSockets clients]; - NSString *clientID = [[_clients allKeysForObject:client] objectAtIndex:0]; + NSMutableDictionary *_clients = [UdpSockets clients]; + NSNumber *clientID = [[_clients allKeysForObject:client] objectAtIndex:0]; NSString *base64String = [data base64EncodedStringWithOptions:0]; [self.bridge.eventDispatcher sendDeviceEventWithName:[NSString stringWithFormat:@"udp-%@-data", clientID] body:@{ @@ -140,7 +140,7 @@ RCT_EXPORT_METHOD(dropMembership:(nonnull NSNumber*)cId +(UdpSocketClient*)findClient:(nonnull NSNumber*)cId callback:(RCTResponseSenderBlock)callback { - NSMutableDictionary* _clients = [UdpSockets clients]; + NSMutableDictionary *_clients = [UdpSockets clients]; UdpSocketClient *client = [_clients objectForKey:cId]; if (!client) { if (!callback) { @@ -159,7 +159,7 @@ RCT_EXPORT_METHOD(dropMembership:(nonnull NSNumber*)cId +(void) closeClient:(nonnull NSNumber*)cId callback:(RCTResponseSenderBlock)callback { - NSMutableDictionary* _clients = [UdpSockets clients]; + NSMutableDictionary *_clients = [UdpSockets clients]; UdpSocketClient* client = [UdpSockets findClient:cId callback:callback]; if (!client) return; @@ -170,7 +170,7 @@ RCT_EXPORT_METHOD(dropMembership:(nonnull NSNumber*)cId } +(void) closeAllSockets { - NSMutableDictionary* _clients = [UdpSockets clients]; + NSMutableDictionary *_clients = [UdpSockets clients]; for (NSNumber* cId in _clients) { [UdpSockets closeClient:cId callback:nil]; } diff --git a/ios/UdpSockets.xcodeproj/project.xcworkspace/xcuserdata/aprock.xcuserdatad/UserInterfaceState.xcuserstate b/ios/UdpSockets.xcodeproj/project.xcworkspace/xcuserdata/aprock.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index d2a2239..0000000 Binary files a/ios/UdpSockets.xcodeproj/project.xcworkspace/xcuserdata/aprock.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ