Closed mflint closed 1 year ago
Thanks for the suggestion :) While this is not implemented, you can work around this by adding custom keys to .send
calls from your widget code.
(And maybe there should be a like, a delegate or something that TelemetryManager can ask for a default payload)
Created ticket #30 which will deal with default payload
It is possible to detect whether code is being run from an extension by checking for Bundle.main.infoDictionary?["NSExtension"]
. The contents of that object includes "NSExtensionPointIdentifier" which defines which kind of extension it is (for example "com.apple.widgetkit-extension" is for a home screen widget!)
If we sent up the extension type as part of the default payload, would/could the TelemetryDeck backend enrich this with prettified names to keep the SDK clean and future proofed?
com.apple.widgetkit-extension > WidgetKit
List of all available identifiers: https://developer.apple.com/documentation/bundleresources/information_property_list/nsextension/nsextensionpointidentifier
Description
I have code which is shared between iOS app, iOS Widget and WatchOS app - but I can't see how to differentiate between the code running as an iOS process, or an iOS Widget process.
(The same probably applies to WatchOS or WatchOS Complication)
Can something be added to the standard payload dictionary, to help?
Possible solution 1
Change the
platform
property to (somehow!) detect when running in an iOS Widget or WatchOS Complication.Possible solution 2
Include the bundle identifier (
Bundle.main.bundleIdentifier
) in the payload dictionary.