@woshapp/react-native-background-upload 6.16.0
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/.gitattributes +1 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/android/build.gradle +82 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradle.properties +6 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/appfolio/extensions/ContextExtensions.kt +63 -0
- package/android/src/main/java/com/appfolio/extensions/UploadExtensions.kt +57 -0
- package/android/src/main/java/com/appfolio/uploader/GlobalRequestObserverDelegate.kt +62 -0
- package/android/src/main/java/com/appfolio/uploader/ModifiedBinaryUploadRequest.kt +29 -0
- package/android/src/main/java/com/appfolio/uploader/ModifiedHttpUploadRequest.kt +57 -0
- package/android/src/main/java/com/appfolio/uploader/ModifiedMultipartUploadRequest.kt +60 -0
- package/android/src/main/java/com/appfolio/uploader/UploaderModule.kt +384 -0
- package/android/src/main/java/com/appfolio/uploader/UploaderReactPackage.java +32 -0
- package/android/src/main/java/com/appfolio/work/TaskCompletionNotifier.kt +47 -0
- package/android/src/main/java/com/appfolio/work/UploadManager.kt +109 -0
- package/android/src/main/java/com/appfolio/work/UploadWorker.kt +20 -0
- package/bitbucket-pipelines.yml +14 -0
- package/example/RNBackgroundExample/.buckconfig +6 -0
- package/example/RNBackgroundExample/.eslintrc.js +4 -0
- package/example/RNBackgroundExample/.flowconfig +74 -0
- package/example/RNBackgroundExample/.gitattributes +1 -0
- package/example/RNBackgroundExample/.prettierrc.js +6 -0
- package/example/RNBackgroundExample/.watchmanconfig +1 -0
- package/example/RNBackgroundExample/App.js +325 -0
- package/example/RNBackgroundExample/README.md +50 -0
- package/example/RNBackgroundExample/__tests__/App-test.js +14 -0
- package/example/RNBackgroundExample/android/app/BUCK +55 -0
- package/example/RNBackgroundExample/android/app/build.gradle +225 -0
- package/example/RNBackgroundExample/android/app/build_defs.bzl +19 -0
- package/example/RNBackgroundExample/android/app/debug.keystore +0 -0
- package/example/RNBackgroundExample/android/app/proguard-rules.pro +10 -0
- package/example/RNBackgroundExample/android/app/src/androidTest/java/com/rnbackgroundexample/DetoxTest.java +24 -0
- package/example/RNBackgroundExample/android/app/src/debug/AndroidManifest.xml +8 -0
- package/example/RNBackgroundExample/android/app/src/debug/java/com/rnbackgroundexample/ReactNativeFlipper.java +72 -0
- package/example/RNBackgroundExample/android/app/src/main/AndroidManifest.xml +33 -0
- package/example/RNBackgroundExample/android/app/src/main/java/com/rnbackgroundexample/MainActivity.java +15 -0
- package/example/RNBackgroundExample/android/app/src/main/java/com/rnbackgroundexample/MainApplication.java +76 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/RNBackgroundExample/android/app/src/main/res/values/strings.xml +3 -0
- package/example/RNBackgroundExample/android/app/src/main/res/values/styles.xml +9 -0
- package/example/RNBackgroundExample/android/build.gradle +42 -0
- package/example/RNBackgroundExample/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/RNBackgroundExample/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/RNBackgroundExample/android/gradle.properties +23 -0
- package/example/RNBackgroundExample/android/gradlew +183 -0
- package/example/RNBackgroundExample/android/gradlew.bat +103 -0
- package/example/RNBackgroundExample/android/settings.gradle +3 -0
- package/example/RNBackgroundExample/app.json +4 -0
- package/example/RNBackgroundExample/babel.config.js +3 -0
- package/example/RNBackgroundExample/e2e/config.json +8 -0
- package/example/RNBackgroundExample/e2e/detox.pathbuilder.android.js +4 -0
- package/example/RNBackgroundExample/e2e/detox.pathbuilder.ios.js +4 -0
- package/example/RNBackgroundExample/e2e/detox.pathbuilder.js +21 -0
- package/example/RNBackgroundExample/e2e/environment.js +23 -0
- package/example/RNBackgroundExample/e2e/firstTest.spec.js +56 -0
- package/example/RNBackgroundExample/e2e/server.js +69 -0
- package/example/RNBackgroundExample/e2e/start-server.js +2 -0
- package/example/RNBackgroundExample/index.js +9 -0
- package/example/RNBackgroundExample/ios/App.swift +9 -0
- package/example/RNBackgroundExample/ios/Podfile +24 -0
- package/example/RNBackgroundExample/ios/Podfile.lock +387 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/AppDelegate.h +15 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/AppDelegate.m +42 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/Images.xcassets/Contents.json +6 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/Info.plist +65 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/LaunchScreen.storyboard +58 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample/main.m +16 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample-Bridging-Header.h +4 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample-tvOS/Info.plist +53 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample-tvOSTests/Info.plist +24 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample.xcodeproj/project.pbxproj +991 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample.xcodeproj/xcshareddata/xcschemes/RNBackgroundExample-tvOS.xcscheme +88 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample.xcodeproj/xcshareddata/xcschemes/RNBackgroundExample.xcscheme +88 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExampleTests/Info.plist +24 -0
- package/example/RNBackgroundExample/ios/RNBackgroundExampleTests/RNBackgroundExampleTests.m +72 -0
- package/example/RNBackgroundExample/metro.config.js +22 -0
- package/example/RNBackgroundExample/package.json +71 -0
- package/example/RNBackgroundExample/scripts/deploy-android.sh +14 -0
- package/example/RNBackgroundExample/scripts/deploy-ios.sh +11 -0
- package/example/RNBackgroundExample/scripts/postinstall.sh +13 -0
- package/example/RNBackgroundExample/wait-for-emulator.sh +39 -0
- package/example/RNBackgroundExample/yarn.lock +8165 -0
- package/index.d.ts +154 -0
- package/ios/VydiaRNFileUploader.h +10 -0
- package/ios/VydiaRNFileUploader.m +457 -0
- package/ios/VydiaRNFileUploader.xcodeproj/project.pbxproj +254 -0
- package/package.json +37 -0
- package/react-native-upload.podspec +23 -0
- package/src/index.js +151 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1130"
|
|
4
|
+
version = "1.3">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
|
18
|
+
BuildableName = "RNBackgroundExample-tvOS.app"
|
|
19
|
+
BlueprintName = "RNBackgroundExample-tvOS"
|
|
20
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
+
<Testables>
|
|
31
|
+
<TestableReference
|
|
32
|
+
skipped = "NO">
|
|
33
|
+
<BuildableReference
|
|
34
|
+
BuildableIdentifier = "primary"
|
|
35
|
+
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
|
|
36
|
+
BuildableName = "RNBackgroundExample-tvOSTests.xctest"
|
|
37
|
+
BlueprintName = "RNBackgroundExample-tvOSTests"
|
|
38
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
39
|
+
</BuildableReference>
|
|
40
|
+
</TestableReference>
|
|
41
|
+
</Testables>
|
|
42
|
+
</TestAction>
|
|
43
|
+
<LaunchAction
|
|
44
|
+
buildConfiguration = "Debug"
|
|
45
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
46
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
47
|
+
launchStyle = "0"
|
|
48
|
+
useCustomWorkingDirectory = "NO"
|
|
49
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
50
|
+
debugDocumentVersioning = "YES"
|
|
51
|
+
debugServiceExtension = "internal"
|
|
52
|
+
allowLocationSimulation = "YES">
|
|
53
|
+
<BuildableProductRunnable
|
|
54
|
+
runnableDebuggingMode = "0">
|
|
55
|
+
<BuildableReference
|
|
56
|
+
BuildableIdentifier = "primary"
|
|
57
|
+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
|
58
|
+
BuildableName = "RNBackgroundExample-tvOS.app"
|
|
59
|
+
BlueprintName = "RNBackgroundExample-tvOS"
|
|
60
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
61
|
+
</BuildableReference>
|
|
62
|
+
</BuildableProductRunnable>
|
|
63
|
+
</LaunchAction>
|
|
64
|
+
<ProfileAction
|
|
65
|
+
buildConfiguration = "Release"
|
|
66
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
67
|
+
savedToolIdentifier = ""
|
|
68
|
+
useCustomWorkingDirectory = "NO"
|
|
69
|
+
debugDocumentVersioning = "YES">
|
|
70
|
+
<BuildableProductRunnable
|
|
71
|
+
runnableDebuggingMode = "0">
|
|
72
|
+
<BuildableReference
|
|
73
|
+
BuildableIdentifier = "primary"
|
|
74
|
+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
|
|
75
|
+
BuildableName = "RNBackgroundExample-tvOS.app"
|
|
76
|
+
BlueprintName = "RNBackgroundExample-tvOS"
|
|
77
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
78
|
+
</BuildableReference>
|
|
79
|
+
</BuildableProductRunnable>
|
|
80
|
+
</ProfileAction>
|
|
81
|
+
<AnalyzeAction
|
|
82
|
+
buildConfiguration = "Debug">
|
|
83
|
+
</AnalyzeAction>
|
|
84
|
+
<ArchiveAction
|
|
85
|
+
buildConfiguration = "Release"
|
|
86
|
+
revealArchiveInOrganizer = "YES">
|
|
87
|
+
</ArchiveAction>
|
|
88
|
+
</Scheme>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1130"
|
|
4
|
+
version = "1.3">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
18
|
+
BuildableName = "RNBackgroundExample.app"
|
|
19
|
+
BlueprintName = "RNBackgroundExample"
|
|
20
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
+
<Testables>
|
|
31
|
+
<TestableReference
|
|
32
|
+
skipped = "NO">
|
|
33
|
+
<BuildableReference
|
|
34
|
+
BuildableIdentifier = "primary"
|
|
35
|
+
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
|
|
36
|
+
BuildableName = "RNBackgroundExampleTests.xctest"
|
|
37
|
+
BlueprintName = "RNBackgroundExampleTests"
|
|
38
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
39
|
+
</BuildableReference>
|
|
40
|
+
</TestableReference>
|
|
41
|
+
</Testables>
|
|
42
|
+
</TestAction>
|
|
43
|
+
<LaunchAction
|
|
44
|
+
buildConfiguration = "Debug"
|
|
45
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
46
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
47
|
+
launchStyle = "0"
|
|
48
|
+
useCustomWorkingDirectory = "NO"
|
|
49
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
50
|
+
debugDocumentVersioning = "YES"
|
|
51
|
+
debugServiceExtension = "internal"
|
|
52
|
+
allowLocationSimulation = "YES">
|
|
53
|
+
<BuildableProductRunnable
|
|
54
|
+
runnableDebuggingMode = "0">
|
|
55
|
+
<BuildableReference
|
|
56
|
+
BuildableIdentifier = "primary"
|
|
57
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
58
|
+
BuildableName = "RNBackgroundExample.app"
|
|
59
|
+
BlueprintName = "RNBackgroundExample"
|
|
60
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
61
|
+
</BuildableReference>
|
|
62
|
+
</BuildableProductRunnable>
|
|
63
|
+
</LaunchAction>
|
|
64
|
+
<ProfileAction
|
|
65
|
+
buildConfiguration = "Release"
|
|
66
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
67
|
+
savedToolIdentifier = ""
|
|
68
|
+
useCustomWorkingDirectory = "NO"
|
|
69
|
+
debugDocumentVersioning = "YES">
|
|
70
|
+
<BuildableProductRunnable
|
|
71
|
+
runnableDebuggingMode = "0">
|
|
72
|
+
<BuildableReference
|
|
73
|
+
BuildableIdentifier = "primary"
|
|
74
|
+
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
|
|
75
|
+
BuildableName = "RNBackgroundExample.app"
|
|
76
|
+
BlueprintName = "RNBackgroundExample"
|
|
77
|
+
ReferencedContainer = "container:RNBackgroundExample.xcodeproj">
|
|
78
|
+
</BuildableReference>
|
|
79
|
+
</BuildableProductRunnable>
|
|
80
|
+
</ProfileAction>
|
|
81
|
+
<AnalyzeAction
|
|
82
|
+
buildConfiguration = "Debug">
|
|
83
|
+
</AnalyzeAction>
|
|
84
|
+
<ArchiveAction
|
|
85
|
+
buildConfiguration = "Release"
|
|
86
|
+
revealArchiveInOrganizer = "YES">
|
|
87
|
+
</ArchiveAction>
|
|
88
|
+
</Scheme>
|
|
@@ -0,0 +1,24 @@
|
|
|
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>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>BNDL</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleSignature</key>
|
|
20
|
+
<string>????</string>
|
|
21
|
+
<key>CFBundleVersion</key>
|
|
22
|
+
<string>1</string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
#import <XCTest/XCTest.h>
|
|
10
|
+
|
|
11
|
+
#import <React/RCTLog.h>
|
|
12
|
+
#import <React/RCTRootView.h>
|
|
13
|
+
|
|
14
|
+
#define TIMEOUT_SECONDS 600
|
|
15
|
+
#define TEXT_TO_LOOK_FOR @"Welcome to React"
|
|
16
|
+
|
|
17
|
+
@interface RNBackgroundExampleTests : XCTestCase
|
|
18
|
+
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
@implementation RNBackgroundExampleTests
|
|
22
|
+
|
|
23
|
+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
|
|
24
|
+
{
|
|
25
|
+
if (test(view)) {
|
|
26
|
+
return YES;
|
|
27
|
+
}
|
|
28
|
+
for (UIView *subview in [view subviews]) {
|
|
29
|
+
if ([self findSubviewInView:subview matching:test]) {
|
|
30
|
+
return YES;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return NO;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)testRendersWelcomeScreen
|
|
37
|
+
{
|
|
38
|
+
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
|
|
39
|
+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
|
40
|
+
BOOL foundElement = NO;
|
|
41
|
+
|
|
42
|
+
__block NSString *redboxError = nil;
|
|
43
|
+
#ifdef DEBUG
|
|
44
|
+
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
|
45
|
+
if (level >= RCTLogLevelError) {
|
|
46
|
+
redboxError = message;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
#endif
|
|
50
|
+
|
|
51
|
+
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
|
52
|
+
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
53
|
+
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
54
|
+
|
|
55
|
+
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
|
56
|
+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
57
|
+
return YES;
|
|
58
|
+
}
|
|
59
|
+
return NO;
|
|
60
|
+
}];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#ifdef DEBUG
|
|
64
|
+
RCTSetLogFunction(RCTDefaultLogFunction);
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
|
|
68
|
+
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metro configuration for React Native
|
|
3
|
+
* https://github.com/facebook/react-native
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const blacklist = require('metro-config/src/defaults/blacklist');
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
resolver: {
|
|
12
|
+
blacklistRE: blacklist([/e2e\/.*/, /test\/.*/, /detox\/node_modules\/.*/]),
|
|
13
|
+
},
|
|
14
|
+
transformer: {
|
|
15
|
+
getTransformOptions: async () => ({
|
|
16
|
+
transform: {
|
|
17
|
+
experimentalImportSupport: false,
|
|
18
|
+
inlineRequires: false,
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "RNBackgroundExample",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"server": "node e2e/start-server.js",
|
|
7
|
+
"android": "react-native run-android",
|
|
8
|
+
"ios": "react-native run-ios",
|
|
9
|
+
"start": "react-native start",
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"test/ci": "jest",
|
|
12
|
+
"postinstall": "sh scripts/postinstall.sh",
|
|
13
|
+
"deploy/release/ios": "bash scripts/deploy-ios.sh Release",
|
|
14
|
+
"deploy/debug/ios": "bash scripts/deploy-ios.sh Debug",
|
|
15
|
+
"deploy/release/android": "sh scripts/deploy-android.sh Release",
|
|
16
|
+
"deploy/debug/android": "sh scripts/deploy-android.sh Debug",
|
|
17
|
+
"e2e/deploy/android": "detox build -c android",
|
|
18
|
+
"e2e/test/ios": "detox test -c ios",
|
|
19
|
+
"e2e/test/android": "detox test -c android"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"react": "16.13.1",
|
|
23
|
+
"react-native": "0.63.2",
|
|
24
|
+
"react-native-background-upload": "../../",
|
|
25
|
+
"react-native-fs": "^2.16.1",
|
|
26
|
+
"react-native-image-picker": "^1.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@babel/core": "^7.8.4",
|
|
30
|
+
"@babel/runtime": "^7.8.4",
|
|
31
|
+
"@react-native-community/eslint-config": "^1.1.0",
|
|
32
|
+
"babel-jest": "^26.3.0",
|
|
33
|
+
"content-type": "^1.0.4",
|
|
34
|
+
"detox": "17.4.4",
|
|
35
|
+
"eslint": "^6.6.0",
|
|
36
|
+
"express": "^4.17.1",
|
|
37
|
+
"fs": "^0.0.1-security",
|
|
38
|
+
"jest": "26.x.x",
|
|
39
|
+
"jest-circus": "26.x.x",
|
|
40
|
+
"sanitize-filename": "^1.6.1",
|
|
41
|
+
"metro-react-native-babel-preset": "^0.59.0",
|
|
42
|
+
"multer": "^1.4.2",
|
|
43
|
+
"react-test-renderer": "16.13.1",
|
|
44
|
+
"uuid": "^3.3.3"
|
|
45
|
+
},
|
|
46
|
+
"jest": {
|
|
47
|
+
"preset": "react-native",
|
|
48
|
+
"transform": {
|
|
49
|
+
"^.+\\.js$": "<rootDir>/../../node_modules/react-native/jest/preprocessor.js"
|
|
50
|
+
},
|
|
51
|
+
"testMatch": [
|
|
52
|
+
"<rootDir>/../../(test/unit/**/*.spec.(js|jsx|ts|tsx)|**/__test__/*.(js|jsx|ts|tsx))"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"detox": {
|
|
56
|
+
"test-runner": "jest",
|
|
57
|
+
"configurations": {
|
|
58
|
+
"ios": {
|
|
59
|
+
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/RNBackgroundExample.app",
|
|
60
|
+
"type": "ios.simulator",
|
|
61
|
+
"name": "iPhone 11"
|
|
62
|
+
},
|
|
63
|
+
"android": {
|
|
64
|
+
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
|
|
65
|
+
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
|
|
66
|
+
"type": "android.emulator",
|
|
67
|
+
"name": "emu"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# wait for emulator to be ready
|
|
3
|
+
# thanks to https://gist.github.com/d4vidi/7862d60375b38f8970f824c4ce0ad2a9
|
|
4
|
+
|
|
5
|
+
echo ""
|
|
6
|
+
echo "[Waiting for launcher to start]"
|
|
7
|
+
LAUNCHER_READY=
|
|
8
|
+
while [[ -z ${LAUNCHER_READY} ]]; do
|
|
9
|
+
UI_FOCUS=`adb shell dumpsys window windows 2>/dev/null | grep -i mCurrentFocus`
|
|
10
|
+
echo "(DEBUG) Current focus: ${UI_FOCUS}"
|
|
11
|
+
|
|
12
|
+
case $UI_FOCUS in
|
|
13
|
+
*"Launcher"*)
|
|
14
|
+
LAUNCHER_READY=true
|
|
15
|
+
;;
|
|
16
|
+
"")
|
|
17
|
+
echo "Waiting for window service..."
|
|
18
|
+
sleep 3
|
|
19
|
+
;;
|
|
20
|
+
*"Not Responding"*)
|
|
21
|
+
echo "Detected an ANR! Dismissing..."
|
|
22
|
+
adb shell input keyevent KEYCODE_DPAD_DOWN
|
|
23
|
+
adb shell input keyevent KEYCODE_DPAD_DOWN
|
|
24
|
+
adb shell input keyevent KEYCODE_ENTER
|
|
25
|
+
;;
|
|
26
|
+
*"Isn't responding"*)
|
|
27
|
+
echo "Detected an ANR! Dismissing..."
|
|
28
|
+
adb shell input keyevent KEYCODE_DPAD_DOWN
|
|
29
|
+
adb shell input keyevent KEYCODE_DPAD_DOWN
|
|
30
|
+
adb shell input keyevent KEYCODE_ENTER
|
|
31
|
+
;;
|
|
32
|
+
*)
|
|
33
|
+
echo "Waiting for launcher..."
|
|
34
|
+
sleep 3
|
|
35
|
+
;;
|
|
36
|
+
esac
|
|
37
|
+
done
|
|
38
|
+
|
|
39
|
+
echo "Launcher is ready :-)"
|