JavaScript Bridge
Switching the Dynamic App Icon
Switch among launcher icon slots compiled into the Android APK and restore the default icon.
Before you start
- Alternate icons saved before the APK build
Configure and verify
Select a compiled slot
Use values 1 through 5 only for slots uploaded before the current APK was built.
Call the helper
Use webtoapp.setDynamicAppIcon(slot) and parse the synchronous JSON result.
Restore default
Call webtoapp.resetDynamicAppIcon() or set slot 0.
Read active state
Use webtoapp.getDynamicAppIcon() when the page needs to display the current selection.
Example
const selected = JSON.parse(webtoapp.setDynamicAppIcon(2));
const active = JSON.parse(webtoapp.getDynamicAppIcon());
// webtoapp.resetDynamicAppIcon();Test before release
- Slot exists in this APK
- Failure result is handled
- Default can be restored
- Launcher refresh behavior was tested