![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
cordova-plugin-alwaystop
Advanced tools
This plugin allows you to keep an application always visible on top of the screen, even when the device is in sleep mode or after a reboot. It also provides functionalities to manage permissions, check the service status, and control battery optimization
This plugin allows you to keep an application always visible on top of the screen, even when the device is in sleep mode or after a reboot. It also provides functionalities to manage permissions, check the service status, and control battery optimization behavior.
To install the plugin, run the following command:
cordova plugin add cordova-plugin-alwaystop
enable(cb, err)
Enables the service that keeps the application always visible. This method starts a foreground service to ensure the application remains on top of the screen.
Example:
cordova.plugins.AlwaysTop.enable(
function(success) {
console.log('Service enabled successfully');
},
function(error) {
console.error('Error enabling service:', error);
}
);
disable(cb, err)
Disables the service that keeps the application always visible. This method stops the foreground service.
Example:
cordova.plugins.AlwaysTop.disable(
function(success) {
console.log('Service disabled successfully');
},
function(error) {
console.error('Error disabling service:', error);
}
);
isEnable(cb, err)
Checks if the service that keeps the application always visible is currently running.
Example:
cordova.plugins.AlwaysTop.isEnable(
function(isRunning) {
if (isRunning) {
console.log('Service is running');
} else {
console.log('Service is not running');
}
},
function(error) {
console.error('Error checking service status:', error);
}
);
hasPermission(cb, err)
Checks if the application has the necessary permissions to run the service.
Example:
cordova.plugins.AlwaysTop.hasPermission(
function(hasPermission) {
if (hasPermission) {
console.log('Application has the necessary permissions');
} else {
console.log('Application does not have the necessary permissions');
}
},
function(error) {
console.error('Error checking permissions:', error);
}
);
requestPermission()
Requests the necessary permissions to run the service. This method opens the application settings screen for the user to grant the required permissions.
Example:
cordova.plugins.AlwaysTop.requestPermission();
appSettings()
Opens the application settings screen. This can be useful for the user to manually grant permissions or adjust application settings.
Example:
cordova.plugins.AlwaysTop.appSettings();
bateryNotOptimized(cb, err)
Checks if the application is excluded from battery optimizations. If the application is optimized, the service may be stopped by the system to save battery.
Example:
cordova.plugins.AlwaysTop.bateryNotOptimized(
function(isOptimized) {
if (isOptimized) {
console.log('Application is optimized for battery');
} else {
console.log('Application is not optimized for battery');
}
},
function(error) {
console.error('Error checking battery optimization:', error);
}
);
drawOverlays(cb, err)
Checks if the application has permission to draw over other apps. This permission is required to keep the application always visible.
Example:
cordova.plugins.AlwaysTop.drawOverlays(
function(canDrawOverlays) {
if (canDrawOverlays) {
console.log('Application can draw over other apps');
} else {
console.log('Application cannot draw over other apps');
}
},
function(error) {
console.error('Error checking overlay permission:', error);
}
);
keepAwake(cb, err)
Keeps the device screen awake. This is useful to prevent the device from entering sleep mode while the application is in use.
Example:
cordova.plugins.AlwaysTop.keepAwake(
function(success) {
console.log('Screen kept awake');
},
function(error) {
console.error('Error keeping screen awake:', error);
}
);
allowSleepAgain(cb, err)
Allows the device to enter sleep mode again. This method reverses the effect of keepAwake
.
Example:
cordova.plugins.AlwaysTop.allowSleepAgain(
function(success) {
console.log('Device can enter sleep mode again');
},
function(error) {
console.error('Error allowing sleep mode:', error);
}
);
ServiceLauncher
) starts automatically after a device reboot if the service was enabled before the reboot.This plugin is licensed under the Apache 2.0 License. See the LICENSE
file for more details.
FAQs
This plugin allows you to keep an application always visible on top of the screen, even when the device is in sleep mode or after a reboot. It also provides functionalities to manage permissions, check the service status, and control battery optimization
The npm package cordova-plugin-alwaystop receives a total of 0 weekly downloads. As such, cordova-plugin-alwaystop popularity was classified as not popular.
We found that cordova-plugin-alwaystop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.