|
|
@@ -15,10 +15,12 @@ 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 { AppsFlyer } from 'appsflyer-capacitor-plugin'
|
|
|
+// import { Openinstall } from 'capacitor-openinstall'
|
|
|
+import { AppsFlyer, AFConstants } from 'appsflyer-capacitor-plugin'
|
|
|
import { Locale } from 'vant'
|
|
|
import vantEnUS from 'vant/es/locale/lang/en-US'
|
|
|
+import { useStorage } from '@vueuse/core'
|
|
|
+import { init as initEruda } from '@/utils/eruda'
|
|
|
|
|
|
import 'normalize.css/normalize.css'
|
|
|
|
|
|
@@ -88,25 +90,25 @@ document.addEventListener('deviceready', () => {
|
|
|
err => console.error('Failed to get insets top:', err)
|
|
|
)
|
|
|
}
|
|
|
- Openinstall.init()
|
|
|
- const handleData = data => {
|
|
|
- if (data && data.data) {
|
|
|
- let params = JSON.parse(data.data)
|
|
|
- if (params.invitor) {
|
|
|
- localStorage.setItem('invitor', params.invitor)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Openinstall.addListener('wakeUp', data => {
|
|
|
- console.log('wakeUp data:', data)
|
|
|
- })
|
|
|
- Openinstall.getInstallCanRetry(data => {
|
|
|
- console.log('install data:', data)
|
|
|
- handleData(data)
|
|
|
- })
|
|
|
+ // Openinstall.init()
|
|
|
+ // const handleData = data => {
|
|
|
+ // if (data && data.data) {
|
|
|
+ // let params = JSON.parse(data.data)
|
|
|
+ // if (params.invitor) {
|
|
|
+ // localStorage.setItem('invitor', params.invitor)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Openinstall.addListener('wakeUp', data => {
|
|
|
+ // console.log('wakeUp data:', data)
|
|
|
+ // })
|
|
|
+ // Openinstall.getInstallCanRetry(data => {
|
|
|
+ // console.log('install data:', data)
|
|
|
+ // handleData(data)
|
|
|
+ // })
|
|
|
const afConfig = {
|
|
|
- appID: 'com.bigauction.mobile', // replace with your app ID.
|
|
|
- devKey: 'xiQnptYGJ44kMBgmR3esZC', // replace with your dev key.
|
|
|
+ appID: 'id1665426567', // replace with your app ID.
|
|
|
+ devKey: Capacitor.getPlatform() === 'android' ? 'xiQnptYGJ44kMBgmR3esZC' : 'QFfmCXsWbhqgRiXsWx7b2o', // replace with your dev key.
|
|
|
isDebug: true,
|
|
|
waitForATTUserAuthorization: 10, // for iOS 14 and higher
|
|
|
minTimeBetweenSessions: 6, // default 5 sec
|
|
|
@@ -118,9 +120,29 @@ document.addEventListener('deviceready', () => {
|
|
|
useUninstallSandbox: true // iOS only
|
|
|
}
|
|
|
|
|
|
- AppsFlyer.initSDK(afConfig).then(res => alert(JSON.stringify(res)))
|
|
|
+ AppsFlyer.initSDK(afConfig)
|
|
|
+ .then(res => {
|
|
|
+ console.log('initSDK: ', res)
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log('initSDK error: ', e)
|
|
|
+ })
|
|
|
+ AppsFlyer.addListener(AFConstants.CONVERSION_CALLBACK, res => {
|
|
|
+ console.log('CONVERSION_CALLBACK:', res)
|
|
|
+ })
|
|
|
+ AppsFlyer.addListener(AFConstants.OAOA_CALLBACK, res => {
|
|
|
+ console.log('OAOA_CALLBACK: ', res)
|
|
|
+ })
|
|
|
+ AppsFlyer.addListener(AFConstants.UDL_CALLBACK, res => {
|
|
|
+ console.log('UDL_CALLBACK: ', res)
|
|
|
+ })
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
SplashScreen.hide()
|
|
|
}, 1000)
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+if (useStorage('showConsole', 0).value > new Date().getTime()) {
|
|
|
+ initEruda()
|
|
|
+}
|