Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ionic react exit app

useEffect(() => {
    if (Capacitor.isNative) {
      Plugins.App.addListener("backButton", (e) => {
        if (window.location.pathname === "/") {
          // Show A Confirm Box For User to exit app or not
          let ans = window.confirm("Are you sure");
          if (ans) {
            Plugins.App.exitApp();
          } 
        } else if (window.location.pathname === "/YourFirstPageRoute") {
           // Show A Confirm Box For User to exit app or not
          let ans = window.confirm("Are you sure");
          if (ans) {
            Plugins.App.exitApp();
          } 
        } 
      });
    }
  }, []);
Comment

PREVIOUS NEXT
Code Example
Javascript :: discord.js send dm to specific user 
Javascript :: pdf extract text nodejs 
Javascript :: rest client vs code 
Javascript :: ngreadonly 
Javascript :: vonage singal api 
Javascript :: aws lambda create 
Javascript :: asasa 
Javascript :: javascript compare two arrays of objects return difference 
Javascript :: direction of scroll on page 
Javascript :: tab change hash 
Javascript :: redux store template 
Javascript :: jquery add submit button dynamically to form 
Javascript :: what is runtime in javascript 
Javascript :: shopify a problem repeatedly occured on url 
Javascript :: this.$moment.tz.guess() not working mozilla 
Javascript :: how to jump one page to another on specific tab elementor 
Javascript :: splice javascript list 
Javascript :: is element displayed js 
Javascript :: javascript nested destructuring 
Javascript :: React Textarea package With Editor Functionalities 
Javascript :: api post to curl command converter 
Javascript :: repidme 
Javascript :: rechart graph 
Javascript :: infinite loop MenuItem MUI fixed onClick event 
Javascript :: send data to another page javascript 
Javascript :: html document from string javascript 
Javascript :: remove nth character from string javascript 
Javascript :: onPlay 
Javascript :: netsuite get search column value suitescript 
Javascript :: mvc return view with query string 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =