Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
location share white
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
location share white
Commits
f1e16118
Commit
f1e16118
authored
Dec 04, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
d1841811
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
4 deletions
+69
-4
build.gradle.kts
app/build.gradle.kts
+4
-0
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+3
-0
NewComUtils.kt
...in/java/com/base/locationsharewhite/helper/NewComUtils.kt
+1
-1
SplashActivity.kt
...a/com/base/locationsharewhite/ui/splash/SplashActivity.kt
+5
-3
SolarEngineUtils.kt
...ava/com/base/locationsharewhite/utils/SolarEngineUtils.kt
+56
-0
No files found.
app/build.gradle.kts
View file @
f1e16118
...
...
@@ -130,4 +130,8 @@ dependencies {
// 语种切换框架:https://github.com/getActivity/MultiLanguages
implementation
(
"com.github.getActivity:MultiLanguages:9.3"
)
//solar 归因
implementation
(
"com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3"
)
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
f1e16118
...
...
@@ -23,10 +23,12 @@ import com.base.locationsharewhite.service.StayJobService.Companion.startJob
import
com.base.locationsharewhite.ui.splash.SplashActivity
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.SolarEngineUtils.solarkey
import
com.facebook.FacebookSdk
import
com.google.gson.Gson
import
com.hjq.language.MultiLanguages
import
com.hjq.language.OnLanguageListener
import
com.reyun.solar.engine.SolarEngineManager
import
org.json.JSONObject
import
java.util.Locale
import
java.util.UUID
...
...
@@ -100,6 +102,7 @@ class MyApplication : Application() {
InstallHelps
.
init
{
initRemoteConfig
()
}
SolarEngineManager
.
getInstance
().
preInit
(
this
,
solarkey
)
initLifeListener
()
...
...
app/src/main/java/com/base/locationsharewhite/helper/NewComUtils.kt
View file @
f1e16118
...
...
@@ -32,7 +32,7 @@ object NewComUtils {
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences
.
getInstance
().
getString
(
"gid"
,
""
)
}&
aid
=
$
{
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)}
&
mode
=
4
"
}&
aid
=
$
{
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)}
"
// mode =3 google mode=2 facebook mode=1 自然,mode=4 测试
// &mode=3
...
...
app/src/main/java/com/base/locationsharewhite/ui/splash/SplashActivity.kt
View file @
f1e16118
...
...
@@ -20,6 +20,7 @@ import com.base.locationsharewhite.ui.main.MainActivity
import
com.base.locationsharewhite.ui.set.SettingActivity
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.SolarEngineUtils.initSolarEngine
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.delay
...
...
@@ -56,6 +57,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView {
if
(
ifAgreePrivacy
)
{
agreePrivacy
()
}
initSolarEngine
(
true
)
}
override
fun
showAd
()
{
...
...
@@ -70,17 +72,17 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView {
cancelProgressJob
()
}
override
fun
close
(
where
:
Int
)
{
override
fun
close
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"AdsShowCallBack close"
)
jumpNext
()
}
override
fun
failed
(
where
:
Int
)
{
override
fun
failed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"AdsShowCallBack failed"
)
jumpNext
()
}
override
fun
googleFailed
(
where
:
Int
)
{
override
fun
googleFailed
(
where
:
Int
)
{
LogEx
.
logDebug
(
TAG
,
"AdsShowCallBack googleFailed"
)
jumpNext
()
}
...
...
app/src/main/java/com/base/locationsharewhite/utils/SolarEngineUtils.kt
0 → 100644
View file @
f1e16118
package
com.base.locationsharewhite.utils
import
android.content.Context
import
com.base.locationsharewhite.BuildConfig
import
com.base.locationsharewhite.helper.EventUtils
import
com.reyun.solar.engine.OnAttributionListener
import
com.reyun.solar.engine.OnInitializationCallback
import
com.reyun.solar.engine.SolarEngineConfig
import
com.reyun.solar.engine.SolarEngineManager
import
org.json.JSONObject
object
SolarEngineUtils
{
private
val
TAG
=
"SolarEngineUtils"
val
solarkey
=
"bd26f9b9ade9818d"
fun
Context
.
initSolarEngine
(
gdprDeny
:
Boolean
=
false
)
{
val
configBuilder
=
SolarEngineConfig
.
Builder
()
if
(
BuildConfig
.
DEBUG
)
{
configBuilder
.
logEnabled
()
//开启本地调试日志
}
if
(
gdprDeny
)
{
configBuilder
.
isGDPRArea
=
true
configBuilder
.
adPersonalizationEnabled
=
true
configBuilder
.
adUserDataEnabled
=
true
}
configBuilder
.
isCoppaEnabled
=
true
configBuilder
.
setKidsAppEnabled
(
true
)
configBuilder
.
fbAppID
=
""
val
config
=
configBuilder
.
build
()
SolarEngineManager
.
getInstance
().
initialize
(
this
,
solarkey
,
config
,
OnInitializationCallback
{
code
->
if
(
code
==
0
)
{
//初始化成功
config
.
setOnAttributionListener
(
object
:
OnAttributionListener
{
override
fun
onAttributionSuccess
(
attribution
:
JSONObject
)
{
//获取归因结果成功时执行的动作
EventUtils
.
event
(
"source_atrribute"
,
ext
=
attribution
)
}
override
fun
onAttributionFail
(
errorCode
:
Int
)
{
//获取归因结果失败时执行的动作
EventUtils
.
event
(
"SolarEngineManager onAttributionFail errorCode=$errorCode"
)
}
})
}
else
{
//初始化失败,具体失败原因参考下方code码释义
EventUtils
.
event
(
"SolarEngineManager init error code=$code"
)
}
})
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment