@takeoffmedia/react-native-penthera 0.1.5 → 0.1.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/ios/Penthera.m +7 -2
- package/ios/Penthera.swift +35 -0
- package/ios/Penthera.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Penthera.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Penthera.xcodeproj/project.xcworkspace/xcuserdata/joseguerreroot.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Penthera.xcodeproj/xcuserdata/joseguerreroot.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +56 -0
- package/ios/Penthera.xcodeproj/xcuserdata/joseguerreroot.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +1 -1
package/ios/Penthera.m
CHANGED
|
@@ -13,7 +13,7 @@ RCT_EXTERN_METHOD(initializeSdk:(NSString*)user
|
|
|
13
13
|
withPublicKey:(NSString*)publicKey
|
|
14
14
|
withPrivateKey:(NSString*)privateKey
|
|
15
15
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
16
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
16
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
17
|
|
|
18
18
|
RCT_EXTERN_METHOD(getDownloads:(NSString*)blank
|
|
19
19
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
@@ -25,7 +25,7 @@ RCT_EXTERN_METHOD(download:(NSString*)catalog
|
|
|
25
25
|
|
|
26
26
|
RCT_EXTERN_METHOD(delete:(NSString*)assetID
|
|
27
27
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
28
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
28
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
RCT_EXTERN_METHOD(playAsset:(NSString*)assetID
|
|
@@ -36,6 +36,11 @@ RCT_EXTERN_METHOD(pauseDownload:(NSString*)user
|
|
|
36
36
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
37
37
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
38
38
|
|
|
39
|
+
RCT_EXTERN_METHOD(deleteMany:(NSArray<NSString *> *)assetIDS
|
|
40
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
41
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
42
|
+
|
|
43
|
+
|
|
39
44
|
+ (BOOL)requiresMainQueueSetup
|
|
40
45
|
{
|
|
41
46
|
return NO;
|
package/ios/Penthera.swift
CHANGED
|
@@ -301,6 +301,41 @@ class Penthera: RCTEventEmitter, VirtuosoDownloadEngineNotificationsDelegate {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
@objc(deleteMany:withResolver:withRejecter:)
|
|
307
|
+
func deleteMany(assetIDS: [String], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
308
|
+
// initialize assetResponse {}. Ex {"123":false, "543":false}
|
|
309
|
+
var assetsResponse: [String: Bool] = Dictionary(uniqueKeysWithValues: assetIDS.map { ($0, false) })
|
|
310
|
+
|
|
311
|
+
let downloadComplete = VirtuosoAsset.completedAssets(withAvailabilityFilter: false)
|
|
312
|
+
if(downloadComplete.count > 0) {
|
|
313
|
+
var assetsToDelete: [VirtuosoAsset] = []
|
|
314
|
+
for asset in downloadComplete {
|
|
315
|
+
if let va = asset as? VirtuosoAsset, assetIDS.contains(va.assetID) {
|
|
316
|
+
assetsToDelete.append(va)
|
|
317
|
+
assetsResponse[va.assetID] = true
|
|
318
|
+
if assetsToDelete.count == assetIDS.count { // Se encontraron todos los assets, break for.
|
|
319
|
+
break
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
VirtuosoAsset.delete(assetsToDelete) { () in
|
|
326
|
+
resolve(assetsResponse)
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
// No hay assets completados para eliminar
|
|
330
|
+
let errorMessage = "deleteMany: completedAssets is empty"
|
|
331
|
+
let userInfo = [NSLocalizedDescriptionKey: errorMessage]
|
|
332
|
+
let error = NSError(domain: "takeoffmedia-react-native-penthera", code: 0, userInfo: userInfo)
|
|
333
|
+
reject("ASSET_DELETE_ERROR", errorMessage, error)
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
304
339
|
@objc open override func supportedEvents() -> [String] {
|
|
305
340
|
return EventEmitter.sharedInstance.allEvents
|
|
306
341
|
}
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Bucket
|
|
3
|
+
uuid = "3AE98629-7421-4561-B12C-C06B8B6A3023"
|
|
4
|
+
type = "1"
|
|
5
|
+
version = "2.0">
|
|
6
|
+
<Breakpoints>
|
|
7
|
+
<BreakpointProxy
|
|
8
|
+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
9
|
+
<BreakpointContent
|
|
10
|
+
uuid = "A5D166B0-3C57-4F4D-A845-BDB81498DA0F"
|
|
11
|
+
shouldBeEnabled = "No"
|
|
12
|
+
ignoreCount = "0"
|
|
13
|
+
continueAfterRunningActions = "No"
|
|
14
|
+
filePath = "Penthera.swift"
|
|
15
|
+
startingColumnNumber = "9223372036854775807"
|
|
16
|
+
endingColumnNumber = "9223372036854775807"
|
|
17
|
+
startingLineNumber = "18"
|
|
18
|
+
endingLineNumber = "18"
|
|
19
|
+
landmarkName = "initializeSdk(user:backplaneUrl:publicKey:privateKey:resolve:reject:)"
|
|
20
|
+
landmarkType = "7">
|
|
21
|
+
</BreakpointContent>
|
|
22
|
+
</BreakpointProxy>
|
|
23
|
+
<BreakpointProxy
|
|
24
|
+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
25
|
+
<BreakpointContent
|
|
26
|
+
uuid = "5D7AE47B-D5FC-4468-A75B-C414F3F8A58C"
|
|
27
|
+
shouldBeEnabled = "No"
|
|
28
|
+
ignoreCount = "0"
|
|
29
|
+
continueAfterRunningActions = "No"
|
|
30
|
+
filePath = "Penthera.swift"
|
|
31
|
+
startingColumnNumber = "9223372036854775807"
|
|
32
|
+
endingColumnNumber = "9223372036854775807"
|
|
33
|
+
startingLineNumber = "25"
|
|
34
|
+
endingLineNumber = "25"
|
|
35
|
+
landmarkName = "initializeSdk(user:backplaneUrl:publicKey:privateKey:resolve:reject:)"
|
|
36
|
+
landmarkType = "7">
|
|
37
|
+
</BreakpointContent>
|
|
38
|
+
</BreakpointProxy>
|
|
39
|
+
<BreakpointProxy
|
|
40
|
+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
41
|
+
<BreakpointContent
|
|
42
|
+
uuid = "E3C50B30-46CF-4D56-8C49-C257C70E0ACC"
|
|
43
|
+
shouldBeEnabled = "No"
|
|
44
|
+
ignoreCount = "0"
|
|
45
|
+
continueAfterRunningActions = "No"
|
|
46
|
+
filePath = "Penthera.swift"
|
|
47
|
+
startingColumnNumber = "9223372036854775807"
|
|
48
|
+
endingColumnNumber = "9223372036854775807"
|
|
49
|
+
startingLineNumber = "26"
|
|
50
|
+
endingLineNumber = "26"
|
|
51
|
+
landmarkName = "initializeSdk(user:backplaneUrl:publicKey:privateKey:resolve:reject:)"
|
|
52
|
+
landmarkType = "7">
|
|
53
|
+
</BreakpointContent>
|
|
54
|
+
</BreakpointProxy>
|
|
55
|
+
</Breakpoints>
|
|
56
|
+
</Bucket>
|
|
@@ -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>Penthera.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|