|
|
@@ -21,24 +21,36 @@ export const useAppsFlyer = (() => {
|
|
|
reject(err)
|
|
|
}
|
|
|
|
|
|
- if (plus.hasPlus()) {
|
|
|
- const initSuccess = () => {
|
|
|
- window.plus.bridge.exec('AppsFlyerExpand', 'startSDK', [startCallbackID])
|
|
|
- }
|
|
|
+ switch (plus.getSystemInfo('os')) {
|
|
|
+ case 'Android': {
|
|
|
+ const initSuccess = () => {
|
|
|
+ window.plus.bridge.exec('AppsFlyerExpand', 'startSDK', [startCallbackID])
|
|
|
+ }
|
|
|
|
|
|
- const initCallbackID = window.plus.bridge.callbackId(initSuccess, fail)
|
|
|
- const startCallbackID = window.plus.bridge.callbackId(startSuccess, fail)
|
|
|
+ const initCallbackID = window.plus.bridge.callbackId(initSuccess, fail)
|
|
|
+ const startCallbackID = window.plus.bridge.callbackId(startSuccess, fail)
|
|
|
|
|
|
- window.plus.bridge.exec('AppsFlyerExpand', 'initSDK', [initCallbackID, appsFlyerKey, false])
|
|
|
- } else {
|
|
|
- // appsFlyer.initSdk({
|
|
|
- // devKey: appsFlyerKey,
|
|
|
- // //appId: appsFlyerId
|
|
|
- // }).then((res) => {
|
|
|
- // startSuccess(res)
|
|
|
- // }).catch((err) => {
|
|
|
- // fail(err)
|
|
|
- // })
|
|
|
+ window.plus.bridge.exec('AppsFlyerExpand', 'initSDK', [initCallbackID, appsFlyerKey, false])
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'iOS': {
|
|
|
+ resolve({
|
|
|
+ status: 'success',
|
|
|
+ action: 'initialized',
|
|
|
+ message: 'SDK initialized successfully'
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ default: {
|
|
|
+ // appsFlyer.initSdk({
|
|
|
+ // devKey: appsFlyerKey,
|
|
|
+ // //appId: appsFlyerId
|
|
|
+ // }).then((res) => {
|
|
|
+ // startSuccess(res)
|
|
|
+ // }).catch((err) => {
|
|
|
+ // fail(err)
|
|
|
+ // })
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
reject()
|