Unable to call Device Activity in Screen Time Api From Parent Device

1.4k views Asked by At

Using shared authorization I am able to authorize the child's device and able to see all the installed apps on the child's mobile on the parent device. But when I am trying to call DeviceActivity nothing happens. This is how I am calling DeviceActivity

class MyDeviceActivityMonitor: DeviceActivityMonitor{
    override func intervalDidStart(for activity: DeviceActivityName) {
       super.intervalDidStart(for: activity)
    }
    override func intervalDidEnd(for activity: DeviceActivityName) {
        super.intervalDidEnd(for: activity)
    }
    override func eventDidReachThreshold(_ event:DeviceActivityEvent.Name,activity:DeviceActivityName){
        super.eventDidReachThreshold(event, activity: activity)
    }
}

info.plist

<key>NSExtension</key>
    <dict>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.deviceactivity.monitor-extension</string>
        <key>NSExtensionPrincipalClass</key>
        <string>$(PRODUCT_MODULE_NAME).DeviceActivityMonitorExtension</string>
    </dict>
1

There are 1 answers

1
g0mi On

I am stuck in this issue too. Have you tried changing the NSExtensionPrincipalClass to the below?

<string>$(PRODUCT_MODULE_NAME).MyDeviceActivityMonitor </string>