IOS Screen Time API integration with React Native

I am trying to build an app that blocks access to other apps (Like screentime) through react native. I know that IOS has ScreenTime API which has device activity which has the feather to do that. Is it possible to integrate this into a react native app? I've been looking online but can't find much information or documentation regarding this, but I failed to find much.

Replies

any update you got related to this??

  • Any updates?

  • It is possible to create Native modules that access native functionality like the device activity API via Javascript.

    These should be of help https://reactnative.dev/docs/native-modules-ios https://medium.com/@rushabhprajapati20/native-modules-on-react-native-ios-swift-e9741440429d

  • When trying to integrate IOS Screen Time API with React Native following the methods mentioned above, I am getting the below error

    https://drive.google.com/file/d/1PXAHFhu3OQHZPDyFr2WoLYetg96uRIt2/view?usp=sharing

    It would be great if I get the code samples related to this. Thank you.

Add a Comment

Facing issue while integrating IOS Screen Time API with React Native event after following the steps mentioned in the official react-native docs which would work for integrating other native IOS APIs. The error exactly is present in the below image. It would be great if I get the code samples or resources precisely on integrating screen time APIs with React-native. Thank you.

I am trying to build a productivity app with screen-time API and react-native like Opal. but have not been able to find any documentation that can help me. Please If you were able to sort out your error can you point me in the right direction

  • any luck here?

    also looking to access the screen time api with react native...

Add a Comment

I am also looking for a way to access the ScreenTime API using React Native. In my research and experimentation, I found this package: https://github.com/kingstinct/react-native-device-activity but I get a strange error when I try to use it in the app (see attached screenshot). I haven't found any helpful documentation to resolve the error, so has anyone found any other packages that might work? Or has anyone else encountered this error before? I have not tried to manually access the API (i.e. without an npm package), but I would prefer to use a package if possible.