@scrypted/nvr 0.0.144 → 0.0.145

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.
@@ -0,0 +1,45 @@
1
+ //
2
+ // AppDelegate.swift
3
+ // Scrypted NVR
4
+ //
5
+ // Created by Koushik Dutta on 11/30/22.
6
+ //
7
+
8
+ import Foundation
9
+ import UIKit
10
+ import UserNotifications
11
+
12
+ extension Data {
13
+ struct HexEncodingOptions: OptionSet {
14
+ let rawValue: Int
15
+ static let upperCase = HexEncodingOptions(rawValue: 1 << 0)
16
+ }
17
+
18
+ func hexEncodedString(options: HexEncodingOptions = []) -> String {
19
+ let format = options.contains(.upperCase) ? "%02hhX" : "%02hhx"
20
+ return self.map { String(format: format, $0) }.joined()
21
+ }
22
+ }
23
+
24
+ class AppDelegate: NSObject, UIApplicationDelegate {
25
+ var deviceToken: String?
26
+
27
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
28
+ print("Your code here")
29
+
30
+ UIApplication.shared.registerForRemoteNotifications()
31
+
32
+ return true
33
+ }
34
+
35
+ func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
36
+ let hex = deviceToken.hexEncodedString()
37
+ print(hex)
38
+ self.deviceToken = hex
39
+ }
40
+
41
+ func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
42
+ print("failed!")
43
+ }
44
+
45
+ }
@@ -2,9 +2,13 @@
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
- <key>com.apple.security.app-sandbox</key>
6
- <true/>
7
- <key>com.apple.security.files.user-selected.read-only</key>
8
- <true/>
5
+ <key>aps-environment</key>
6
+ <string>development</string>
7
+ <key>com.apple.developer.aps-environment</key>
8
+ <string>development</string>
9
+ <key>com.apple.security.app-sandbox</key>
10
+ <true/>
11
+ <key>com.apple.security.files.user-selected.read-only</key>
12
+ <true/>
9
13
  </dict>
10
14
  </plist>
@@ -9,6 +9,8 @@ import SwiftUI
9
9
 
10
10
  @main
11
11
  struct Scrypted_NVRApp: App {
12
+ @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
13
+
12
14
  var body: some Scene {
13
15
  WindowGroup {
14
16
  ContentView()
@@ -11,6 +11,7 @@
11
11
  E25A17FB2935780A0046FC69 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E25A17FA2935780A0046FC69 /* ContentView.swift */; };
12
12
  E25A17FD2935780A0046FC69 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E25A17FC2935780A0046FC69 /* Assets.xcassets */; };
13
13
  E25A18012935780A0046FC69 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E25A18002935780A0046FC69 /* Preview Assets.xcassets */; };
14
+ E25A18092937FE8B0046FC69 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E25A18082937FE8B0046FC69 /* AppDelegate.swift */; };
14
15
  /* End PBXBuildFile section */
15
16
 
16
17
  /* Begin PBXFileReference section */
@@ -20,6 +21,8 @@
20
21
  E25A17FC2935780A0046FC69 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
21
22
  E25A17FE2935780A0046FC69 /* Scrypted_NVR.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Scrypted_NVR.entitlements; sourceTree = "<group>"; };
22
23
  E25A18002935780A0046FC69 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
24
+ E25A18072937FE130046FC69 /* Scrypted-NVR-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Scrypted-NVR-Info.plist"; sourceTree = SOURCE_ROOT; };
25
+ E25A18082937FE8B0046FC69 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
23
26
  /* End PBXFileReference section */
24
27
 
25
28
  /* Begin PBXFrameworksBuildPhase section */
