xiongzhu %!s(int64=3) %!d(string=hai) anos
pai
achega
7c1e173486

+ 1 - 0
android/app/capacitor.build.gradle

@@ -23,6 +23,7 @@ dependencies {
     implementation project(':capacitor-share')
     implementation project(':capacitor-splash-screen')
     implementation project(':capacitor-status-bar')
+    implementation project(':capacitor-openinstall')
 
 }
 

+ 11 - 2
android/app/src/main/AndroidManifest.xml

@@ -9,7 +9,9 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         android:usesCleartextTraffic="true">
-
+        <meta-data
+            android:name="com.openinstall.APP_KEY"
+            android:value="crgkm2"/>
         <activity
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
             android:name="com.bigauction.mobile.MainActivity"
@@ -22,7 +24,12 @@
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
-
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+                <category android:name="android.intent.category.BROWSABLE"/>
+                <data android:scheme="crgkm2"/>
+            </intent-filter>
         </activity>
 
         <provider
@@ -39,4 +46,6 @@
     <!-- Permissions -->
 
     <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 </manifest>

+ 3 - 0
android/capacitor.settings.gradle

@@ -43,3 +43,6 @@ project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capa
 
 include ':capacitor-status-bar'
 project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
+
+include ':capacitor-openinstall'
+project(':capacitor-openinstall').projectDir = new File('../../../capacitor/capacitor-openinstall/android')

+ 1 - 0
package.json

@@ -33,6 +33,7 @@
     "@vant/area-data": "^1.3.2",
     "@vueuse/core": "^9.6.0",
     "axios": "^1.2.0",
+    "capacitor-openinstall": "https://github.com/x1ongzhu/capacitor-openinstall.git",
     "cordova-plugin-android-notch": "^1.0.3",
     "date-fns": "^2.29.3",
     "eruda": "^2.6.1",

+ 10 - 0
src/main.js

@@ -15,6 +15,7 @@ import { StatusBar, Style } from '@capacitor/status-bar'
 import { Capacitor } from '@capacitor/core'
 import { useBackButton } from '@ionic/vue'
 import { SplashScreen } from '@capacitor/splash-screen'
+import { Openinstall } from 'capacitor-openinstall'
 
 import 'normalize.css/normalize.css'
 
@@ -40,6 +41,8 @@ import './styles/main.less'
 import './styles/theme/variables.less'
 
 import common from './mixins/common'
+import eruda from 'eruda'
+eruda.init()
 
 const app = createApp(App)
 app.use(i18n)
@@ -80,3 +83,10 @@ if (Capacitor.isNativePlatform()) {
         )
     }
 }
+Openinstall.init()
+Openinstall.addListener('wakeUp', data => {
+    console.log('wakeUp', data)
+})
+Openinstall.getInstallCanRetry(data => {
+    console.log('getInstallCanRetry', data)
+})

+ 4 - 0
yarn.lock

@@ -880,6 +880,10 @@ camelcase@^5.0.0:
   resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz"
   integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
 
+"capacitor-openinstall@https://github.com/x1ongzhu/capacitor-openinstall.git":
+  version "0.0.1"
+  resolved "https://github.com/x1ongzhu/capacitor-openinstall.git#f3549b4d772b4e2713c7ffc9e89067c662411342"
+
 caw@^2.0.0, caw@^2.0.1:
   version "2.0.1"
   resolved "https://registry.npmmirror.com/caw/-/caw-2.0.1.tgz"