GitXplorerGitXplorer
w

tauri-plugin-app-exit

public
1 stars
0 forks
13 issues

Commits

List of commits on branch main.
Unverified
ace1889de670977da6f61ef9ad2f8892d32c3723

xcode gitignore

wwtto00 committed 3 months ago
Verified
7b75fa95aa98d2fe0ae45f6438a49d72554d0cf2

Merge pull request #2 from wtto00/examples

wwtto00 committed 3 months ago
Unverified
03af2919d14ac3fca022e4fe5226ba0090269415

chore: ruun desktop

wwtto00 committed 3 months ago
Unverified
16b731cf28f18270d6e5aaae5dd323b6ff064b0b

chore: add example of android and ios

wwtto00 committed 3 months ago
Unverified
20d56a76801c180f458a678e47a5941e5b11f01b

New verion 0.1.1

wwtto00 committed 3 months ago
Unverified
539d5fe219fb7b5f1e7f55fde71685edc4e487fe

fix: ci

wwtto00 committed 3 months ago

README

The README file for this repository.

Tauri Plugin app-exit

A plugin for tauri@v2 to exit app.

Platform Supported

Platform Supported
Linux
Windows
macOS
Android
iOS

This plugin is similar to tauri-plugin-process, with the addition of support for Android and iOS platforms.

Setup

Install the app-exit plugin to get started.

  1. Run the following command in the src-tauri folder to add the plugin to the project’s dependencies in Cargo.toml:

    cargo add tauri-plugin-app-exit@0.1
  2. Modify lib.rs to initialize the plugin:

     #[cfg_attr(mobile, tauri::mobile_entry_point)]
     pub fn run() {
         tauri::Builder::default()
    +        .plugin(tauri_plugin_app_exit::init())
             .run(tauri::generate_context!())
             .expect("error while running tauri application");
     }
  3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:

    pnpm add tauri-plugin-app-exit-api@0.1
  4. Modify src-tauri/capabilities/default.json to Allow the frontend to execute the exit_app command.

     {
       "$schema": "../gen/schemas/desktop-schema.json",
       "identifier": "default",
       "description": "Capability for the main window",
       "windows": ["main"],
       "permissions": [
         "core:default",
    +    "app-exit:default"
       ]
     }

Usage

import { exitApp } from tauri-plugin-app-exit-api";

exitApp().catch(err => {
  console.error(err)
})