Nucleus Common is a library that provides a service for managing device information and interactions in an Angular application. It's designed to work with Angular. and Capacitor.
The library has the following peer dependencies:
@angular/core
@capacitor/app
@capacitor/browser
@capacitor/device
The main service provided by the library is NucleusAppService
. This service provides methods to interact with the device and the app.
Here is a brief overview of the methods and properties provided by the NucleusAppService
:
-
init()
: Initializes the service. This method must be called before using any other methods. -
deviceInfo
: Returns information about the device. -
platform
: Returns the platform on which the app is running:ios
,android
,electron
,web
,ios-pwa
orpwa
-
isAppLike
: Returns whether the app is running in an app-like environment. -
isPwa
: Returns whether the app is a Progressive Web App (PWA). -
isNative
: Returns whether the app is a native app. -
launchUrl
: Returns the launch URL of the app. -
openInBrowser(url: string)
: Opens the specified URL in the browser.
Run nx test nucleus-common
to execute the unit tests.