Skip to content

Tracking does not work in custom keyboard extension #386

@bangerang

Description

@bangerang

Version

3.32.0

Steps to Reproduce

Hello!

Seems like tracking events does not work when using a custom keyboard extension on iOS. I receive this error:

[PostHog] Could not write file Error Domain=NSCocoaErrorDomain Code=4 "The file “1759840682.448307” doesn’t exist." UserInfo={NSFilePath=/var/mobile/Containers/Data/PluginKitPlugin/71B6F2AF-5120-4C42-B687-E6153F901AEE/Library/Application Support/com.raycast.ios.debug.raycastKeyboard/posthog.queueFolder/1759840682.448307, NSURL=file:///var/mobile/Containers/Data/PluginKitPlugin/71B6F2AF-5120-4C42-B687-E6153F901AEE/Library/Application%20Support/com.raycast.ios.debug.raycastKeyboard/posthog.queueFolder/1759840682.448307, NSUnderlyingError=0x106ab6700 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
[PostHog] Queued event 'Command Opened'. Depth: 0

The code from the call site is just this.

public func track(_ event: AnalyticsEvent) {
   postHog.capture(event.name, properties: event.properties)
}

Works fine in main app

Expected Result

Events from a custom keyboard extension should be sent

Actual Result

Events from a custom keyboard extension are not being sent, and an error is being received

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions