expo-app-blocker 0.1.3 → 0.1.5
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/README.md +9 -11
- package/ios/ExpoAppBlocker.podspec +21 -0
- package/ios/ExpoAppBlockerConfig.swift +19 -0
- package/ios/ExpoAppBlockerModule.swift +1014 -0
- package/package.json +1 -1
- package/plugin/src/index.js +38 -18
- package/src/ExpoAppBlocker.types.ts +15 -27
- package/targets/ShieldConfiguration/ShieldConfigurationExtension.swift +34 -93
package/README.md
CHANGED
|
@@ -72,7 +72,8 @@ Add the plugin to your `app.json`:
|
|
|
72
72
|
"subtitle": "{appName} is blocked.",
|
|
73
73
|
"primaryButtonLabel": "Earn Free Time",
|
|
74
74
|
"secondaryButtonLabel": "Not now",
|
|
75
|
-
"primaryButtonColor": "#
|
|
75
|
+
"primaryButtonColor": "#fb6107",
|
|
76
|
+
"background": "#f6f6f6",
|
|
76
77
|
"icon": "./assets/shield-icon.png"
|
|
77
78
|
}
|
|
78
79
|
}
|
|
@@ -87,18 +88,15 @@ Add the plugin to your `app.json`:
|
|
|
87
88
|
| Option | Type | Default | Description |
|
|
88
89
|
|---|---|---|---|
|
|
89
90
|
| `ios.appGroup` | `string` | Required | App Group identifier for shared data |
|
|
90
|
-
| `ios.shield.title` | `string` | `"Hold on!"` | Shield title
|
|
91
|
-
| `ios.shield.
|
|
92
|
-
| `ios.shield.subtitle` | `string` | `"{appName} is blocked."` | Shield subtitle. `{appName}` replaced with blocked app name |
|
|
93
|
-
| `ios.shield.subtitleColor` | `string` | `"#8c8c8c"` | Subtitle text color (hex) |
|
|
91
|
+
| `ios.shield.title` | `string` | `"Hold on!"` | Shield overlay title |
|
|
92
|
+
| `ios.shield.subtitle` | `string` | `"{appName} is blocked."` | Shield subtitle. `{appName}` is replaced with the blocked app name |
|
|
94
93
|
| `ios.shield.primaryButtonLabel` | `string` | `"Earn Free Time"` | Primary button text |
|
|
95
|
-
| `ios.shield.primaryButtonLabelColor` | `string` | `"#ffffff"` | Primary button text color (hex) |
|
|
96
|
-
| `ios.shield.primaryButtonBackgroundColor` | `string` | `"#7cb518"` | Primary button background color (hex) |
|
|
97
94
|
| `ios.shield.secondaryButtonLabel` | `string\|null` | `"Not now"` | Secondary button text. Set to `null` to hide |
|
|
98
|
-
| `ios.shield.
|
|
99
|
-
| `ios.shield.
|
|
100
|
-
| `ios.shield.
|
|
101
|
-
| `ios.shield.
|
|
95
|
+
| `ios.shield.primaryButtonColor` | `string` | `"#fb6107"` | Primary button background color (hex) |
|
|
96
|
+
| `ios.shield.titleColor` | `string` | `"#111111"` | Title text color (hex) |
|
|
97
|
+
| `ios.shield.subtitleColor` | `string` | `"#737373"` | Subtitle text color (hex) |
|
|
98
|
+
| `ios.shield.background` | `"blur"\|string` | `"blur"` | `"blur"` for frosted glass effect, or a hex color (e.g. `"#f6f6f6"`) for a solid background |
|
|
99
|
+
| `ios.shield.icon` | `string` | SF Symbol | Path to custom shield icon PNG (relative to project root, e.g. `"./assets/shield-icon.png"`) |
|
|
102
100
|
| `android.notificationTitle` | `string` | `"App Blocked"` | Notification title |
|
|
103
101
|
| `android.notificationText` | `string` | `"{appName} is blocked."` | Notification text |
|
|
104
102
|
|
|
@@ -0,0 +1,21 @@
|
|
|
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 = 'ExpoAppBlocker'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author'] || 'expo-app-blocker contributors'
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platforms = { :ios => '16.0' }
|
|
14
|
+
s.swift_version = '5.9'
|
|
15
|
+
s.source = { git: '' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
|
|
20
|
+
s.source_files = '**/*.{h,m,swift}'
|
|
21
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
// This file provides default configuration values.
|
|
4
|
+
// The actual values are injected by the config plugin at prebuild time
|
|
5
|
+
// into a generated file in the app's ios directory.
|
|
6
|
+
// If the generated file exists, its values override these defaults.
|
|
7
|
+
|
|
8
|
+
public struct ExpoAppBlockerConfig {
|
|
9
|
+
// Override this in your app by creating a file with:
|
|
10
|
+
// let expoAppBlockerAppGroup = "group.com.yourapp.blocker"
|
|
11
|
+
public static var appGroupIdentifier: String {
|
|
12
|
+
// Try to read from UserDefaults (set by config plugin)
|
|
13
|
+
if let appGroup = UserDefaults.standard.string(forKey: "expo.appblocker.appGroup") {
|
|
14
|
+
return appGroup
|
|
15
|
+
}
|
|
16
|
+
// Fallback - should be overridden
|
|
17
|
+
return "group.expo.app-blocker"
|
|
18
|
+
}
|
|
19
|
+
}
|