From 9edfac1cd6ccc5adfe2c8873bac45b76afebbf92 Mon Sep 17 00:00:00 2001 From: Tiago Jacobs Date: Sat, 12 Feb 2022 03:44:09 -0300 Subject: [PATCH] Expose RPSystemBroadcastPickerView to ReactNative --- App.js | 41 +++++++++++-------- ios/BigBlueButton.xcodeproj/project.pbxproj | 16 +++++++- ios/ReactModules/SystemBroadcastPicker.m | 8 ---- .../SystemBroadcastPickerManager.m | 27 ++++++++++++ react/BroadcastPicker.js | 8 ++++ .../BBBN_SystemBroadcastPicker.js | 3 ++ 6 files changed, 76 insertions(+), 27 deletions(-) delete mode 100644 ios/ReactModules/SystemBroadcastPicker.m create mode 100644 ios/ReactModules/SystemBroadcastPickerManager.m create mode 100644 react/BroadcastPicker.js create mode 100644 react/ios-native-components/BBBN_SystemBroadcastPicker.js diff --git a/App.js b/App.js index ff7d7e5..a24f738 100644 --- a/App.js +++ b/App.js @@ -8,6 +8,8 @@ import React from 'react'; import type {Node} from 'react'; +import BroadcastPicker from './react/BroadcastPicker'; + import { SafeAreaView, ScrollView, @@ -60,24 +62,27 @@ const App: () => Node = () => { }; return ( - - - - -
- Welcome to first version of BigBlueButton Mobile -
-
- -
-
-
-
+ <> + + + + + +
+ Welcome to first version of BigBlueButton Mobile +
+
+ +
+
+
+
+ ); }; diff --git a/ios/BigBlueButton.xcodeproj/project.pbxproj b/ios/BigBlueButton.xcodeproj/project.pbxproj index 2546430..03c76c0 100644 --- a/ios/BigBlueButton.xcodeproj/project.pbxproj +++ b/ios/BigBlueButton.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ F1F9558327B7612C000608EB /* BroadcastSetupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F9558227B7612C000608EB /* BroadcastSetupViewController.swift */; }; F1F9558727B7612C000608EB /* BroadcastUploadSetupUI.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F1F9557D27B7612C000608EB /* BroadcastUploadSetupUI.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; F1F9558A27B7612C000608EB /* BroadcastUpload.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F1F9557227B7612B000608EB /* BroadcastUpload.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + F1F9559A27B77D4C000608EB /* SystemBroadcastPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F1F9559927B77D4C000608EB /* SystemBroadcastPickerManager.m */; }; F29A21BB38B66F71560C2BDC /* libPods-BigBlueButton-BigBlueButtonTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA9899CCCE408726F08764D3 /* libPods-BigBlueButton-BigBlueButtonTests.a */; }; /* End PBXBuildFile section */ @@ -88,6 +89,7 @@ F1F9557F27B7612C000608EB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; F1F9558227B7612C000608EB /* BroadcastSetupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BroadcastSetupViewController.swift; sourceTree = ""; }; F1F9558427B7612C000608EB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F1F9559927B77D4C000608EB /* SystemBroadcastPickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SystemBroadcastPickerManager.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -158,6 +160,7 @@ 13B07FAE1A68108700A75B9A /* BigBlueButton */ = { isa = PBXGroup; children = ( + F1F9559527B7726F000608EB /* ReactModules */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB51A68108700A75B9A /* Images.xcassets */, @@ -233,6 +236,14 @@ path = BroadcastUploadSetupUI; sourceTree = ""; }; + F1F9559527B7726F000608EB /* ReactModules */ = { + isa = PBXGroup; + children = ( + F1F9559927B77D4C000608EB /* SystemBroadcastPickerManager.m */, + ); + path = ReactModules; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -328,7 +339,7 @@ TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { - LastSwiftMigration = 1120; + LastSwiftMigration = 1320; }; F1F9557127B7612B000608EB = { CreatedOnToolsVersion = 13.2.1; @@ -520,6 +531,7 @@ buildActionMask = 2147483647; files = ( 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, + F1F9559A27B77D4C000608EB /* SystemBroadcastPickerManager.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -633,6 +645,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.bigbluebutton.mobile.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = BigBlueButton; + SWIFT_OBJC_BRIDGING_HEADER = "BigBlueButton-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -659,6 +672,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "org.bigbluebutton.mobile.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = BigBlueButton; + SWIFT_OBJC_BRIDGING_HEADER = "BigBlueButton-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/ios/ReactModules/SystemBroadcastPicker.m b/ios/ReactModules/SystemBroadcastPicker.m deleted file mode 100644 index 8125adc..0000000 --- a/ios/ReactModules/SystemBroadcastPicker.m +++ /dev/null @@ -1,8 +0,0 @@ -// -// SystemBroadcastPicker.m -// BigBlueButton -// -// Created by Tiago Daniel Jacobs on 12/02/22. -// - -#import diff --git a/ios/ReactModules/SystemBroadcastPickerManager.m b/ios/ReactModules/SystemBroadcastPickerManager.m new file mode 100644 index 0000000..106ad96 --- /dev/null +++ b/ios/ReactModules/SystemBroadcastPickerManager.m @@ -0,0 +1,27 @@ +// +// SystemBroadcastPickerManager.h +// BigBlueButton +// +// Here we export RPSystemBroadcastPickerView button to the react application, so we can add it on screen. +// +// Created by Tiago Daniel Jacobs on 12/02/22. +#import +#import + +@interface SystemBroadcastPickerManager : RCTViewManager +@end + +@implementation SystemBroadcastPickerManager + +RCT_EXPORT_MODULE(BBBN_SystemBroadcastPicker) + +- (UIView *)view +{ + UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController; + + RPSystemBroadcastPickerView *pickerView = [[RPSystemBroadcastPickerView alloc]initWithFrame:CGRectMake(0, 0, 16, 16)]; + + return pickerView; +} + +@end diff --git a/react/BroadcastPicker.js b/react/BroadcastPicker.js new file mode 100644 index 0000000..46b33f7 --- /dev/null +++ b/react/BroadcastPicker.js @@ -0,0 +1,8 @@ +import React from 'react'; +import SystemBroadcastPicker from './ios-native-components/BBBN_SystemBroadcastPicker'; + +const BroadcastPicker = ({children, title}): Node => { + return ; +}; + +export default BroadcastPicker; diff --git a/react/ios-native-components/BBBN_SystemBroadcastPicker.js b/react/ios-native-components/BBBN_SystemBroadcastPicker.js new file mode 100644 index 0000000..b727a67 --- /dev/null +++ b/react/ios-native-components/BBBN_SystemBroadcastPicker.js @@ -0,0 +1,3 @@ +import {requireNativeComponent} from 'react-native'; + +export default requireNativeComponent('BBBN_SystemBroadcastPicker');