Skip to content

Commit 73249aa

Browse files
authored
Add sync prefs (#52)
* fix: updateBlock after whitelisting * add sync prefs in shield action * chore: update version
1 parent f1f1315 commit 73249aa

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/react-native-device-activity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-device-activity",
3-
"version": "0.4.22",
3+
"version": "0.4.23",
44
"description": "Provides access to Apples DeviceActivity API",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

packages/react-native-device-activity/targets/ShieldAction/ShieldActionExtension.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func handleAction(
1717
) -> ShieldActionResponse {
1818
logger.log("handleAction")
1919
if let type = configForSelectedAction["type"] as? String {
20+
logger.log("type: \(type)")
2021
if type == "disableBlockAllMode" {
2122
disableBlockAllMode(triggeredBy: "shieldAction")
2223
}
@@ -119,6 +120,7 @@ func handleAction(
119120
}
120121

121122
if type == "whitelistCurrent" {
123+
logger.log("whitelistCurrent!!!")
122124
var selection = getCurrentWhitelist()
123125

124126
if let applicationToken = applicationToken {
@@ -138,6 +140,8 @@ func handleAction(
138140
}
139141
}
140142

143+
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication)
144+
141145
if let behavior = configForSelectedAction["behavior"] as? String {
142146
if behavior == "defer" {
143147
return .defer

0 commit comments

Comments
 (0)