@cloudflare/realtimekit-react-native 0.0.0 → 0.0.1-staging.2
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 +13 -0
- package/README.md +83 -0
- package/RealtimeKitCore.podspec +19 -0
- package/android/build.gradle +58 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/AndroidManifest.xml +23 -0
- package/android/src/main/java/com/reactnativecore/BackgroundTimer/RNBackgroundTimer.java +97 -0
- package/android/src/main/java/com/reactnativecore/Constants.java +14 -0
- package/android/src/main/java/com/reactnativecore/CoreModule.java +49 -0
- package/android/src/main/java/com/reactnativecore/CorePackage.java +34 -0
- package/android/src/main/java/com/reactnativecore/DyteHelperModule.java +268 -0
- package/android/src/main/java/com/reactnativecore/DyteHolder.java +7 -0
- package/android/src/main/java/com/reactnativecore/ForegroundService.java +48 -0
- package/android/src/main/java/com/reactnativecore/NotificationHelper.java +127 -0
- package/android/src/main/java/com/reactnativecore/RNPermissionsModule.java +226 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/AppRTCBluetoothManager.java +637 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/AppRTCProximitySensor.java +133 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/AppRTCUtils.java +41 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/InCallManagerModule.java +1881 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/InCallProximityManager.java +162 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/InCallWakeLockUtils.java +116 -0
- package/android/src/main/java/com/reactnativecore/incallmanager/ThreadUtils.java +39 -0
- package/app.plugin.js +1 -0
- package/ios/BroadcastEventEmitter.h +11 -0
- package/ios/BroadcastEventEmitter.m +72 -0
- package/ios/Core.h +5 -0
- package/ios/Core.m +28 -0
- package/ios/Core.xcodeproj/project.pbxproj +287 -0
- package/ios/DyteRNBackgroundTimer.h +22 -0
- package/ios/DyteRNBackgroundTimer.m +90 -0
- package/ios/DyteRNPermissionHandlerNotifications.h +17 -0
- package/ios/DyteRNPermissionHandlerNotifications.m +127 -0
- package/ios/DyteRNPermissions.h +50 -0
- package/ios/DyteRNPermissions.m +275 -0
- package/ios/DyteScreensharePickerView.h +8 -0
- package/ios/DyteScreensharePickerView.m +27 -0
- package/ios/PrivacyInfo.xcprivacy +60 -0
- package/ios/RNInCallManager.h +16 -0
- package/ios/RNInCallManager.m +1354 -0
- package/ios/permissions/DyteRNPermissionHandlerBluetoothPeripheral.h +4 -0
- package/ios/permissions/DyteRNPermissionHandlerBluetoothPeripheral.m +87 -0
- package/ios/permissions/DyteRNPermissionHandlerCamera.h +5 -0
- package/ios/permissions/DyteRNPermissionHandlerCamera.m +38 -0
- package/ios/permissions/DyteRNPermissionHandlerMicrophone.h +5 -0
- package/ios/permissions/DyteRNPermissionHandlerMicrophone.m +34 -0
- package/ios/permissions/DyteRNPermissionHandlerPhotoLibrary.h +8 -0
- package/ios/permissions/DyteRNPermissionHandlerPhotoLibrary.m +70 -0
- package/ios/screenshare/DyteDarwinNotificationCenter.swift +21 -0
- package/ios/screenshare/DyteScreenshareAtomic.swift +29 -0
- package/ios/screenshare/DyteScreenshareHandler.swift +103 -0
- package/ios/screenshare/DyteScreenshareUploader.swift +139 -0
- package/ios/screenshare/DyteSocketConnection.swift +190 -0
- package/lib/BackgroundHandler.d.ts +20 -0
- package/lib/BackgroundHandler.js +87 -0
- package/lib/LocalMediaError.d.ts +4 -0
- package/lib/LocalMediaError.js +6 -0
- package/lib/LocalMediaHandler.d.ts +118 -0
- package/lib/LocalMediaHandler.js +853 -0
- package/lib/LocalMediaInterfaces.d.ts +76 -0
- package/lib/LocalMediaInterfaces.js +1 -0
- package/lib/LocalMediaUtils.d.ts +93 -0
- package/lib/LocalMediaUtils.js +276 -0
- package/lib/NativeAudioManager.d.ts +16 -0
- package/lib/NativeAudioManager.js +93 -0
- package/lib/PermissionHandler.d.ts +34 -0
- package/lib/PermissionHandler.js +179 -0
- package/lib/ReactContext.d.ts +42 -0
- package/lib/ReactContext.js +96 -0
- package/lib/ReactHooks.d.ts +11 -0
- package/lib/ReactHooks.js +73 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +40 -0
- package/lib/utils/crypto.d.ts +17 -0
- package/lib/utils/crypto.js +82 -0
- package/package.json +51 -4
- package/plugin/build/withDyte.d.ts +25 -0
- package/plugin/build/withDyte.js +100 -0
- package/plugin/src/withDyte.ts +150 -0
- package/plugin/tsconfig.json +10 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
10
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
11
|
+
isa = PBXCopyFilesBuildPhase;
|
|
12
|
+
buildActionMask = 2147483647;
|
|
13
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
14
|
+
dstSubfolderSpec = 16;
|
|
15
|
+
files = (
|
|
16
|
+
);
|
|
17
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
18
|
+
};
|
|
19
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
20
|
+
|
|
21
|
+
/* Begin PBXFileReference section */
|
|
22
|
+
068079282931E36B002354E8 /* ReplayKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReplayKit.framework; path = System/Library/Frameworks/ReplayKit.framework; sourceTree = SDKROOT; };
|
|
23
|
+
134814201AA4EA6300B7C361 /* libCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCore.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
24
|
+
B3E7B5881CC2AC0600A0062D /* Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = "<group>"; };
|
|
25
|
+
B3E7B5891CC2AC0600A0062D /* Core.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Core.m; sourceTree = "<group>"; };
|
|
26
|
+
/* End PBXFileReference section */
|
|
27
|
+
|
|
28
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
29
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
30
|
+
isa = PBXFrameworksBuildPhase;
|
|
31
|
+
buildActionMask = 2147483647;
|
|
32
|
+
files = (
|
|
33
|
+
);
|
|
34
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
35
|
+
};
|
|
36
|
+
/* End PBXFrameworksBuildPhase section */
|
|
37
|
+
|
|
38
|
+
/* Begin PBXGroup section */
|
|
39
|
+
068079272931E36B002354E8 /* Frameworks */ = {
|
|
40
|
+
isa = PBXGroup;
|
|
41
|
+
children = (
|
|
42
|
+
068079282931E36B002354E8 /* ReplayKit.framework */,
|
|
43
|
+
);
|
|
44
|
+
name = Frameworks;
|
|
45
|
+
sourceTree = "<group>";
|
|
46
|
+
};
|
|
47
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
48
|
+
isa = PBXGroup;
|
|
49
|
+
children = (
|
|
50
|
+
134814201AA4EA6300B7C361 /* libCore.a */,
|
|
51
|
+
);
|
|
52
|
+
name = Products;
|
|
53
|
+
sourceTree = "<group>";
|
|
54
|
+
};
|
|
55
|
+
58B511D21A9E6C8500147676 = {
|
|
56
|
+
isa = PBXGroup;
|
|
57
|
+
children = (
|
|
58
|
+
B3E7B5881CC2AC0600A0062D /* Core.h */,
|
|
59
|
+
B3E7B5891CC2AC0600A0062D /* Core.m */,
|
|
60
|
+
068079272931E36B002354E8 /* Frameworks */,
|
|
61
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
62
|
+
);
|
|
63
|
+
sourceTree = "<group>";
|
|
64
|
+
};
|
|
65
|
+
/* End PBXGroup section */
|
|
66
|
+
|
|
67
|
+
/* Begin PBXNativeTarget section */
|
|
68
|
+
58B511DA1A9E6C8500147676 /* Core */ = {
|
|
69
|
+
isa = PBXNativeTarget;
|
|
70
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Core" */;
|
|
71
|
+
buildPhases = (
|
|
72
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
73
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
74
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
75
|
+
);
|
|
76
|
+
buildRules = (
|
|
77
|
+
);
|
|
78
|
+
dependencies = (
|
|
79
|
+
);
|
|
80
|
+
name = Core;
|
|
81
|
+
productName = RCTDataManager;
|
|
82
|
+
productReference = 134814201AA4EA6300B7C361 /* libCore.a */;
|
|
83
|
+
productType = "com.apple.product-type.library.static";
|
|
84
|
+
};
|
|
85
|
+
/* End PBXNativeTarget section */
|
|
86
|
+
|
|
87
|
+
/* Begin PBXProject section */
|
|
88
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
89
|
+
isa = PBXProject;
|
|
90
|
+
attributes = {
|
|
91
|
+
LastSwiftUpdateCheck = 1410;
|
|
92
|
+
LastUpgradeCheck = 1410;
|
|
93
|
+
ORGANIZATIONNAME = Facebook;
|
|
94
|
+
TargetAttributes = {
|
|
95
|
+
58B511DA1A9E6C8500147676 = {
|
|
96
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Core" */;
|
|
101
|
+
compatibilityVersion = "Xcode 3.2";
|
|
102
|
+
developmentRegion = en;
|
|
103
|
+
hasScannedForEncodings = 0;
|
|
104
|
+
knownRegions = (
|
|
105
|
+
en,
|
|
106
|
+
Base,
|
|
107
|
+
);
|
|
108
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
109
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
110
|
+
projectDirPath = "";
|
|
111
|
+
projectRoot = "";
|
|
112
|
+
targets = (
|
|
113
|
+
58B511DA1A9E6C8500147676 /* Core */,
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
/* End PBXProject section */
|
|
117
|
+
|
|
118
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
119
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
120
|
+
isa = PBXSourcesBuildPhase;
|
|
121
|
+
buildActionMask = 2147483647;
|
|
122
|
+
files = (
|
|
123
|
+
);
|
|
124
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
125
|
+
};
|
|
126
|
+
/* End PBXSourcesBuildPhase section */
|
|
127
|
+
|
|
128
|
+
/* Begin XCBuildConfiguration section */
|
|
129
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
130
|
+
isa = XCBuildConfiguration;
|
|
131
|
+
buildSettings = {
|
|
132
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
133
|
+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
134
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
135
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
136
|
+
CLANG_ENABLE_MODULES = YES;
|
|
137
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
138
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
139
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
140
|
+
CLANG_WARN_COMMA = YES;
|
|
141
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
142
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
143
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
144
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
145
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
146
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
147
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
148
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
149
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
150
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
151
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
152
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
153
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
154
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
155
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
156
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
157
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
158
|
+
COPY_PHASE_STRIP = NO;
|
|
159
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
160
|
+
ENABLE_TESTABILITY = YES;
|
|
161
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
162
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
163
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
164
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
165
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
166
|
+
"DEBUG=1",
|
|
167
|
+
"$(inherited)",
|
|
168
|
+
);
|
|
169
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
170
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
171
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
172
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
173
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
174
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
175
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
176
|
+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
|
177
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
178
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
179
|
+
SDKROOT = iphoneos;
|
|
180
|
+
};
|
|
181
|
+
name = Debug;
|
|
182
|
+
};
|
|
183
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
184
|
+
isa = XCBuildConfiguration;
|
|
185
|
+
buildSettings = {
|
|
186
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
187
|
+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
188
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
189
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
190
|
+
CLANG_ENABLE_MODULES = YES;
|
|
191
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
192
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
193
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
194
|
+
CLANG_WARN_COMMA = YES;
|
|
195
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
196
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
197
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
198
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
199
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
200
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
201
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
202
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
203
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
204
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
205
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
206
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
207
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
208
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
209
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
210
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
211
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
212
|
+
COPY_PHASE_STRIP = YES;
|
|
213
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
214
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
215
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
216
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
217
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
218
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
219
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
220
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
221
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
222
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
223
|
+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
|
224
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
225
|
+
SDKROOT = iphoneos;
|
|
226
|
+
SWIFT_COMPILATION_MODE = wholemodule;
|
|
227
|
+
VALIDATE_PRODUCT = YES;
|
|
228
|
+
};
|
|
229
|
+
name = Release;
|
|
230
|
+
};
|
|
231
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
232
|
+
isa = XCBuildConfiguration;
|
|
233
|
+
buildSettings = {
|
|
234
|
+
HEADER_SEARCH_PATHS = (
|
|
235
|
+
"$(inherited)",
|
|
236
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
237
|
+
"$(SRCROOT)/../../../React/**",
|
|
238
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
239
|
+
);
|
|
240
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
241
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
242
|
+
PRODUCT_NAME = Core;
|
|
243
|
+
SKIP_INSTALL = YES;
|
|
244
|
+
};
|
|
245
|
+
name = Debug;
|
|
246
|
+
};
|
|
247
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
248
|
+
isa = XCBuildConfiguration;
|
|
249
|
+
buildSettings = {
|
|
250
|
+
HEADER_SEARCH_PATHS = (
|
|
251
|
+
"$(inherited)",
|
|
252
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
253
|
+
"$(SRCROOT)/../../../React/**",
|
|
254
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
255
|
+
);
|
|
256
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
257
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
258
|
+
PRODUCT_NAME = Core;
|
|
259
|
+
SKIP_INSTALL = YES;
|
|
260
|
+
};
|
|
261
|
+
name = Release;
|
|
262
|
+
};
|
|
263
|
+
/* End XCBuildConfiguration section */
|
|
264
|
+
|
|
265
|
+
/* Begin XCConfigurationList section */
|
|
266
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Core" */ = {
|
|
267
|
+
isa = XCConfigurationList;
|
|
268
|
+
buildConfigurations = (
|
|
269
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
270
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
271
|
+
);
|
|
272
|
+
defaultConfigurationIsVisible = 0;
|
|
273
|
+
defaultConfigurationName = Release;
|
|
274
|
+
};
|
|
275
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Core" */ = {
|
|
276
|
+
isa = XCConfigurationList;
|
|
277
|
+
buildConfigurations = (
|
|
278
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
279
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
280
|
+
);
|
|
281
|
+
defaultConfigurationIsVisible = 0;
|
|
282
|
+
defaultConfigurationName = Release;
|
|
283
|
+
};
|
|
284
|
+
/* End XCConfigurationList section */
|
|
285
|
+
};
|
|
286
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
287
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNBackgroundTimer.h
|
|
3
|
+
// react-native-background-timer
|
|
4
|
+
//
|
|
5
|
+
// Created by IjzerenHein on 06-09-2016.
|
|
6
|
+
// Copyright (c) ATO Gear. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <React/RCTBridgeModule.h>
|
|
10
|
+
// Support React Native headers both in the React namespace, where they are in RN version 0.40+,
|
|
11
|
+
// and no namespace, for older versions of React Native
|
|
12
|
+
#if __has_include(<React/RCTEventEmitter.h>)
|
|
13
|
+
#import <React/RCTEventEmitter.h>
|
|
14
|
+
#else
|
|
15
|
+
#import "RCTEventEmitter.h"
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@interface DyteRNBackgroundTimer : RCTEventEmitter <RCTBridgeModule>
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNBackgroundTimer.m
|
|
3
|
+
// react-native-background-timer
|
|
4
|
+
//
|
|
5
|
+
// Created by IjzerenHein on 06-09-2016.
|
|
6
|
+
// Copyright (c) ATO Gear. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
@import UIKit;
|
|
9
|
+
#import "DyteRNBackgroundTimer.h"
|
|
10
|
+
|
|
11
|
+
@implementation DyteRNBackgroundTimer {
|
|
12
|
+
UIBackgroundTaskIdentifier bgTask;
|
|
13
|
+
int delay;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
RCT_EXPORT_MODULE()
|
|
17
|
+
|
|
18
|
+
- (NSArray<NSString *> *)supportedEvents { return @[@"backgroundTimer", @"backgroundTimer.timeout"]; }
|
|
19
|
+
|
|
20
|
+
- (void) _start
|
|
21
|
+
{
|
|
22
|
+
[self _stop];
|
|
23
|
+
bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"RNBackgroundTimer" expirationHandler:^{
|
|
24
|
+
// Clean up any unfinished task business by marking where you
|
|
25
|
+
// stopped or ending the task outright.
|
|
26
|
+
[[UIApplication sharedApplication] endBackgroundTask:bgTask];
|
|
27
|
+
bgTask = UIBackgroundTaskInvalid;
|
|
28
|
+
}];
|
|
29
|
+
|
|
30
|
+
UIBackgroundTaskIdentifier thisBgTask = bgTask;
|
|
31
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
32
|
+
if ([self bridge] != nil && thisBgTask == bgTask) {
|
|
33
|
+
[self sendEventWithName:@"backgroundTimer" body:[NSNumber numberWithInt:(int)thisBgTask]];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
- (void) _stop
|
|
39
|
+
{
|
|
40
|
+
if (bgTask != UIBackgroundTaskInvalid) {
|
|
41
|
+
[[UIApplication sharedApplication] endBackgroundTask:bgTask];
|
|
42
|
+
bgTask = UIBackgroundTaskInvalid;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
RCT_EXPORT_METHOD(start:(double)_delay
|
|
47
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
48
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
49
|
+
{
|
|
50
|
+
delay = _delay;
|
|
51
|
+
[self _start];
|
|
52
|
+
resolve([NSNumber numberWithBool:YES]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
RCT_EXPORT_METHOD(stop:(RCTPromiseResolveBlock)resolve
|
|
56
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
57
|
+
{
|
|
58
|
+
[self _stop];
|
|
59
|
+
resolve([NSNumber numberWithBool:YES]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
RCT_EXPORT_METHOD(setTimeout:(int)timeoutId
|
|
63
|
+
timeout:(double)timeout
|
|
64
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
65
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
66
|
+
{
|
|
67
|
+
__block UIBackgroundTaskIdentifier task = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"RNBackgroundTimer" expirationHandler:^{
|
|
68
|
+
[[UIApplication sharedApplication] endBackgroundTask:task];
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
|
72
|
+
if ([self bridge] != nil) {
|
|
73
|
+
[self sendEventWithName:@"backgroundTimer.timeout" body:[NSNumber numberWithInt:timeoutId]];
|
|
74
|
+
}
|
|
75
|
+
[[UIApplication sharedApplication] endBackgroundTask:task];
|
|
76
|
+
});
|
|
77
|
+
resolve([NSNumber numberWithBool:YES]);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
RCT_EXPORT_METHOD(clearTimeout:(int)timeoutId
|
|
82
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
83
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
84
|
+
{
|
|
85
|
+
// Do nothing :)
|
|
86
|
+
// timeout will be ignored in javascript anyway :)
|
|
87
|
+
}*/
|
|
88
|
+
|
|
89
|
+
@end
|
|
90
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTConvert.h>
|
|
3
|
+
#import <Foundation/Foundation.h>
|
|
4
|
+
#import "DyteRNPermissions.h"
|
|
5
|
+
|
|
6
|
+
@interface DyteRNPermissionHandlerNotifications : NSObject
|
|
7
|
+
|
|
8
|
+
+ (NSString * _Nonnull)handlerUniqueId;
|
|
9
|
+
|
|
10
|
+
- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
|
|
11
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;
|
|
12
|
+
|
|
13
|
+
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
|
|
14
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject
|
|
15
|
+
options:(NSArray<NSString *> * _Nonnull)options;
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#import "DyteRNPermissionHandlerNotifications.h"
|
|
2
|
+
|
|
3
|
+
@import UserNotifications;
|
|
4
|
+
@import UIKit;
|
|
5
|
+
|
|
6
|
+
@interface DyteRNPermissionHandlerNotifications()
|
|
7
|
+
|
|
8
|
+
@property (nonatomic, strong) void (^resolve)(RNPermissionStatus status, NSDictionary * _Nonnull settings);
|
|
9
|
+
@property (nonatomic, strong) void (^reject)(NSError *error);
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
@implementation DyteRNPermissionHandlerNotifications
|
|
14
|
+
|
|
15
|
+
+ (NSString * _Nonnull)handlerUniqueId {
|
|
16
|
+
return @"ios.permission.NOTIFICATIONS";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
|
|
20
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject {
|
|
21
|
+
[[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
|
|
22
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
23
|
+
|
|
24
|
+
if (settings.alertSetting != UNNotificationSettingNotSupported) {
|
|
25
|
+
[result setValue:@(settings.alertSetting == UNNotificationSettingEnabled) forKey:@"alert"];
|
|
26
|
+
}
|
|
27
|
+
if (settings.badgeSetting != UNNotificationSettingNotSupported) {
|
|
28
|
+
[result setValue:@(settings.badgeSetting == UNNotificationSettingEnabled) forKey:@"badge"];
|
|
29
|
+
}
|
|
30
|
+
if (settings.soundSetting != UNNotificationSettingNotSupported) {
|
|
31
|
+
[result setValue:@(settings.soundSetting == UNNotificationSettingEnabled) forKey:@"sound"];
|
|
32
|
+
}
|
|
33
|
+
if (settings.lockScreenSetting != UNNotificationSettingNotSupported) {
|
|
34
|
+
[result setValue:@(settings.lockScreenSetting == UNNotificationSettingEnabled) forKey:@"lockScreen"];
|
|
35
|
+
}
|
|
36
|
+
if (settings.carPlaySetting != UNNotificationSettingNotSupported) {
|
|
37
|
+
[result setValue:@(settings.carPlaySetting == UNNotificationSettingEnabled) forKey:@"carPlay"];
|
|
38
|
+
}
|
|
39
|
+
if (settings.notificationCenterSetting != UNNotificationSettingNotSupported) {
|
|
40
|
+
[result setValue:@(settings.notificationCenterSetting == UNNotificationSettingEnabled) forKey:@"notificationCenter"];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[result setValue:@(settings.providesAppNotificationSettings == true) forKey:@"providesAppSettings"];
|
|
44
|
+
[result setValue:@(settings.authorizationStatus == UNAuthorizationStatusProvisional) forKey:@"provisional"];
|
|
45
|
+
|
|
46
|
+
if (settings.criticalAlertSetting != UNNotificationSettingNotSupported) {
|
|
47
|
+
[result setValue:@(settings.criticalAlertSetting == UNNotificationSettingEnabled) forKey:@"criticalAlert"];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
switch (settings.authorizationStatus) {
|
|
51
|
+
case UNAuthorizationStatusNotDetermined:
|
|
52
|
+
return resolve(RNPermissionStatusNotDetermined, result);
|
|
53
|
+
case UNAuthorizationStatusDenied:
|
|
54
|
+
return resolve(RNPermissionStatusDenied, result);
|
|
55
|
+
case UNAuthorizationStatusEphemeral:
|
|
56
|
+
return resolve(RNPermissionStatusLimited, result);
|
|
57
|
+
case UNAuthorizationStatusAuthorized:
|
|
58
|
+
case UNAuthorizationStatusProvisional:
|
|
59
|
+
return resolve(RNPermissionStatusAuthorized, result);
|
|
60
|
+
}
|
|
61
|
+
}];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictionary * _Nonnull settings))resolve
|
|
65
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject
|
|
66
|
+
options:(NSArray<NSString *> * _Nonnull)options {
|
|
67
|
+
bool alert = [options containsObject:@"alert"];
|
|
68
|
+
bool badge = [options containsObject:@"badge"];
|
|
69
|
+
bool sound = [options containsObject:@"sound"];
|
|
70
|
+
bool criticalAlert = [options containsObject:@"criticalAlert"];
|
|
71
|
+
bool carPlay = [options containsObject:@"carPlay"];
|
|
72
|
+
bool provisional = [options containsObject:@"provisional"];
|
|
73
|
+
bool providesAppSettings = [options containsObject:@"providesAppSettings"];
|
|
74
|
+
|
|
75
|
+
UNAuthorizationOptions types = UNAuthorizationOptionNone;
|
|
76
|
+
|
|
77
|
+
if (alert) {
|
|
78
|
+
types += UNAuthorizationOptionAlert;
|
|
79
|
+
}
|
|
80
|
+
if (badge) {
|
|
81
|
+
types += UNAuthorizationOptionBadge;
|
|
82
|
+
}
|
|
83
|
+
if (sound) {
|
|
84
|
+
types += UNAuthorizationOptionSound;
|
|
85
|
+
}
|
|
86
|
+
if (carPlay) {
|
|
87
|
+
types += UNAuthorizationOptionCarPlay;
|
|
88
|
+
}
|
|
89
|
+
if (criticalAlert) {
|
|
90
|
+
types += UNAuthorizationOptionCriticalAlert;
|
|
91
|
+
}
|
|
92
|
+
if (provisional) {
|
|
93
|
+
types += UNAuthorizationOptionProvisional;
|
|
94
|
+
}
|
|
95
|
+
if (providesAppSettings) {
|
|
96
|
+
types += UNAuthorizationOptionProvidesAppNotificationSettings;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (!alert &&
|
|
100
|
+
!badge &&
|
|
101
|
+
!sound &&
|
|
102
|
+
!criticalAlert &&
|
|
103
|
+
!carPlay &&
|
|
104
|
+
!provisional &&
|
|
105
|
+
!providesAppSettings) {
|
|
106
|
+
types += UNAuthorizationOptionAlert;
|
|
107
|
+
types += UNAuthorizationOptionBadge;
|
|
108
|
+
types += UNAuthorizationOptionSound;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:types
|
|
112
|
+
completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
|
113
|
+
if (error != nil) {
|
|
114
|
+
return reject(error);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (granted) {
|
|
118
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
119
|
+
[[UIApplication sharedApplication] registerForRemoteNotifications];
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
[self checkWithResolver:resolve rejecter:reject];
|
|
124
|
+
}];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
#import <React/RCTBridgeModule.h>
|
|
3
|
+
#import <React/RCTConvert.h>
|
|
4
|
+
#import <Foundation/Foundation.h>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
typedef NS_ENUM(NSInteger, RNPermission) {
|
|
8
|
+
RNPermissionUnknown = 0,
|
|
9
|
+
RNPermissionCamera = 3,
|
|
10
|
+
RNPermissionBluetoothPeripheral = 1,
|
|
11
|
+
RNPermissionMicrophone = 9,
|
|
12
|
+
RNPermissionPhotoLibrary = 11,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
@interface RCTConvert (RNPermission)
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
typedef enum {
|
|
19
|
+
RNPermissionStatusNotAvailable = 0,
|
|
20
|
+
RNPermissionStatusNotDetermined = 1,
|
|
21
|
+
RNPermissionStatusRestricted = 2,
|
|
22
|
+
RNPermissionStatusDenied = 3,
|
|
23
|
+
RNPermissionStatusAuthorized = 4,
|
|
24
|
+
RNPermissionStatusLimited = 5,
|
|
25
|
+
} RNPermissionStatus;
|
|
26
|
+
|
|
27
|
+
@protocol DyteRNPermissionHandler <NSObject>
|
|
28
|
+
|
|
29
|
+
@required
|
|
30
|
+
|
|
31
|
+
+ (NSArray<NSString *> * _Nonnull)usageDescriptionKeys;
|
|
32
|
+
|
|
33
|
+
+ (NSString * _Nonnull)handlerUniqueId;
|
|
34
|
+
|
|
35
|
+
- (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status))resolve
|
|
36
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;
|
|
37
|
+
|
|
38
|
+
- (void)requestWithResolver:(void (^ _Nonnull)(RNPermissionStatus status))resolve
|
|
39
|
+
rejecter:(void (^ _Nonnull)(NSError * _Nonnull error))reject;
|
|
40
|
+
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
@interface DyteRNPermissions : NSObject <RCTBridgeModule>
|
|
44
|
+
|
|
45
|
+
+ (bool)isFlaggedAsRequested:(NSString * _Nonnull)handlerId;
|
|
46
|
+
|
|
47
|
+
+ (void)flagAsRequested:(NSString * _Nonnull)handlerId;
|
|
48
|
+
|
|
49
|
+
@end
|
|
50
|
+
|