Skip to content

0xn33t/capacitor-widgetsbridge-plugin

Repository files navigation

capacitor-widgetsbridge-plugin

Capacitor plugin to interact with ios widgetkit

Demo

Screenshot1

Install

npm install capacitor-widgetsbridge-plugin
npx cap sync

API

getItem(...)

getItem(options: UserDefaultsOptions) => Promise<DataResults<any>>

Return the value from user’s defaults database associated with the specified key

Param Type
options UserDefaultsOptions

Returns: Promise<DataResults<any>>


setItem(...)

setItem(options: UserDefaultsOptions) => Promise<DataResults<boolean>>

Set the value to user’s defaults database associated with the specified key

Param Type
options UserDefaultsOptions

Returns: Promise<DataResults<boolean>>


removeItem(...)

removeItem(options: UserDefaultsOptions) => Promise<DataResults<boolean>>

Remove the value from user’s defaults database associated with the specified key

Param Type
options UserDefaultsOptions

Returns: Promise<DataResults<boolean>>


reloadAllTimelines()

reloadAllTimelines() => Promise<DataResults<boolean>>

Reloads the timelines for all configured widgets belonging to the containing app

Returns: Promise<DataResults<boolean>>


reloadTimelines(...)

reloadTimelines(options: TimelinesOptions) => Promise<DataResults<boolean>>

Reloads the timelines for all widgets of a particular kind

Param Type
options TimelinesOptions

Returns: Promise<DataResults<boolean>>


getCurrentConfigurations()

getCurrentConfigurations() => Promise<DataResults<any>>

Get current widget configurations

Returns: Promise<DataResults<any>>


Interfaces

DataResults

Prop Type Description
results T Holds response results from native code

UserDefaultsOptions

Prop Type Description
key string The key whose value to retrieve from storage.
group string User defaults database name which holds and organizes key/value pairs
value string The value to set in storage with the associated key

TimelinesOptions

Prop Type Description
ofKind string A string that identifies the widget and matches the value you used when you created the widget’s configuration