ソースを参照

iOS修改单例逻辑

邓博 7 年 前
コミット
6d9daa91b5

+ 5
- 4
.gitignore ファイルの表示

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

RTCEngine.js → RtcEngine.js ファイルの表示


+ 2
- 2
index.js ファイルの表示

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

+ 18
- 0
ios/RCTAgora.xcodeproj/project.pbxproj ファイルの表示

9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
10
 		23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */ = {isa = PBXBuildFile; fileRef = 23AF28201EEFECD800D771AB /* RCTAgora.m */; };
10
 		23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */ = {isa = PBXBuildFile; fileRef = 23AF28201EEFECD800D771AB /* RCTAgora.m */; };
11
 		23AF28221EEFECD800D771AB /* RCTAgora.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23AF281F1EEFECD800D771AB /* RCTAgora.h */; };
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
 /* End PBXBuildFile section */
15
 /* End PBXBuildFile section */
13
 
16
 
14
 /* Begin PBXCopyFilesBuildPhase section */
17
 /* Begin PBXCopyFilesBuildPhase section */
29
 		23AF281C1EEFECD800D771AB /* libRCTAgora.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAgora.a; sourceTree = BUILT_PRODUCTS_DIR; };
32
 		23AF281C1EEFECD800D771AB /* libRCTAgora.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAgora.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
 		23AF281F1EEFECD800D771AB /* RCTAgora.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAgora.h; sourceTree = "<group>"; };
33
 		23AF281F1EEFECD800D771AB /* RCTAgora.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAgora.h; sourceTree = "<group>"; };
31
 		23AF28201EEFECD800D771AB /* RCTAgora.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTAgora.m; sourceTree = "<group>"; };
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
 /* End PBXFileReference section */
41
 /* End PBXFileReference section */
33
 
42
 
34
 /* Begin PBXFrameworksBuildPhase section */
43
 /* Begin PBXFrameworksBuildPhase section */
62
 			isa = PBXGroup;
71
 			isa = PBXGroup;
63
 			children = (
72
 			children = (
64
 				23ACF47C1EF0CF9500801BC7 /* libs */,
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
 				23AF281F1EEFECD800D771AB /* RCTAgora.h */,
80
 				23AF281F1EEFECD800D771AB /* RCTAgora.h */,
66
 				23AF28201EEFECD800D771AB /* RCTAgora.m */,
81
 				23AF28201EEFECD800D771AB /* RCTAgora.m */,
67
 			);
82
 			);
126
 			isa = PBXSourcesBuildPhase;
141
 			isa = PBXSourcesBuildPhase;
127
 			buildActionMask = 2147483647;
142
 			buildActionMask = 2147483647;
128
 			files = (
143
 			files = (
144
+				23C20DD21F0A6ED80095F60C /* RCTAgoraVideoView.m in Sources */,
145
+				23C20DD31F0A6ED80095F60C /* RCTAgoraViewManager.m in Sources */,
146
+				23C20DD11F0A6ED80095F60C /* AgoraConst.m in Sources */,
129
 				23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */,
147
 				23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */,
130
 			);
148
 			);
131
 			runOnlyForDeploymentPostprocessing = 0;
149
 			runOnlyForDeploymentPostprocessing = 0;

バイナリ
ios/RCTAgora.xcodeproj/project.xcworkspace/xcuserdata/DB.xcuserdatad/UserInterfaceState.xcuserstate ファイルの表示


+ 2
- 0
ios/RCTAgora/AgoraConst.h ファイルの表示

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

+ 2
- 0
ios/RCTAgora/RCTAgora.m ファイルの表示

52
     
52
     
53
     self.rtcEngine = [AgoraRtcEngineKit sharedEngineWithAppId:options[@"appid"] delegate:self];
53
     self.rtcEngine = [AgoraRtcEngineKit sharedEngineWithAppId:options[@"appid"] delegate:self];
54
     
54
     
55
+    [AgoraConst share].rtcEngine = self.rtcEngine;
56
+    
55
     //频道模式
57
     //频道模式
56
     [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
58
     [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
57
     //启用双流模式
59
     //启用双流模式

+ 1
- 1
ios/RCTAgora/RCTAgoraVideoView.m ファイルの表示

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

+ 1
- 1
package.json ファイルの表示

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