List app Ids of installed applications on device

This code would list down application Ids of all the applications installed (both web & native) on the device from a web application. User may use the app ids to launch or to communicate with the specific app. Application Info privilege is required to list app Ids from web app.