rn-bg-actions 1.0.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/LICENSE +21 -0
- package/README.md +211 -0
- package/android/build.gradle +24 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/asterinet/react/bgactions/BackgroundActionsModule.java +91 -0
- package/android/src/main/java/com/asterinet/react/bgactions/BackgroundActionsPackage.java +26 -0
- package/android/src/main/java/com/asterinet/react/bgactions/BackgroundTaskOptions.java +104 -0
- package/android/src/main/java/com/asterinet/react/bgactions/RNBackgroundActionsTask.java +120 -0
- package/ios/RNBackgroundActions.h +6 -0
- package/ios/RNBackgroundActions.m +53 -0
- package/ios/RNBackgroundActions.xcodeproj/project.pbxproj +426 -0
- package/lib/types/RNBackgroundActionsModule.d.ts +2 -0
- package/lib/types/index.d.ts +127 -0
- package/package.json +77 -0
- package/react-native-background-actions.podspec +19 -0
- package/src/RNBackgroundActionsModule.js +7 -0
- package/src/index.js +138 -0
@@ -0,0 +1,426 @@
|
|
1
|
+
// !$*UTF8*$!
|
2
|
+
{
|
3
|
+
archiveVersion = 1;
|
4
|
+
classes = {
|
5
|
+
};
|
6
|
+
objectVersion = 46;
|
7
|
+
objects = {
|
8
|
+
|
9
|
+
/* Begin PBXBuildFile section */
|
10
|
+
379852B93950BCF4EB85ADA5 /* Pods_RNBackgroundActions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12CAC3D778A2077AE84799FE /* Pods_RNBackgroundActions.framework */; };
|
11
|
+
6419269B1ECB4266009CF731 /* RNBackgroundActions.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNBackgroundActions.m */; };
|
12
|
+
B3E7B58A1CC2AC0600A0062D /* RNBackgroundActions.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNBackgroundActions.m */; };
|
13
|
+
/* End PBXBuildFile section */
|
14
|
+
|
15
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
16
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
17
|
+
isa = PBXCopyFilesBuildPhase;
|
18
|
+
buildActionMask = 2147483647;
|
19
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
20
|
+
dstSubfolderSpec = 16;
|
21
|
+
files = (
|
22
|
+
);
|
23
|
+
runOnlyForDeploymentPostprocessing = 0;
|
24
|
+
};
|
25
|
+
641926901ECB4257009CF731 /* CopyFiles */ = {
|
26
|
+
isa = PBXCopyFilesBuildPhase;
|
27
|
+
buildActionMask = 2147483647;
|
28
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
29
|
+
dstSubfolderSpec = 16;
|
30
|
+
files = (
|
31
|
+
);
|
32
|
+
runOnlyForDeploymentPostprocessing = 0;
|
33
|
+
};
|
34
|
+
/* End PBXCopyFilesBuildPhase section */
|
35
|
+
|
36
|
+
/* Begin PBXFileReference section */
|
37
|
+
12CAC3D778A2077AE84799FE /* Pods_RNBackgroundActions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNBackgroundActions.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
38
|
+
134814201AA4EA6300B7C361 /* libRNBackgroundActions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNBackgroundActions.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
39
|
+
5694935E99A79F9E84DE86A2 /* Pods-RNBackgroundActions.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNBackgroundActions.release.xcconfig"; path = "Target Support Files/Pods-RNBackgroundActions/Pods-RNBackgroundActions.release.xcconfig"; sourceTree = "<group>"; };
|
40
|
+
641926921ECB4257009CF731 /* libRNBackgroundActions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNBackgroundActions.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
41
|
+
71DD9836C50E2FFD2D98ADD0 /* Pods-RNBackgroundActions.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNBackgroundActions.debug.xcconfig"; path = "Target Support Files/Pods-RNBackgroundActions/Pods-RNBackgroundActions.debug.xcconfig"; sourceTree = "<group>"; };
|
42
|
+
B3E7B5881CC2AC0600A0062D /* RNBackgroundActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBackgroundActions.h; sourceTree = "<group>"; };
|
43
|
+
B3E7B5891CC2AC0600A0062D /* RNBackgroundActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNBackgroundActions.m; sourceTree = "<group>"; };
|
44
|
+
/* End PBXFileReference section */
|
45
|
+
|
46
|
+
/* Begin PBXFrameworksBuildPhase section */
|
47
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
48
|
+
isa = PBXFrameworksBuildPhase;
|
49
|
+
buildActionMask = 2147483647;
|
50
|
+
files = (
|
51
|
+
379852B93950BCF4EB85ADA5 /* Pods_RNBackgroundActions.framework in Frameworks */,
|
52
|
+
);
|
53
|
+
runOnlyForDeploymentPostprocessing = 0;
|
54
|
+
};
|
55
|
+
6419268F1ECB4257009CF731 /* Frameworks */ = {
|
56
|
+
isa = PBXFrameworksBuildPhase;
|
57
|
+
buildActionMask = 2147483647;
|
58
|
+
files = (
|
59
|
+
);
|
60
|
+
runOnlyForDeploymentPostprocessing = 0;
|
61
|
+
};
|
62
|
+
/* End PBXFrameworksBuildPhase section */
|
63
|
+
|
64
|
+
/* Begin PBXGroup section */
|
65
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
66
|
+
isa = PBXGroup;
|
67
|
+
children = (
|
68
|
+
134814201AA4EA6300B7C361 /* libRNBackgroundActions.a */,
|
69
|
+
);
|
70
|
+
name = Products;
|
71
|
+
sourceTree = "<group>";
|
72
|
+
};
|
73
|
+
1CF73046BC523C646FA05356 /* Frameworks */ = {
|
74
|
+
isa = PBXGroup;
|
75
|
+
children = (
|
76
|
+
12CAC3D778A2077AE84799FE /* Pods_RNBackgroundActions.framework */,
|
77
|
+
);
|
78
|
+
name = Frameworks;
|
79
|
+
sourceTree = "<group>";
|
80
|
+
};
|
81
|
+
58B511D21A9E6C8500147676 = {
|
82
|
+
isa = PBXGroup;
|
83
|
+
children = (
|
84
|
+
B3E7B5881CC2AC0600A0062D /* RNBackgroundActions.h */,
|
85
|
+
B3E7B5891CC2AC0600A0062D /* RNBackgroundActions.m */,
|
86
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
87
|
+
641926921ECB4257009CF731 /* libRNBackgroundActions.a */,
|
88
|
+
62EDDBCED6A5B89493EF0704 /* Pods */,
|
89
|
+
1CF73046BC523C646FA05356 /* Frameworks */,
|
90
|
+
);
|
91
|
+
sourceTree = "<group>";
|
92
|
+
};
|
93
|
+
62EDDBCED6A5B89493EF0704 /* Pods */ = {
|
94
|
+
isa = PBXGroup;
|
95
|
+
children = (
|
96
|
+
71DD9836C50E2FFD2D98ADD0 /* Pods-RNBackgroundActions.debug.xcconfig */,
|
97
|
+
5694935E99A79F9E84DE86A2 /* Pods-RNBackgroundActions.release.xcconfig */,
|
98
|
+
);
|
99
|
+
path = Pods;
|
100
|
+
sourceTree = "<group>";
|
101
|
+
};
|
102
|
+
/* End PBXGroup section */
|
103
|
+
|
104
|
+
/* Begin PBXNativeTarget section */
|
105
|
+
58B511DA1A9E6C8500147676 /* RNBackgroundActions */ = {
|
106
|
+
isa = PBXNativeTarget;
|
107
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBackgroundActions" */;
|
108
|
+
buildPhases = (
|
109
|
+
9E63BEA3B70BEBF00C883285 /* [CP] Check Pods Manifest.lock */,
|
110
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
111
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
112
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
113
|
+
);
|
114
|
+
buildRules = (
|
115
|
+
);
|
116
|
+
dependencies = (
|
117
|
+
);
|
118
|
+
name = RNBackgroundActions;
|
119
|
+
productName = RCTDataManager;
|
120
|
+
productReference = 134814201AA4EA6300B7C361 /* libRNBackgroundActions.a */;
|
121
|
+
productType = "com.apple.product-type.library.static";
|
122
|
+
};
|
123
|
+
641926911ECB4257009CF731 /* RNBackgroundActions-tvOS */ = {
|
124
|
+
isa = PBXNativeTarget;
|
125
|
+
buildConfigurationList = 6419269A1ECB4257009CF731 /* Build configuration list for PBXNativeTarget "RNBackgroundActions-tvOS" */;
|
126
|
+
buildPhases = (
|
127
|
+
6419268E1ECB4257009CF731 /* Sources */,
|
128
|
+
6419268F1ECB4257009CF731 /* Frameworks */,
|
129
|
+
641926901ECB4257009CF731 /* CopyFiles */,
|
130
|
+
);
|
131
|
+
buildRules = (
|
132
|
+
);
|
133
|
+
dependencies = (
|
134
|
+
);
|
135
|
+
name = "RNBackgroundActions-tvOS";
|
136
|
+
productName = "RNBackgroundActions-tvOS";
|
137
|
+
productReference = 641926921ECB4257009CF731 /* libRNBackgroundActions.a */;
|
138
|
+
productType = "com.apple.product-type.library.static";
|
139
|
+
};
|
140
|
+
/* End PBXNativeTarget section */
|
141
|
+
|
142
|
+
/* Begin PBXProject section */
|
143
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
144
|
+
isa = PBXProject;
|
145
|
+
attributes = {
|
146
|
+
LastUpgradeCheck = 1130;
|
147
|
+
ORGANIZATIONNAME = Facebook;
|
148
|
+
TargetAttributes = {
|
149
|
+
58B511DA1A9E6C8500147676 = {
|
150
|
+
CreatedOnToolsVersion = 6.1.1;
|
151
|
+
};
|
152
|
+
641926911ECB4257009CF731 = {
|
153
|
+
CreatedOnToolsVersion = 8.3.2;
|
154
|
+
ProvisioningStyle = Automatic;
|
155
|
+
};
|
156
|
+
};
|
157
|
+
};
|
158
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBackgroundActions" */;
|
159
|
+
compatibilityVersion = "Xcode 3.2";
|
160
|
+
developmentRegion = en;
|
161
|
+
hasScannedForEncodings = 0;
|
162
|
+
knownRegions = (
|
163
|
+
en,
|
164
|
+
Base,
|
165
|
+
);
|
166
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
167
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
168
|
+
projectDirPath = "";
|
169
|
+
projectRoot = "";
|
170
|
+
targets = (
|
171
|
+
58B511DA1A9E6C8500147676 /* RNBackgroundActions */,
|
172
|
+
641926911ECB4257009CF731 /* RNBackgroundActions-tvOS */,
|
173
|
+
);
|
174
|
+
};
|
175
|
+
/* End PBXProject section */
|
176
|
+
|
177
|
+
/* Begin PBXShellScriptBuildPhase section */
|
178
|
+
9E63BEA3B70BEBF00C883285 /* [CP] Check Pods Manifest.lock */ = {
|
179
|
+
isa = PBXShellScriptBuildPhase;
|
180
|
+
buildActionMask = 2147483647;
|
181
|
+
files = (
|
182
|
+
);
|
183
|
+
inputFileListPaths = (
|
184
|
+
);
|
185
|
+
inputPaths = (
|
186
|
+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
187
|
+
"${PODS_ROOT}/Manifest.lock",
|
188
|
+
);
|
189
|
+
name = "[CP] Check Pods Manifest.lock";
|
190
|
+
outputFileListPaths = (
|
191
|
+
);
|
192
|
+
outputPaths = (
|
193
|
+
"$(DERIVED_FILE_DIR)/Pods-RNBackgroundActions-checkManifestLockResult.txt",
|
194
|
+
);
|
195
|
+
runOnlyForDeploymentPostprocessing = 0;
|
196
|
+
shellPath = /bin/sh;
|
197
|
+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
198
|
+
showEnvVarsInLog = 0;
|
199
|
+
};
|
200
|
+
/* End PBXShellScriptBuildPhase section */
|
201
|
+
|
202
|
+
/* Begin PBXSourcesBuildPhase section */
|
203
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
204
|
+
isa = PBXSourcesBuildPhase;
|
205
|
+
buildActionMask = 2147483647;
|
206
|
+
files = (
|
207
|
+
B3E7B58A1CC2AC0600A0062D /* RNBackgroundActions.m in Sources */,
|
208
|
+
);
|
209
|
+
runOnlyForDeploymentPostprocessing = 0;
|
210
|
+
};
|
211
|
+
6419268E1ECB4257009CF731 /* Sources */ = {
|
212
|
+
isa = PBXSourcesBuildPhase;
|
213
|
+
buildActionMask = 2147483647;
|
214
|
+
files = (
|
215
|
+
6419269B1ECB4266009CF731 /* RNBackgroundActions.m in Sources */,
|
216
|
+
);
|
217
|
+
runOnlyForDeploymentPostprocessing = 0;
|
218
|
+
};
|
219
|
+
/* End PBXSourcesBuildPhase section */
|
220
|
+
|
221
|
+
/* Begin XCBuildConfiguration section */
|
222
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
223
|
+
isa = XCBuildConfiguration;
|
224
|
+
buildSettings = {
|
225
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
226
|
+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
227
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
228
|
+
CLANG_CXX_LIBRARY = "libc++";
|
229
|
+
CLANG_ENABLE_MODULES = YES;
|
230
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
231
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
232
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
233
|
+
CLANG_WARN_COMMA = YES;
|
234
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
235
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
236
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
237
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
238
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
239
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
240
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
241
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
242
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
243
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
244
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
245
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
246
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
247
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
248
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
249
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
250
|
+
COPY_PHASE_STRIP = NO;
|
251
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
252
|
+
ENABLE_TESTABILITY = YES;
|
253
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
254
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
255
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
256
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
257
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
258
|
+
"DEBUG=1",
|
259
|
+
"$(inherited)",
|
260
|
+
);
|
261
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
262
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
263
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
264
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
265
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
266
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
267
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
268
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
269
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
270
|
+
ONLY_ACTIVE_ARCH = YES;
|
271
|
+
SDKROOT = iphoneos;
|
272
|
+
};
|
273
|
+
name = Debug;
|
274
|
+
};
|
275
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
276
|
+
isa = XCBuildConfiguration;
|
277
|
+
buildSettings = {
|
278
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
279
|
+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
280
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
281
|
+
CLANG_CXX_LIBRARY = "libc++";
|
282
|
+
CLANG_ENABLE_MODULES = YES;
|
283
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
284
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
285
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
286
|
+
CLANG_WARN_COMMA = YES;
|
287
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
288
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
289
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
290
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
291
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
292
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
293
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
294
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
295
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
296
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
297
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
298
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
299
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
300
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
301
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
302
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
303
|
+
COPY_PHASE_STRIP = YES;
|
304
|
+
ENABLE_NS_ASSERTIONS = NO;
|
305
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
306
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
307
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
308
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
309
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
310
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
311
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
312
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
313
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
314
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
315
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
316
|
+
SDKROOT = iphoneos;
|
317
|
+
VALIDATE_PRODUCT = YES;
|
318
|
+
};
|
319
|
+
name = Release;
|
320
|
+
};
|
321
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
322
|
+
isa = XCBuildConfiguration;
|
323
|
+
baseConfigurationReference = 71DD9836C50E2FFD2D98ADD0 /* Pods-RNBackgroundActions.debug.xcconfig */;
|
324
|
+
buildSettings = {
|
325
|
+
HEADER_SEARCH_PATHS = (
|
326
|
+
"$(inherited)",
|
327
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
328
|
+
"$(SRCROOT)/../../../React/**",
|
329
|
+
"$(SRCROOT)/../../react-native/React/**",
|
330
|
+
);
|
331
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
332
|
+
OTHER_LDFLAGS = "-ObjC";
|
333
|
+
PRODUCT_NAME = RNBackgroundActions;
|
334
|
+
SKIP_INSTALL = YES;
|
335
|
+
};
|
336
|
+
name = Debug;
|
337
|
+
};
|
338
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
339
|
+
isa = XCBuildConfiguration;
|
340
|
+
baseConfigurationReference = 5694935E99A79F9E84DE86A2 /* Pods-RNBackgroundActions.release.xcconfig */;
|
341
|
+
buildSettings = {
|
342
|
+
HEADER_SEARCH_PATHS = (
|
343
|
+
"$(inherited)",
|
344
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
345
|
+
"$(SRCROOT)/../../../React/**",
|
346
|
+
"$(SRCROOT)/../../react-native/React/**",
|
347
|
+
);
|
348
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
349
|
+
OTHER_LDFLAGS = "-ObjC";
|
350
|
+
PRODUCT_NAME = RNBackgroundActions;
|
351
|
+
SKIP_INSTALL = YES;
|
352
|
+
};
|
353
|
+
name = Release;
|
354
|
+
};
|
355
|
+
641926981ECB4257009CF731 /* Debug */ = {
|
356
|
+
isa = XCBuildConfiguration;
|
357
|
+
buildSettings = {
|
358
|
+
CLANG_ANALYZER_NONNULL = YES;
|
359
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
360
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
361
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
362
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
363
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
364
|
+
ENABLE_TESTABILITY = YES;
|
365
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
366
|
+
OTHER_LDFLAGS = "-ObjC";
|
367
|
+
PRODUCT_NAME = RNBackgroundActions;
|
368
|
+
SDKROOT = appletvos;
|
369
|
+
SKIP_INSTALL = YES;
|
370
|
+
TVOS_DEPLOYMENT_TARGET = 10.2;
|
371
|
+
};
|
372
|
+
name = Debug;
|
373
|
+
};
|
374
|
+
641926991ECB4257009CF731 /* Release */ = {
|
375
|
+
isa = XCBuildConfiguration;
|
376
|
+
buildSettings = {
|
377
|
+
CLANG_ANALYZER_NONNULL = YES;
|
378
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
379
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
380
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
381
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
382
|
+
COPY_PHASE_STRIP = NO;
|
383
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
384
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
385
|
+
OTHER_LDFLAGS = "-ObjC";
|
386
|
+
PRODUCT_NAME = RNBackgroundActions;
|
387
|
+
SDKROOT = appletvos;
|
388
|
+
SKIP_INSTALL = YES;
|
389
|
+
TVOS_DEPLOYMENT_TARGET = 10.2;
|
390
|
+
};
|
391
|
+
name = Release;
|
392
|
+
};
|
393
|
+
/* End XCBuildConfiguration section */
|
394
|
+
|
395
|
+
/* Begin XCConfigurationList section */
|
396
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNBackgroundActions" */ = {
|
397
|
+
isa = XCConfigurationList;
|
398
|
+
buildConfigurations = (
|
399
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
400
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
401
|
+
);
|
402
|
+
defaultConfigurationIsVisible = 0;
|
403
|
+
defaultConfigurationName = Release;
|
404
|
+
};
|
405
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNBackgroundActions" */ = {
|
406
|
+
isa = XCConfigurationList;
|
407
|
+
buildConfigurations = (
|
408
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
409
|
+
58B511F11A9E6C8500147676 /* Release */,
|
410
|
+
);
|
411
|
+
defaultConfigurationIsVisible = 0;
|
412
|
+
defaultConfigurationName = Release;
|
413
|
+
};
|
414
|
+
6419269A1ECB4257009CF731 /* Build configuration list for PBXNativeTarget "RNBackgroundActions-tvOS" */ = {
|
415
|
+
isa = XCConfigurationList;
|
416
|
+
buildConfigurations = (
|
417
|
+
641926981ECB4257009CF731 /* Debug */,
|
418
|
+
641926991ECB4257009CF731 /* Release */,
|
419
|
+
);
|
420
|
+
defaultConfigurationIsVisible = 0;
|
421
|
+
defaultConfigurationName = Release;
|
422
|
+
};
|
423
|
+
/* End XCConfigurationList section */
|
424
|
+
};
|
425
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
426
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
export default backgroundServer;
|
2
|
+
export type BackgroundTaskOptions = {
|
3
|
+
taskName: string;
|
4
|
+
taskTitle: string;
|
5
|
+
taskDesc: string;
|
6
|
+
taskIcon: {
|
7
|
+
name: string;
|
8
|
+
type: string;
|
9
|
+
package?: string;
|
10
|
+
};
|
11
|
+
color?: string | undefined;
|
12
|
+
linkingURI?: string | undefined;
|
13
|
+
progressBar?: {
|
14
|
+
max: number;
|
15
|
+
value: number;
|
16
|
+
indeterminate?: boolean | undefined;
|
17
|
+
} | undefined;
|
18
|
+
};
|
19
|
+
declare const backgroundServer: BackgroundServer;
|
20
|
+
/**
|
21
|
+
* @typedef {{taskName: string,
|
22
|
+
* taskTitle: string,
|
23
|
+
* taskDesc: string,
|
24
|
+
* taskIcon: {name: string, type: string, package?: string},
|
25
|
+
* color?: string
|
26
|
+
* linkingURI?: string,
|
27
|
+
* progressBar?: {max: number, value: number, indeterminate?: boolean}
|
28
|
+
* }} BackgroundTaskOptions
|
29
|
+
* @extends EventEmitter<'expiration',any>
|
30
|
+
*/
|
31
|
+
declare class BackgroundServer extends EventEmitter<"expiration", any> {
|
32
|
+
/** @private */
|
33
|
+
private _runnedTasks;
|
34
|
+
/** @private @type {(arg0?: any) => void} */
|
35
|
+
private _stopTask;
|
36
|
+
/** @private */
|
37
|
+
private _isRunning;
|
38
|
+
/** @private @type {BackgroundTaskOptions} */
|
39
|
+
private _currentOptions;
|
40
|
+
/**
|
41
|
+
* @private
|
42
|
+
*/
|
43
|
+
private _addListeners;
|
44
|
+
/**
|
45
|
+
* **ANDROID ONLY**
|
46
|
+
*
|
47
|
+
* Updates the task notification.
|
48
|
+
*
|
49
|
+
* *On iOS this method will return immediately*
|
50
|
+
*
|
51
|
+
* @param {{taskTitle?: string,
|
52
|
+
* taskDesc?: string,
|
53
|
+
* taskIcon?: {name: string, type: string, package?: string},
|
54
|
+
* color?: string,
|
55
|
+
* linkingURI?: string,
|
56
|
+
* progressBar?: {max: number, value: number, indeterminate?: boolean}}} taskData
|
57
|
+
*/
|
58
|
+
updateNotification(taskData: {
|
59
|
+
taskTitle?: string;
|
60
|
+
taskDesc?: string;
|
61
|
+
taskIcon?: {
|
62
|
+
name: string;
|
63
|
+
type: string;
|
64
|
+
package?: string;
|
65
|
+
};
|
66
|
+
color?: string;
|
67
|
+
linkingURI?: string;
|
68
|
+
progressBar?: {
|
69
|
+
max: number;
|
70
|
+
value: number;
|
71
|
+
indeterminate?: boolean;
|
72
|
+
};
|
73
|
+
}): Promise<void>;
|
74
|
+
/**
|
75
|
+
* Returns if the current background task is running.
|
76
|
+
*
|
77
|
+
* It returns `true` if `start()` has been called and the task has not finished.
|
78
|
+
*
|
79
|
+
* It returns `false` if `stop()` has been called, **even if the task has not finished**.
|
80
|
+
*/
|
81
|
+
isRunning(): boolean;
|
82
|
+
/**
|
83
|
+
* @template T
|
84
|
+
*
|
85
|
+
* @param {(taskData?: T) => Promise<void>} task
|
86
|
+
* @param {BackgroundTaskOptions & {parameters?: T}} options
|
87
|
+
* @returns {Promise<void>}
|
88
|
+
*/
|
89
|
+
start<T>(task: (taskData?: T | undefined) => Promise<void>, options: {
|
90
|
+
taskName: string;
|
91
|
+
taskTitle: string;
|
92
|
+
taskDesc: string;
|
93
|
+
taskIcon: {
|
94
|
+
name: string;
|
95
|
+
type: string;
|
96
|
+
package?: string;
|
97
|
+
};
|
98
|
+
color?: string | undefined;
|
99
|
+
linkingURI?: string | undefined;
|
100
|
+
progressBar?: {
|
101
|
+
max: number;
|
102
|
+
value: number;
|
103
|
+
indeterminate?: boolean | undefined;
|
104
|
+
} | undefined;
|
105
|
+
} & {
|
106
|
+
parameters?: T | undefined;
|
107
|
+
}): Promise<void>;
|
108
|
+
/**
|
109
|
+
* @private
|
110
|
+
* @template T
|
111
|
+
* @param {(taskData?: T) => Promise<void>} task
|
112
|
+
* @param {T} [parameters]
|
113
|
+
*/
|
114
|
+
private _generateTask;
|
115
|
+
/**
|
116
|
+
* @private
|
117
|
+
* @param {BackgroundTaskOptions} options
|
118
|
+
*/
|
119
|
+
private _normalizeOptions;
|
120
|
+
/**
|
121
|
+
* Stops the background task.
|
122
|
+
*
|
123
|
+
* @returns {Promise<void>}
|
124
|
+
*/
|
125
|
+
stop(): Promise<void>;
|
126
|
+
}
|
127
|
+
import EventEmitter from "eventemitter3";
|
package/package.json
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
{
|
2
|
+
"name": "rn-bg-actions",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "React Native background service library for running background tasks forever in Android & iOS",
|
5
|
+
"keywords": [
|
6
|
+
"react-native",
|
7
|
+
"background",
|
8
|
+
"service",
|
9
|
+
"task",
|
10
|
+
"android",
|
11
|
+
"ios"
|
12
|
+
],
|
13
|
+
"files": [
|
14
|
+
"/android/src/",
|
15
|
+
"/android/build.gradle",
|
16
|
+
"/ios",
|
17
|
+
"!Podfile*",
|
18
|
+
"/windows",
|
19
|
+
"/src",
|
20
|
+
"/lib",
|
21
|
+
"/*.podspec",
|
22
|
+
"/jest"
|
23
|
+
],
|
24
|
+
"types": "lib/types/index.d.ts",
|
25
|
+
"main": "src/index.js",
|
26
|
+
"scripts": {
|
27
|
+
"ci": "yarn install --frozen-lockfile && yarn lint && yarn declaration:build && yarn checkjs && yarn test",
|
28
|
+
"lint": "eslint .",
|
29
|
+
"checkjs": "tsc",
|
30
|
+
"eslint:fix": "yarn eslint --fix",
|
31
|
+
"test": "jest ./__tests__/",
|
32
|
+
"declaration:build": "tsc -p ./declaration.tsconfig.json",
|
33
|
+
"prepublishOnly": "yarn declaration:build && yarn checkjs",
|
34
|
+
"pods": "cd ios && pod install"
|
35
|
+
},
|
36
|
+
"repository": {
|
37
|
+
"type": "git",
|
38
|
+
"url": "https://github.com/gbarbierisegware/react-native-background-actions.git"
|
39
|
+
},
|
40
|
+
"funding": {
|
41
|
+
"type": "individual",
|
42
|
+
"url": "https://github.com/sponsors/Rapsssito"
|
43
|
+
},
|
44
|
+
"author": {
|
45
|
+
"name": "Rapsssito",
|
46
|
+
"email": "contact@rodrigomartin.dev"
|
47
|
+
},
|
48
|
+
"license": "MIT",
|
49
|
+
"licenseFilename": "LICENSE",
|
50
|
+
"peerDependencies": {
|
51
|
+
"react-native": ">=0.47.0"
|
52
|
+
},
|
53
|
+
"devDependencies": {
|
54
|
+
"@babel/core": "^7.8.3",
|
55
|
+
"@semantic-release/changelog": "^5.0.0",
|
56
|
+
"@semantic-release/git": "^9.0.0",
|
57
|
+
"@semantic-release/github": "^7.0.0",
|
58
|
+
"@semantic-release/npm": "^7.0.0",
|
59
|
+
"@types/jest": "^25.1.3",
|
60
|
+
"@types/react-native": "^0.61.17",
|
61
|
+
"babel-jest": "^24.9.0",
|
62
|
+
"eslint": "^6.6.0",
|
63
|
+
"eslint-config-prettier": "^6.5.0",
|
64
|
+
"eslint-plugin-jest": "^23.6.0",
|
65
|
+
"eslint-plugin-prettier": "^3.1.1",
|
66
|
+
"jest": "^24.9.0",
|
67
|
+
"metro-react-native-babel-preset": "^0.56.4",
|
68
|
+
"prettier": "^1.18.2",
|
69
|
+
"react": "16.9.0",
|
70
|
+
"react-native": "^0.61.4",
|
71
|
+
"semantic-release": "^17.0.1",
|
72
|
+
"typescript": "4.0.3"
|
73
|
+
},
|
74
|
+
"dependencies": {
|
75
|
+
"eventemitter3": "^4.0.7"
|
76
|
+
}
|
77
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "json"
|
2
|
+
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
4
|
+
|
5
|
+
Pod::Spec.new do |s|
|
6
|
+
s.name = package['name']
|
7
|
+
s.version = package['version']
|
8
|
+
s.summary = package['description']
|
9
|
+
s.homepage = package['repository']['url']
|
10
|
+
s.license = package['license']
|
11
|
+
s.authors = package['author']
|
12
|
+
s.platforms = { :ios => "9.0", :tvos => "10.0" }
|
13
|
+
s.source = { :git => s.homepage, :tag => "#v{s.version}" }
|
14
|
+
|
15
|
+
s.source_files = "ios/*.{h,m,swift}"
|
16
|
+
s.requires_arc = true
|
17
|
+
|
18
|
+
s.dependency "React-Core"
|
19
|
+
end
|