Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fairyland
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_fairyland
Commits
12c6992a
Commit
12c6992a
authored
Dec 31, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.3 添加极光推送
parent
bfb8faac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
12 deletions
+50
-12
build.gradle
Fairyland/app/build.gradle
+5
-2
AndroidManifest.xml
Fairyland/app/src/main/AndroidManifest.xml
+8
-0
MintsApplication.java
...p/src/main/java/com/mints/fairyland/MintsApplication.java
+20
-0
SplashYlhActivity.kt
...ava/com/mints/fairyland/ui/activitys/SplashYlhActivity.kt
+17
-10
No files found.
Fairyland/app/build.gradle
View file @
12c6992a
...
...
@@ -27,6 +27,9 @@ android {
}
manifestPlaceholders
=
[
CHANNEL_NAME_VALUE:
"fairyland"
,
JPUSH_PKGNAME
:
applicationId
,
JPUSH_APPKEY
:
RELEASE_JPUSH_KEY
,
JPUSH_CHANNEL
:
"fairyland"
,
UMENG_KEY
:
RELEASE_UMENG_KEY
,
APPLOG_SCHEME
:
"rangersapplog.byAx6uYt"
.
toLowerCase
(),
SHARE_KEY
:
RELEASE_SHARESDK_KEY
,
...
...
@@ -179,8 +182,8 @@ dependencies {
// leakcanary
debugImplementation
'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
//
implementation 'cn.jiguang.sdk:jpush:3.6.6'
//
implementation 'cn.jiguang.sdk:jcore:2.3.8'
implementation
'cn.jiguang.sdk:jpush:3.6.6'
implementation
'cn.jiguang.sdk:jcore:2.3.8'
// 移动安全联盟
implementation
(
name:
'msa_mdid_1.0.13'
,
ext:
'aar'
)
// 穿山甲广告
...
...
Fairyland/app/src/main/AndroidManifest.xml
View file @
12c6992a
...
...
@@ -59,6 +59,14 @@
android:name=
"Mob-AppSecret"
android:value=
"${SHARE_SECRET}"
/>
<!-- 极光 -->
<meta-data
android:name=
"JPUSH_APPKEY"
android:value=
"${JPUSH_APPKEY}"
/>
<meta-data
android:name=
"JPUSH_CHANNEL"
android:value=
"${JPUSH_CHANNEL}"
/>
<activity
android:name=
"com.mints.fairyland.ui.activitys.SplashYlhActivity"
android:screenOrientation=
"portrait"
>
...
...
Fairyland/app/src/main/java/com/mints/fairyland/MintsApplication.java
View file @
12c6992a
package
com
.
mints
.
fairyland
;
import
android.app.ActivityManager
;
import
android.app.Notification
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
...
...
@@ -31,6 +32,8 @@ import com.umeng.commonsdk.UMConfigure;
import
java.util.concurrent.Executors
;
import
cn.jpush.android.api.BasicPushNotificationBuilder
;
import
cn.jpush.android.api.JPushInterface
;
import
rx.Scheduler
;
import
rx.schedulers.Schedulers
;
...
...
@@ -128,6 +131,9 @@ public class MintsApplication extends MultiDexApplication {
// 猎豹游戏初始化
LiebaoManager
.
getInstance
().
initCmGameSdk
();
// 极光推送
initJpush
();
}
/**
...
...
@@ -192,6 +198,20 @@ public class MintsApplication extends MultiDexApplication {
}
}
/**
* 绑定jpush
*/
private
void
initJpush
()
{
JPushInterface
.
setDebugMode
(
BuildConfig
.
DEBUG
);
// 设置开启日志,发布时请关闭日志
JPushInterface
.
init
(
this
);
BasicPushNotificationBuilder
builder
=
new
BasicPushNotificationBuilder
(
getApplicationContext
());
builder
.
statusBarDrawable
=
R
.
mipmap
.
ic_launcher
;
builder
.
notificationFlags
=
Notification
.
FLAG_AUTO_CANCEL
;
//设置为自动消失
builder
.
notificationDefaults
=
Notification
.
DEFAULT_SOUND
|
Notification
.
DEFAULT_VIBRATE
|
Notification
.
DEFAULT_LIGHTS
;
// 设置为铃声与震动都要
JPushInterface
.
setDefaultPushNotificationBuilder
(
builder
);
}
private
String
getProcessName
(
Context
context
)
{
if
(
context
==
null
)
return
null
;
ActivityManager
manager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
...
...
Fairyland/app/src/main/java/com/mints/fairyland/ui/activitys/SplashYlhActivity.kt
View file @
12c6992a
...
...
@@ -197,17 +197,24 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
}
private
fun
readyGoOtherActivity
()
{
val
customVersion
:
Int
=
ps
.
getInt
(
Constant
.
CUSTOM_VERSION
,
0
)
val
isFirstEnter
:
Boolean
=
ps
.
getBoolean
(
Constant
.
ISFIRSTENTER
+
customVersion
,
true
)
if
(
isFirstEnter
)
{
readyGoThenKill
(
GuideActivity
::
class
.
java
)
// val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0)
// val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true)
// if (isFirstEnter) {
// readyGoThenKill(GuideActivity::class.java)
// } else {
// val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
// if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
// readyGo(LoginActivity::class.java)
// } else {
// readyGoThenKill(MainActivity::class.java)
// }
// }
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
)
&&
!
UserManager
.
getInstance
().
userIsLogin
())
{
readyGo
(
LoginActivity
::
class
.
java
)
}
else
{
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
)
&&
!
UserManager
.
getInstance
().
userIsLogin
())
{
readyGo
(
LoginActivity
::
class
.
java
)
}
else
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
}
}
\ 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