|
|
@@ -16,6 +16,7 @@ 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 { Locale } from 'vant'
|
|
|
import vantEnUS from 'vant/es/locale/lang/en-US'
|
|
|
|
|
|
@@ -88,18 +89,36 @@ document.addEventListener('deviceready', () => {
|
|
|
)
|
|
|
}
|
|
|
Openinstall.init()
|
|
|
- Openinstall.addListener('wakeUp', data => {
|
|
|
- console.log('wakeUp', data)
|
|
|
+ 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('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.
|
|
|
+ isDebug: true,
|
|
|
+ waitForATTUserAuthorization: 10, // for iOS 14 and higher
|
|
|
+ minTimeBetweenSessions: 6, // default 5 sec
|
|
|
+ registerOnDeepLink: true,
|
|
|
+ registerConversionListener: true,
|
|
|
+ registerOnAppOpenAttribution: false,
|
|
|
+ deepLinkTimeout: 4000, // default 3000 ms
|
|
|
+ useReceiptValidationSandbox: true, // iOS only
|
|
|
+ useUninstallSandbox: true // iOS only
|
|
|
+ }
|
|
|
+
|
|
|
+ AppsFlyer.initSDK(afConfig).then(res => alert(JSON.stringify(res)))
|
|
|
setTimeout(() => {
|
|
|
SplashScreen.hide()
|
|
|
}, 1000)
|