Skip to content

Commit 16fb183

Browse files
committed
Fix iOS AppDelegate issue and update version
1 parent 03feaf4 commit 16fb183

File tree

10 files changed

+23
-100
lines changed

10 files changed

+23
-100
lines changed

.github/workflows/publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
- name: checkout
1414
uses: actions/[email protected]
1515
- name: installation of node
16-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@v4
1717
with:
18-
node-version: 14
18+
node-version: 20
1919
registry-url: 'https://registry.npmjs.org'
2020

2121
- name: publish

example/app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "ReactNativeAntMediaExample",
3-
"displayName": "ReactNativeAntMedia Example"
3+
"displayName": "ReactNative AntMedia Example"
44
}

example/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { AppRegistry } from 'react-native';
22
//import App from './src/App';
3-
import App from './src/Play';
3+
//import App from './src/Play';
44
//import App from './src/Peer';
5-
//import App from './src/Conference';
5+
import App from './src/Conference';
66
import { name as appName } from './app.json';
77

88
AppRegistry.registerComponent(appName, () => App);
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,25 @@
11
#import "AppDelegate.h"
22

3-
#import <React/RCTBridge.h>
43
#import <React/RCTBundleURLProvider.h>
5-
#import <React/RCTRootView.h>
6-
7-
#import <RCTAppSetupUtils.h>
8-
9-
#if RCT_NEW_ARCH_ENABLED
10-
#import <React/CoreModulesPlugins.h>
11-
#import <React/RCTCxxBridgeDelegate.h>
12-
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
13-
#import <React/RCTSurfacePresenter.h>
14-
#import <React/RCTSurfacePresenterBridgeAdapter.h>
15-
#import <ReactCommon/RCTTurboModuleManager.h>
16-
17-
#import <react/config/ReactNativeConfig.h>
18-
19-
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
20-
RCTTurboModuleManager *_turboModuleManager;
21-
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
22-
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
23-
facebook::react::ContextContainer::Shared _contextContainer;
24-
}
25-
@end
26-
#endif
274

285
@implementation AppDelegate
296

307
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
318
{
32-
RCTAppSetupPrepareApp(application, true);
33-
34-
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
35-
36-
#if RCT_NEW_ARCH_ENABLED
37-
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
38-
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
39-
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
40-
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
41-
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
42-
#endif
43-
44-
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"ReactNativeAntMediaExample", nil, true);
45-
46-
if (@available(iOS 13.0, *)) {
47-
rootView.backgroundColor = [UIColor systemBackgroundColor];
48-
} else {
49-
rootView.backgroundColor = [UIColor whiteColor];
50-
}
9+
self.moduleName = @"ReactNativeAntMediaExample";
10+
// You can add your custom initial props in the dictionary below.
11+
// They will be passed down to the ViewController used by React Native.
12+
self.initialProps = @{};
5113

52-
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
53-
UIViewController *rootViewController = [UIViewController new];
54-
rootViewController.view = rootView;
55-
self.window.rootViewController = rootViewController;
56-
[self.window makeKeyAndVisible];
57-
return YES;
14+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
5815
}
5916

6017
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18+
{
19+
return [self bundleURL];
20+
}
21+
22+
- (NSURL *)bundleURL
6123
{
6224
#if DEBUG
6325
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
@@ -66,43 +28,4 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
6628
#endif
6729
}
6830

69-
#if RCT_NEW_ARCH_ENABLED
70-
71-
#pragma mark - RCTCxxBridgeDelegate
72-
73-
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
74-
{
75-
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
76-
delegate:self
77-
jsInvoker:bridge.jsCallInvoker];
78-
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
79-
}
80-
81-
#pragma mark RCTTurboModuleManagerDelegate
82-
83-
- (Class)getModuleClassFromName:(const char *)name
84-
{
85-
return RCTCoreModulesClassProvider(name);
86-
}
87-
88-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
89-
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
90-
{
91-
return nullptr;
92-
}
93-
94-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
95-
initParams:
96-
(const facebook::react::ObjCTurboModule::InitParams &)params
97-
{
98-
return nullptr;
99-
}
100-
101-
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
102-
{
103-
return RCTAppSetupDefaultModuleFromClass(moduleClass);
104-
}
105-
106-
#endif
107-
10831
@end

example/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import InCallManager from 'react-native-incall-manager';
1313

1414
export default function App() {
1515
var defaultStreamName = 'streamTest1';
16-
const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket';
16+
const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket';
1717
//or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket',
1818

1919
const streamNameRef = useRef<string>(defaultStreamName);

example/src/Chat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from 'react-native';
1414

1515
var defaultStreamName = 'streamTest1';
16-
const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket';
16+
const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket';
1717
//or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket',
1818

1919
const Chat: React.FC = () => {

example/src/Conference.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var publishStreamId:string;
1818

1919
export default function Conference() {
2020
var defaultRoomName = 'room1';
21-
const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket';
21+
const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket';
2222
//or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket',
2323

2424
const [localMedia, setLocalMedia] = useState('');
@@ -85,7 +85,7 @@ export default function Conference() {
8585
}
8686
},
8787
callbackError: (err: any, data: any) => {
88-
if (err === "no_active_streams_in_room" || err === "no_stream_exists") {
88+
if (err === "no_active_streams_in_room" || err === "no_stream_exist") {
8989
// it throws this error when there is no stream in the room
9090
// so we shouldn't reset streams list
9191
} else {
@@ -156,7 +156,7 @@ export default function Conference() {
156156
});
157157
return;
158158
}
159-
console.warn("clearing all the remote renderer", remoteTracks, streamId)
159+
console.info("clearing all the remote renderer", remoteTracks, streamId)
160160
setremoteTracks([]);
161161
};
162162

example/src/Peer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import InCallManager from 'react-native-incall-manager';
1313

1414
export default function App() {
1515
var defaultStreamName = 'stream1';
16-
const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket';
16+
const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket';
1717
//or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket',
1818

1919
const [localMedia, setLocalMedia] = useState('');

example/src/Play.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {useAntMedia, rtc_view} from '@antmedia/react-native-ant-media';
1111

1212
export default function App() {
1313
var defaultStreamName = 'stream1';
14-
const webSocketUrl = 'ws://server.com:5080/WebRTCAppEE/websocket';
14+
const webSocketUrl = 'ws://test.antmedia.io:5080/WebRTCAppEE/websocket';
1515
//or webSocketUrl: 'wss://server.com:5443/WebRTCAppEE/websocket',
1616

1717
const streamNameRef = useRef<string>(defaultStreamName);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antmedia/react-native-ant-media",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "Ant Media Server WebRTC React Native SDK and Reference Project",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)