Skip to content

Commit 1820f2c

Browse files
wbjacksWill Jackson
andauthored
Fixing some of the markdown in the README so the code examples are more readable (#62)
Co-authored-by: Will Jackson <will@bellislabs.com>
1 parent 0980cdc commit 1820f2c

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ Once you've gotten approval you need to manually add the "Family Controls (Distr
192192

193193
Here's another example that focuses on tracking app usage with time thresholds:
194194

195-
````typescript
195+
```typescript
196196
import * as ReactNativeDeviceActivity from "react-native-device-activity";
197197

198198
ReactNativeDeviceActivity.revokeAuthorization();
199199

200200
```
201201

202-
## Select Apps to track
202+
### Select Apps to track
203203

204204
For most use cases you need to get an activitySelection from the user, which is a token representing the apps the user wants to track, block or whitelist. This can be done by presenting the native view:
205205

@@ -234,7 +234,7 @@ Some things worth noting here:
234234
- This is a SwiftUI view, which is prone to crashing, especially when browsing larger categories of apps or searching for apps. It's recommended to provide a fallback view (positioned behind the SwiftUI view) that allows the user to know what's happening and reload the view and tailor that to your app's design and UX.
235235
- The activitySelection tokens can be particularly large (especially if you use includeEntireCategory flag), so you probably want to reference them through a familyActivitySelectionId instead of always passing the string token around. Most functions in this library accept a familyActivitySelectionId as well as the familyActivitySelection token directly.
236236

237-
## Time tracking
237+
### Time tracking
238238

239239
It's worth noting that the Screen Time API is not designed for time tracking out-of-the-box. So you have to set up events with names you can parse as time after they've triggered.
240240

@@ -284,7 +284,7 @@ Some things worth noting here:
284284

285285
Depending on your use case (if you need different schedules for different days, for example) you might need multiple monitors. There's a hard limit on 20 monitors at the same time. Study the [DateComponents](https://developer.apple.com/documentation/foundation/datecomponents) object to model this to your use case.
286286

287-
## Block the shield
287+
### Block the shield
288288

289289
To block apps, you can do it directly from your code.
290290

@@ -604,8 +604,3 @@ The Screen Time APIs are known to be very finnicky. Here are some things you can
604604
- Upgrade iOS version
605605
- Content & Privacy Restrictions: If any restrictions are enabled under Screen Time's Content & Privacy Restrictions, ensure none are blocking your app.
606606
- Reset all device settings
607-
608-
```
609-
610-
```
611-
````

0 commit comments

Comments
 (0)