@@ -52,11 +55,13 @@
52
55
  E25A17F72935780A0046FC69 /* Scrypted NVR */ = {
53
56
  isa = PBXGroup;
54
57
  children = (
58
+ E25A18072937FE130046FC69 /* Scrypted-NVR-Info.plist */,
55
59
  E25A17F82935780A0046FC69 /* Scrypted_NVRApp.swift */,
56
60
  E25A17FA2935780A0046FC69 /* ContentView.swift */,
57
61
  E25A17FC2935780A0046FC69 /* Assets.xcassets */,
58
62
  E25A17FE2935780A0046FC69 /* Scrypted_NVR.entitlements */,
59
63
  E25A17FF2935780A0046FC69 /* Preview Content */,
64
+ E25A18082937FE8B0046FC69 /* AppDelegate.swift */,
60
65
  );
61
66
  path = "Scrypted NVR";
62
67
  sourceTree = "<group>";
@@ -139,6 +144,7 @@
139
144
  isa = PBXSourcesBuildPhase;
140
145
  buildActionMask = 2147483647;
141
146
  files = (
147
+ E25A18092937FE8B0046FC69 /* AppDelegate.swift in Sources */,
142
148
  E25A17FB2935780A0046FC69 /* ContentView.swift in Sources */,
143
149
  E25A17F92935780A0046FC69 /* Scrypted_NVRApp.swift in Sources */,
144
150
  );
@@ -269,6 +275,7 @@
269
275
  ENABLE_HARDENED_RUNTIME = YES;
270
276
  ENABLE_PREVIEWS = YES;
271
277
  GENERATE_INFOPLIST_FILE = YES;
278
+ INFOPLIST_FILE = "Scrypted-NVR-Info.plist";
272
279
  "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
273
280
  "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
274
281
  "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
@@ -307,6 +314,7 @@
307
314
  ENABLE_HARDENED_RUNTIME = YES;
308
315
  ENABLE_PREVIEWS = YES;
309
316
  GENERATE_INFOPLIST_FILE = YES;
317
+ INFOPLIST_FILE = "Scrypted-NVR-Info.plist";
310
318
  "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
311
319
  "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
312
320
  "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
@@ -3,4 +3,38 @@
3
3
  uuid = "91EF61F4-45CC-4AF6-B40A-0B808647AB51"
4
4
  type = "1"
5
5
  version = "2.0">
6
+ <Breakpoints>
7
+ <BreakpointProxy
8
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
+ <BreakpointContent
10
+ uuid = "7E26CCA0-AE2D-4D1A-A2D5-CF7E5BFA107E"
11
+ shouldBeEnabled = "Yes"
12
+ ignoreCount = "0"
13
+ continueAfterRunningActions = "No"
14
+ filePath = "Scrypted NVR/AppDelegate.swift"
15
+ startingColumnNumber = "9223372036854775807"
16
+ endingColumnNumber = "9223372036854775807"
17
+ startingLineNumber = "42"
18
+ endingLineNumber = "42"
19
+ landmarkName = "application(_:didFailToRegisterForRemoteNotificationsWithError:)"
20
+ landmarkType = "7">
21
+ </BreakpointContent>
22
+ </BreakpointProxy>
23
+ <BreakpointProxy
24
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25
+ <BreakpointContent
26
+ uuid = "076A5AFC-2F81-44F2-BE08-56434AB609D2"
27
+ shouldBeEnabled = "Yes"
28
+ ignoreCount = "0"
29
+ continueAfterRunningActions = "No"
30
+ filePath = "Scrypted NVR/AppDelegate.swift"
31
+ startingColumnNumber = "9223372036854775807"
32
+ endingColumnNumber = "9223372036854775807"
33
+ startingLineNumber = "37"
34
+ endingLineNumber = "37"
35
+ landmarkName = "application(_:didRegisterForRemoteNotificationsWithDeviceToken:)"
36
+ landmarkType = "7">
37
+ </BreakpointContent>
38
+ </BreakpointProxy>
39
+ </Breakpoints>
6
40
  </Bucket>
@@ -0,0 +1,11 @@
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>UIBackgroundModes</key>
6
+ <array>
7
+ <string>fetch</string>
8
+ <string>remote-notification</string>
9
+ </array>
10
+ </dict>
11
+ </plist>
package/dist/plugin.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/nvr",
3
- "version": "0.0.144",
3
+ "version": "0.0.145",
4
4
  "scripts": {
5
5
  "prepublishOnly": "WEBPACK_DEVTOOL=nosources-source-map NODE_ENV=production scrypted-webpack",
6
6
  "prescrypted-vscode-launch": "WEBPACK_DEVTOOL=nosources-source-map scrypted-webpack",