Skip to content

Commit 96c3ea7

Browse files
committed
Update readme
1 parent a89c39f commit 96c3ea7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55

66
# react-native-device-activity
77

8-
Provides access to Apples DeviceActivity API. It does require a Custom Dev Client to work with Expo.
8+
Provides direct access to Apples Screen Time, Device Activity and Shielding APIs.
99

10-
Please note that it only supports iOS (and requires iOS 15 or higher). For Android I'd probably look into [UsageStats](https://developer.android.com/reference/android/app/usage/UsageStats), which seems provide more granularity.
10+
⚠️ Before planning and starting using these APIs it is highly recommended to familiarize yourself with the [special approval and entitlements required](https://github.com/Kingstinct/react-native-device-activity#family-controls-distribution-entitlement-requires-approval-from-apple).
11+
12+
Please note that it only supports iOS (and requires iOS 15 or higher) and requires a Custom Dev Client to work with Expo. For Android I'd probably look into [UsageStats](https://developer.android.com/reference/android/app/usage/UsageStats), which seems provide more granularity.
1113

1214
# Examples
1315

@@ -79,6 +81,7 @@ const events = ReactNativeDeviceActivityModule.getEvents();
7981
For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
8082

8183
The package requires native code, which includes a custom app target. Currently it requires targeting iOS 15 or higher, so populate app.json/app.config.json as follows:
84+
8285
```
8386
"plugins": [
8487
[
@@ -97,7 +100,7 @@ The package requires native code, which includes a custom app target. Currently
97100
}
98101
]
99102
],
100-
```
103+
```
101104

102105
The Swift files for the iOS target will be copied to your local `/targets` directory. You might want to add it to your .gitignore (or if you have other targets in there, you might want to specifically add the three targets added by this library).
103106

@@ -122,11 +125,13 @@ npm install react-native-device-activity
122125
Run `npx pod-install` after installing the npm package.
123126

124127
## Family Controls (distribution) entitlement requires approval from Apple
128+
125129
As early as possible you want to [request approval from Apple](https://developer.apple.com/contact/request/family-controls-distribution), since it can take time to get approved.
126130

127131
Note that until you have approval for all bundleIdentifiers you want to use, you are stuck with local development builds in XCode. I.e. you can't even build an Expo Dev Client.
128132

129133
For every base bundleIdentifier you need approval for 4 bundleIdentifiers:
134+
130135
- com.your-bundleIdentifier
131136
- com.your-bundleIdentifier.ActivityMonitor
132137
- com.your-bundleIdentifier.ShieldAction
@@ -137,11 +142,11 @@ Once you've gotten approval you need to manually add the "Family Controls (Distr
137142
⚠️ If you don't do all the above you will run in to a lot of strange provisioning errors.
138143

139144
## Limitations and weird/notable things
145+
140146
- The DeviceActivitySelectionView is prone to crashes, which is outside of our control. The best we can do is provide fallback views that allows the user to know what's happening and reload the view.
141147
- If you've asked about the authorization status once and the user after that revokes it outside the app, the native APIs won't reflect this until the app is restarted.
142148
- requestAuthorization() can be called multiple times, even when the user has already denied permission.
143149

144-
145150
# Contributing
146151

147-
Contributions are very welcome! Please refer to guidelines described in the [contributing guide]( https://github.com/expo/expo#contributing).
152+
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).

0 commit comments

Comments
 (0)