Explorar el Código

iOS修改单例逻辑

邓博 hace 7 años
padre
commit
6d9daa91b5

+ 5
- 4
.gitignore Ver fichero

@@ -13,14 +13,14 @@ build/
13 13
 !default.mode2v3
14 14
 *.perspectivev3
15 15
 !default.perspectivev3
16
-xcuserdata
16
+#xcuserdata
17 17
 *.xccheckout
18 18
 *.moved-aside
19 19
 DerivedData
20 20
 *.hmap
21 21
 *.ipa
22
-*.xcuserstate
23
-project.xcworkspace
22
+#*.xcuserstate
23
+#project.xcworkspace
24 24
 
25 25
 # Android/IntelliJ
26 26
 #
@@ -50,4 +50,5 @@ buck-out/
50 50
 
51 51
 fastlane/report.xml
52 52
 fastlane/Preview.html
53
-fastlane/screenshots
53
+fastlane/screenshots
54
+android/src/main/res/drawable/

RTCEngine.js → RtcEngine.js Ver fichero


+ 2
- 2
index.js Ver fichero

@@ -1,6 +1,6 @@
1 1
 
2 2
 import _AgoraView from './AgoraView'
3
-import _RTCEngine from './RTCEngine'
3
+import _RtcEngine from './RtcEngine'
4 4
 
5 5
 export const AgoraView = _AgoraView;
6
-export const RTCEngine = _RTCEngine;
6
+export const RtcEngine = _RtcEngine;

+ 18
- 0
ios/RCTAgora.xcodeproj/project.pbxproj Ver fichero

@@ -9,6 +9,9 @@
9 9
 /* Begin PBXBuildFile section */
10 10
 		23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */ = {isa = PBXBuildFile; fileRef = 23AF28201EEFECD800D771AB /* RCTAgora.m */; };
11 11
 		23AF28221EEFECD800D771AB /* RCTAgora.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23AF281F1EEFECD800D771AB /* RCTAgora.h */; };
12
+		23C20DD11F0A6ED80095F60C /* AgoraConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C20DCC1F0A6ED80095F60C /* AgoraConst.m */; };
13
+		23C20DD21F0A6ED80095F60C /* RCTAgoraVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C20DCE1F0A6ED80095F60C /* RCTAgoraVideoView.m */; };
14
+		23C20DD31F0A6ED80095F60C /* RCTAgoraViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C20DD01F0A6ED80095F60C /* RCTAgoraViewManager.m */; };
12 15
 /* End PBXBuildFile section */
13 16
 
14 17
 /* Begin PBXCopyFilesBuildPhase section */
@@ -29,6 +32,12 @@
29 32
 		23AF281C1EEFECD800D771AB /* libRCTAgora.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAgora.a; sourceTree = BUILT_PRODUCTS_DIR; };
30 33
 		23AF281F1EEFECD800D771AB /* RCTAgora.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAgora.h; sourceTree = "<group>"; };
31 34
 		23AF28201EEFECD800D771AB /* RCTAgora.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTAgora.m; sourceTree = "<group>"; };
35
+		23C20DCB1F0A6ED80095F60C /* AgoraConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AgoraConst.h; sourceTree = "<group>"; };
36
+		23C20DCC1F0A6ED80095F60C /* AgoraConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AgoraConst.m; sourceTree = "<group>"; };
37
+		23C20DCD1F0A6ED80095F60C /* RCTAgoraVideoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAgoraVideoView.h; sourceTree = "<group>"; };
38
+		23C20DCE1F0A6ED80095F60C /* RCTAgoraVideoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAgoraVideoView.m; sourceTree = "<group>"; };
39
+		23C20DCF1F0A6ED80095F60C /* RCTAgoraViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAgoraViewManager.h; sourceTree = "<group>"; };
40
+		23C20DD01F0A6ED80095F60C /* RCTAgoraViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAgoraViewManager.m; sourceTree = "<group>"; };
32 41
 /* End PBXFileReference section */
33 42
 
34 43
 /* Begin PBXFrameworksBuildPhase section */
@@ -62,6 +71,12 @@
62 71
 			isa = PBXGroup;
63 72
 			children = (
64 73
 				23ACF47C1EF0CF9500801BC7 /* libs */,
74
+				23C20DCB1F0A6ED80095F60C /* AgoraConst.h */,
75
+				23C20DCC1F0A6ED80095F60C /* AgoraConst.m */,
76
+				23C20DCD1F0A6ED80095F60C /* RCTAgoraVideoView.h */,
77
+				23C20DCE1F0A6ED80095F60C /* RCTAgoraVideoView.m */,
78
+				23C20DCF1F0A6ED80095F60C /* RCTAgoraViewManager.h */,
79
+				23C20DD01F0A6ED80095F60C /* RCTAgoraViewManager.m */,
65 80
 				23AF281F1EEFECD800D771AB /* RCTAgora.h */,
66 81
 				23AF28201EEFECD800D771AB /* RCTAgora.m */,
67 82
 			);
@@ -126,6 +141,9 @@
126 141
 			isa = PBXSourcesBuildPhase;
127 142
 			buildActionMask = 2147483647;
128 143
 			files = (
144
+				23C20DD21F0A6ED80095F60C /* RCTAgoraVideoView.m in Sources */,
145
+				23C20DD31F0A6ED80095F60C /* RCTAgoraViewManager.m in Sources */,
146
+				23C20DD11F0A6ED80095F60C /* AgoraConst.m in Sources */,
129 147
 				23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */,
130 148
 			);
131 149
 			runOnlyForDeploymentPostprocessing = 0;

BIN
ios/RCTAgora.xcodeproj/project.xcworkspace/xcuserdata/DB.xcuserdatad/UserInterfaceState.xcuserstate Ver fichero


+ 2
- 0
ios/RCTAgora/AgoraConst.h Ver fichero

@@ -12,6 +12,8 @@
12 12
 
13 13
 @property (nonatomic, copy) NSString *appid;
14 14
 
15
+@property (strong, nonatomic) AgoraRtcEngineKit *rtcEngine;
16
+
15 17
 + (instancetype)share;
16 18
 
17 19
 @end

+ 2
- 0
ios/RCTAgora/RCTAgora.m Ver fichero

@@ -52,6 +52,8 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
52 52
     
53 53
     self.rtcEngine = [AgoraRtcEngineKit sharedEngineWithAppId:options[@"appid"] delegate:self];
54 54
     
55
+    [AgoraConst share].rtcEngine = self.rtcEngine;
56
+    
55 57
     //频道模式
56 58
     [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
57 59
     //启用双流模式

+ 1
- 1
ios/RCTAgora/RCTAgoraVideoView.m Ver fichero

@@ -13,7 +13,7 @@
13 13
 - (instancetype)init{
14 14
     
15 15
     if (self == [super init]) {
16
-        _rtcEngine =  [AgoraRtcEngineKit sharedEngineWithAppId:[AgoraConst share].appid delegate:nil];
16
+        _rtcEngine = [AgoraConst share].rtcEngine;
17 17
     }
18 18
     
19 19
     return self;

+ 1
- 1
package.json Ver fichero

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "react-native-agora",
3
-  "version": "1.0.5",
3
+  "version": "1.0.6",
4 4
   "description": "声网Agora",
5 5
   "main": "index.js",
6 6
   "scripts": {