diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1abffe..8f0bb02 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,9 +13,9 @@ jobs: - name: checkout uses: actions/checkout@v3.0.2 - name: installation of node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 14 + node-version: 20 registry-url: 'https://registry.npmjs.org' - name: publish diff --git a/example/app.json b/example/app.json index 06414f3..3ffdc90 100644 --- a/example/app.json +++ b/example/app.json @@ -1,4 +1,4 @@ { "name": "ReactNativeAntMediaExample", - "displayName": "ReactNativeAntMedia Example" + "displayName": "ReactNative AntMedia Example" } diff --git a/example/index.js b/example/index.js index a6028aa..203603e 100644 --- a/example/index.js +++ b/example/index.js @@ -1,8 +1,8 @@ import { AppRegistry } from 'react-native'; //import App from './src/App'; -import App from './src/Play'; +//import App from './src/Play'; //import App from './src/Peer'; -//import App from './src/Conference'; +import App from './src/Conference'; import { name as appName } from './app.json'; AppRegistry.registerComponent(appName, () => App); diff --git a/example/ios/ReactNativeAntMediaExample/AppDelegate.mm b/example/ios/ReactNativeAntMediaExample/AppDelegate.mm index 5e9ffca..5230dd6 100644 --- a/example/ios/ReactNativeAntMediaExample/AppDelegate.mm +++ b/example/ios/ReactNativeAntMediaExample/AppDelegate.mm @@ -1,63 +1,25 @@ #import "AppDelegate.h" -#import #import -#import - -#import - -#if RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import -#import -#import - -#import - -@interface AppDelegate () { - RCTTurboModuleManager *_turboModuleManager; - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end -#endif @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - RCTAppSetupPrepareApp(application, true); - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - -#if RCT_NEW_ARCH_ENABLED - _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); - _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; - bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; -#endif - - UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"ReactNativeAntMediaExample", nil, true); - - if (@available(iOS 13.0, *)) { - rootView.backgroundColor = [UIColor systemBackgroundColor]; - } else { - rootView.backgroundColor = [UIColor whiteColor]; - } + self.moduleName = @"ReactNativeAntMediaExample"; + // You can add your custom initial props in the dictionary below. + // They will be passed down to the ViewController used by React Native. + self.initialProps = @{}; - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge +{ + return [self bundleURL]; +} + +- (NSURL *)bundleURL { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; @@ -66,43 +28,4 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge #endif } -#if RCT_NEW_ARCH_ENABLED - -#pragma mark - RCTCxxBridgeDelegate - -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:bridge.jsCallInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); -} - -#pragma mark RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return RCTCoreModulesClassProvider(name); -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - jsInvoker:(std::shared_ptr)jsInvoker -{ - return nullptr; -} - -- (std::shared_ptr)getTurboModule:(const std::string &)name - initParams: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return nullptr; -} - -- (id)getModuleInstanceFromClass:(Class)moduleClass -{ - return RCTAppSetupDefaultModuleFromClass(moduleClass); -} - -#endif - @end diff --git a/example/src/App.tsx b/example/src/App.tsx index a5ee7c7..abc3407 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -13,7 +13,7 @@ import InCallManager from 'react-native-incall-manager'; export default function App() { var defaultStreamName = 'streamTest1'; - const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket'; + const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket'; //or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket', const streamNameRef = useRef(defaultStreamName); diff --git a/example/src/Chat.tsx b/example/src/Chat.tsx index a310fcb..54a08c0 100644 --- a/example/src/Chat.tsx +++ b/example/src/Chat.tsx @@ -13,7 +13,7 @@ import { } from 'react-native'; var defaultStreamName = 'streamTest1'; -const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket'; +const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket'; //or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket', const Chat: React.FC = () => { diff --git a/example/src/Conference.tsx b/example/src/Conference.tsx index 5fd0fa1..f4f491c 100644 --- a/example/src/Conference.tsx +++ b/example/src/Conference.tsx @@ -18,7 +18,7 @@ var publishStreamId:string; export default function Conference() { var defaultRoomName = 'room1'; - const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket'; + const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket'; //or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket', const [localMedia, setLocalMedia] = useState(''); @@ -85,7 +85,7 @@ export default function Conference() { } }, callbackError: (err: any, data: any) => { - if (err === "no_active_streams_in_room" || err === "no_stream_exists") { + if (err === "no_active_streams_in_room" || err === "no_stream_exist") { // it throws this error when there is no stream in the room // so we shouldn't reset streams list } else { @@ -156,7 +156,7 @@ export default function Conference() { }); return; } - console.warn("clearing all the remote renderer", remoteTracks, streamId) + console.info("clearing all the remote renderer", remoteTracks, streamId) setremoteTracks([]); }; diff --git a/example/src/Peer.tsx b/example/src/Peer.tsx index c6ca137..a12cf12 100644 --- a/example/src/Peer.tsx +++ b/example/src/Peer.tsx @@ -13,7 +13,7 @@ import InCallManager from 'react-native-incall-manager'; export default function App() { var defaultStreamName = 'stream1'; - const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket'; + const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket'; //or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket', const [localMedia, setLocalMedia] = useState(''); diff --git a/example/src/Play.tsx b/example/src/Play.tsx index b75709f..d17cd4f 100644 --- a/example/src/Play.tsx +++ b/example/src/Play.tsx @@ -11,7 +11,7 @@ import {useAntMedia, rtc_view} from '@antmedia/react-native-ant-media'; export default function App() { var defaultStreamName = 'stream1'; - const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket'; + const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket'; //or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket', const streamNameRef = useRef(defaultStreamName); diff --git a/package.json b/package.json index 3829f79..61d14f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antmedia/react-native-ant-media", - "version": "1.0.8", + "version": "1.0.9", "description": "Ant Media Server WebRTC React Native SDK and Reference Project", "main": "lib/commonjs/index", "module": "lib/module/index",