jitsi / jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
https://jitsi.org/meet
Apache License 2.0
23k stars 6.69k forks source link

Can't bridge native component (iOS) #8127

Closed psdevss closed 2 years ago

psdevss commented 3 years ago

Description:

Steps to reproduce:

  1. Create a module or component in app/app.xcodeproj
  2. Use RCT_EXPORT_METHOD or RCT_EXTERN_MODULE

Expected behavior:

No errors

Actual behavior:

native component and native event is always null

Server information:

Additional information:

[error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) [JitsiMeetSDK] Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

saghul commented 3 years ago

Please paste the example code you are using. You need to add the module in the sdk target, not the app.

psdevss commented 3 years ago

I'm trying to implement the iOS screen share using replaykit and HoppFoundation's implementation but I can't bridge the ScreenShareController to the react native part. Here is a sample code

import <Foundation/Foundation.h>

import <React/RCTConvert.h>

import "ScreenShareController.h"

import "Project-Swift.h"

@implementation ScreenShareController

RCT_EXPORT_MODULE();

-(void) recStarted { NSLog(@"starting recording"); [self sendEventWithName:@"ScreenRecState" body:@{@"name": @"recStarted"}]; }

-(void) recStopped { NSLog(@"stopping recording"); [self sendEventWithName:@"ScreenRecState" body:@{@"name": @"recStopped"}]; }

//stopRecording RCT_EXPORT_METHOD(stopRecording) { RCTLogInfo(@"stopping recording - from react native"); [SocketShim closeSocket]; }

@end

saghul commented 3 years ago

Why are you not doing it the same way they did?

psdevss commented 3 years ago

I did. I have an existing app, so I tried to copy their implementation step by step but mine doesn't seem to bridge correctly. It is alway null

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.