jcore-react-native 1.9.5 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +3 -0
- package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/libs/arm64-v8a/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/armeabi/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/armeabi-v7a/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/jcore-android-3.2.2.jar +0 -0
- package/android/libs/mips/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/mips64/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/x86/{libjcore310.so → libjcore322.so} +0 -0
- package/android/libs/x86_64/{libjcore310.so → libjcore322.so} +0 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCoreModule.java +48 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCorePackage.java +27 -0
- package/example/.buckconfig +6 -0
- package/example/.bundle/config +2 -0
- package/example/.eslintrc.js +4 -0
- package/example/.flowconfig +65 -0
- package/example/.prettierrc.js +7 -0
- package/example/.ruby-version +1 -0
- package/example/.watchmanconfig +1 -0
- package/example/App.js +112 -0
- package/example/Gemfile +6 -0
- package/example/__tests__/App-test.js +14 -0
- package/example/android/app/BUCK +55 -0
- package/example/android/app/build.gradle +227 -0
- package/example/android/app/build_defs.bzl +19 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +13 -0
- package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +72 -0
- package/example/android/app/src/main/AndroidManifest.xml +25 -0
- package/example/android/app/src/main/java/com/example/MainActivity.java +15 -0
- package/example/android/app/src/main/java/com/example/MainApplication.java +80 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +42 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/android/gradlew +185 -0
- package/example/android/gradlew.bat +89 -0
- package/example/android/settings.gradle +3 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +3 -0
- package/example/index.js +9 -0
- package/example/ios/Podfile +30 -0
- package/example/ios/example/AppDelegate.h +8 -0
- package/example/ios/example/AppDelegate.m +62 -0
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/example/ios/example/Images.xcassets/Contents.json +6 -0
- package/example/ios/example/Info.plist +55 -0
- package/example/ios/example/LaunchScreen.storyboard +47 -0
- package/example/ios/example/main.m +9 -0
- package/example/ios/example.xcodeproj/project.pbxproj +540 -0
- package/example/ios/example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -0
- package/example/ios/exampleTests/Info.plist +24 -0
- package/example/ios/exampleTests/exampleTests.m +65 -0
- package/example/metro.config.js +17 -0
- package/example/package.json +30 -0
- package/index.js +16 -0
- package/ios/RCTJCoreModule/Lib/JGInforCollectionAuth.h +27 -0
- package/ios/RCTJCoreModule/{libjcore-ios-2.7.1.a → Lib/jcore-ios-3.2.1.a} +0 -0
- package/ios/RCTJCoreModule/RCTJCoreModule.h +13 -1
- package/ios/RCTJCoreModule/RCTJCoreModule.m +15 -0
- package/ios/RCTJCoreModule.xcodeproj/project.pbxproj +12 -4
- package/ios/RCTJCoreModule.xcodeproj/project.xcworkspace/xcuserdata/douban.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RCTJCoreModule.xcodeproj/xcuserdata/douban.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +1 -1
- package/android/libs/jcore-android-3.1.0.jar +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <XCTest/XCTest.h>
|
|
3
|
+
|
|
4
|
+
#import <React/RCTLog.h>
|
|
5
|
+
#import <React/RCTRootView.h>
|
|
6
|
+
|
|
7
|
+
#define TIMEOUT_SECONDS 600
|
|
8
|
+
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
9
|
+
|
|
10
|
+
@interface exampleTests : XCTestCase
|
|
11
|
+
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@implementation exampleTests
|
|
15
|
+
|
|
16
|
+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
|
|
17
|
+
{
|
|
18
|
+
if (test(view)) {
|
|
19
|
+
return YES;
|
|
20
|
+
}
|
|
21
|
+
for (UIView *subview in [view subviews]) {
|
|
22
|
+
if ([self findSubviewInView:subview matching:test]) {
|
|
23
|
+
return YES;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return NO;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (void)testRendersWelcomeScreen
|
|
30
|
+
{
|
|
31
|
+
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
32
|
+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
33
|
+
BOOL foundElement = NO;
|
|
34
|
+
|
|
35
|
+
__block NSString *redboxError = nil;
|
|
36
|
+
#ifdef DEBUG
|
|
37
|
+
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
38
|
+
if (level >= RCTLogLevelError) {
|
|
39
|
+
redboxError = message;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
45
|
+
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
46
|
+
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
47
|
+
|
|
48
|
+
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
|
49
|
+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
50
|
+
return YES;
|
|
51
|
+
}
|
|
52
|
+
return NO;
|
|
53
|
+
}];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#ifdef DEBUG
|
|
57
|
+
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
61
|
+
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metro configuration for React Native
|
|
3
|
+
* https://github.com/facebook/react-native
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
transformer: {
|
|
10
|
+
getTransformOptions: async () => ({
|
|
11
|
+
transform: {
|
|
12
|
+
experimentalImportSupport: false,
|
|
13
|
+
inlineRequires: true,
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"android": "react-native run-android",
|
|
7
|
+
"ios": "react-native run-ios",
|
|
8
|
+
"start": "react-native start",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"lint": "eslint ."
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"jcore-react-native": "^1.9.5",
|
|
14
|
+
"react": "17.0.2",
|
|
15
|
+
"react-native": "0.67.4"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@babel/core": "^7.17.8",
|
|
19
|
+
"@babel/runtime": "^7.17.8",
|
|
20
|
+
"@react-native-community/eslint-config": "^3.0.1",
|
|
21
|
+
"babel-jest": "^27.5.1",
|
|
22
|
+
"eslint": "^8.11.0",
|
|
23
|
+
"jest": "^27.5.1",
|
|
24
|
+
"metro-react-native-babel-preset": "^0.69.1",
|
|
25
|
+
"react-test-renderer": "17.0.2"
|
|
26
|
+
},
|
|
27
|
+
"jest": {
|
|
28
|
+
"preset": "react-native"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// JGInforCollectionAuth.h
|
|
3
|
+
// JCore
|
|
4
|
+
//
|
|
5
|
+
// Created by 豆瓣 on 2021/10/27.
|
|
6
|
+
// Copyright © 2021 jiguang. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
/// 合规接口,是否授权极光采集一定的设备信息
|
|
14
|
+
@interface JGInforCollectionAuthItems : NSObject
|
|
15
|
+
/// 是否授权,默认YES
|
|
16
|
+
@property(nonatomic,assign)BOOL isAuth;
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@interface JGInforCollectionAuth : NSObject
|
|
20
|
+
|
|
21
|
+
/// 设备信息采集授权接口(合规接口)
|
|
22
|
+
/// 请务必在调用初始化、功能性接口前调用此接口进行合规授权
|
|
23
|
+
/// @param authBlock auth:YES 则极光认为您同意极光采集一定的设备信息
|
|
24
|
+
+(void)JCollectionAuth:(void(^_Nullable)(JGInforCollectionAuthItems *authInfo))authBlock;
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
NS_ASSUME_NONNULL_END
|
|
Binary file
|
|
@@ -7,7 +7,19 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
#import <Foundation/Foundation.h>
|
|
10
|
+
#if __has_include(<React/RCTBridge.h>)
|
|
11
|
+
#import <React/RCTEventEmitter.h>
|
|
12
|
+
#import <React/RCTRootView.h>
|
|
13
|
+
#import <React/RCTBridge.h>
|
|
14
|
+
#elif __has_include("RCTBridge.h")
|
|
15
|
+
#import "RCTEventEmitter.h"
|
|
16
|
+
#import "RCTRootView.h"
|
|
17
|
+
#import "RCTBridge.h"
|
|
18
|
+
#endif
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
#import <React/RCTRootView.h>
|
|
21
|
+
#import <React/RCTBundleURLProvider.h>
|
|
22
|
+
|
|
23
|
+
@interface RCTJCoreModule : RCTEventEmitter<RCTBridgeModule>
|
|
12
24
|
|
|
13
25
|
@end
|
|
@@ -7,7 +7,22 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
#import "RCTJCoreModule.h"
|
|
10
|
+
#import "JGInforCollectionAuth.h"
|
|
10
11
|
|
|
11
12
|
@implementation RCTJCoreModule
|
|
12
13
|
|
|
14
|
+
#define JgLog(fmt, ...) NSLog((@"| JGER | iOS | " fmt), ##__VA_ARGS__)
|
|
15
|
+
|
|
16
|
+
RCT_EXPORT_MODULE(JCoreModule);
|
|
17
|
+
|
|
18
|
+
#pragma mark --- 设备信息采集授权接口(合规接口)
|
|
19
|
+
RCT_EXPORT_METHOD(setAuth: (BOOL *)enable)
|
|
20
|
+
{
|
|
21
|
+
JgLog("JCollectionAuth %d",enable);
|
|
22
|
+
__block BOOL isAuth= enable;
|
|
23
|
+
[JGInforCollectionAuth JCollectionAuth:^(JGInforCollectionAuthItems * _Nonnull authInfo) {
|
|
24
|
+
authInfo.isAuth = isAuth;
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
27
|
+
|
|
13
28
|
@end
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
|
|
10
|
+
08166A7B27EC622A00C7233B /* RCTJCoreModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */; };
|
|
11
|
+
08166A7E27EC62A900C7233B /* jcore-ios-3.2.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */; };
|
|
11
12
|
6212E9F11F3991D500BDF51A /* RCTJCoreModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */; };
|
|
12
13
|
/* End PBXBuildFile section */
|
|
13
14
|
|
|
@@ -18,13 +19,15 @@
|
|
|
18
19
|
dstPath = "include/$(PRODUCT_NAME)";
|
|
19
20
|
dstSubfolderSpec = 16;
|
|
20
21
|
files = (
|
|
22
|
+
08166A7B27EC622A00C7233B /* RCTJCoreModule.h in CopyFiles */,
|
|
21
23
|
);
|
|
22
24
|
runOnlyForDeploymentPostprocessing = 0;
|
|
23
25
|
};
|
|
24
26
|
/* End PBXCopyFilesBuildPhase section */
|
|
25
27
|
|
|
26
28
|
/* Begin PBXFileReference section */
|
|
27
|
-
|
|
29
|
+
08166A7C27EC628200C7233B /* Lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Lib; sourceTree = "<group>"; };
|
|
30
|
+
08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "jcore-ios-3.2.1.a"; path = "RCTJCoreModule/Lib/jcore-ios-3.2.1.a"; sourceTree = "<group>"; };
|
|
28
31
|
6212E9B41F3990DC00BDF51A /* libRCTJCoreModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJCoreModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
29
32
|
6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJCoreModule.h; sourceTree = "<group>"; };
|
|
30
33
|
6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJCoreModule.m; sourceTree = "<group>"; };
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
isa = PBXFrameworksBuildPhase;
|
|
36
39
|
buildActionMask = 2147483647;
|
|
37
40
|
files = (
|
|
38
|
-
|
|
41
|
+
08166A7E27EC62A900C7233B /* jcore-ios-3.2.1.a in Frameworks */,
|
|
39
42
|
);
|
|
40
43
|
runOnlyForDeploymentPostprocessing = 0;
|
|
41
44
|
};
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
5CE8168A22FC0295007D710C /* Frameworks */ = {
|
|
46
49
|
isa = PBXGroup;
|
|
47
50
|
children = (
|
|
48
|
-
|
|
51
|
+
08166A7D27EC62A900C7233B /* jcore-ios-3.2.1.a */,
|
|
49
52
|
);
|
|
50
53
|
name = Frameworks;
|
|
51
54
|
sourceTree = "<group>";
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
6212E9B61F3990DC00BDF51A /* RCTJCoreModule */ = {
|
|
71
74
|
isa = PBXGroup;
|
|
72
75
|
children = (
|
|
76
|
+
08166A7C27EC628200C7233B /* Lib */,
|
|
73
77
|
6212E9EF1F3991D500BDF51A /* RCTJCoreModule.h */,
|
|
74
78
|
6212E9F01F3991D500BDF51A /* RCTJCoreModule.m */,
|
|
75
79
|
);
|
|
@@ -236,9 +240,11 @@
|
|
|
236
240
|
isa = XCBuildConfiguration;
|
|
237
241
|
buildSettings = {
|
|
238
242
|
DEVELOPMENT_TEAM = RL64Y54S9V;
|
|
243
|
+
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/RCTJCoreModule/Lib/**";
|
|
239
244
|
LIBRARY_SEARCH_PATHS = (
|
|
240
245
|
"$(inherited)",
|
|
241
246
|
"$(PROJECT_DIR)/RCTJCoreModule",
|
|
247
|
+
"$(PROJECT_DIR)/RCTJCoreModule/Lib",
|
|
242
248
|
);
|
|
243
249
|
OTHER_LDFLAGS = "-ObjC";
|
|
244
250
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
@@ -250,9 +256,11 @@
|
|
|
250
256
|
isa = XCBuildConfiguration;
|
|
251
257
|
buildSettings = {
|
|
252
258
|
DEVELOPMENT_TEAM = RL64Y54S9V;
|
|
259
|
+
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/RCTJCoreModule/Lib/**";
|
|
253
260
|
LIBRARY_SEARCH_PATHS = (
|
|
254
261
|
"$(inherited)",
|
|
255
262
|
"$(PROJECT_DIR)/RCTJCoreModule",
|
|
263
|
+
"$(PROJECT_DIR)/RCTJCoreModule/Lib",
|
|
256
264
|
);
|
|
257
265
|
OTHER_LDFLAGS = "-ObjC";
|
|
258
266
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>RCTJCoreModule.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
package/package.json
CHANGED
|
Binary file
|