@rocapine/expo-widget-activation

Widget activation toolkit for Expo apps: WidgetKit installed-widget detection, app suspend, foreground detection hook, and a muted looping tutorial video player with PiP.


License
Unlicense
Install
npm install @rocapine/expo-widget-activation@0.2.3

Documentation

@rocapine/expo-widget-activation

Widget activation toolkit for Expo apps:

Cross-platform APIs

  • getInstalledWidgets() — WidgetKit getCurrentConfigurations (iOS); AppWidgetManager query (Android); [] if bridge unavailable.
  • suspendApp() — backgrounds the app (iOS: undocumented selector, accepted review risk; Android: moveTaskToBack).
  • isWidgetInstalled(widgets, kind) — predicate helper.
  • useWidgetDetection({ enabled, isTarget, onDetected }) — fires once the target widget appears on an app-foreground check.
  • @rocapine/expo-widget-activation/videoTutorialVideo (muted, loop, initialTime, playbackRate, PiP) + videoProgress. Requires expo-video.

iOS

WidgetKit detection via WidgetCenter.getCurrentConfigurations.

Android

Widget detection via AppWidgetManager.getAppWidgetIds. Pin widget via AppWidgetManager.requestPinAppWidget + isPinSupported check. Note: no dismiss callback on Android — observe widget removal via polling or detect on app-foreground checks. suspendApp() uses moveTaskToBack to background the app.

Install

From npm registry (v0.2.0+):

npm install @rocapine/expo-widget-activation@^0.2.0

From git (dist committed):

"@rocapine/expo-widget-activation": "github:Rocapine/expo-widget-activation#v0.2.0"

Autolinks as a standard Expo module — new native build required after install.