feat: 消息推送:接入极光消息推送系统—客户端 https://jira.shanqu.cc/browse/GHZS-5050
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter;
|
||||
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_PUSH;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ANSWER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ARTICLE;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_CATEGORY;
|
||||
@ -129,6 +130,10 @@ public class SkipActivity extends BaseActivity {
|
||||
String qaId = uri.getQueryParameter("qa_id");
|
||||
String qaContentId = uri.getQueryParameter(EntranceConsts.KEY_QA_CONTENT_ID);
|
||||
String qaTitle = uri.getQueryParameter(EntranceConsts.KEY_QA_TITLE);
|
||||
String isFromPushString = uri.getQueryParameter(EntranceConsts.KEY_IS_FROM_PUSH);
|
||||
boolean isFromPush = !TextUtils.isEmpty(isFromPushString) && isFromPushString.equals("true");
|
||||
String entrance = isFromPush ? ENTRANCE_PUSH : ENTRANCE_BROWSER;
|
||||
String pathName = isFromPush ? ENTRANCE_PUSH : "浏览器";
|
||||
|
||||
if (host != null) {
|
||||
Intent intent;
|
||||
@ -141,40 +146,40 @@ public class SkipActivity extends BaseActivity {
|
||||
createShortcut(uri);
|
||||
return;
|
||||
case HOST_ARTICLE:
|
||||
DirectUtils.directToArticle(this, path, ENTRANCE_BROWSER);
|
||||
DirectUtils.directToArticle(this, path, entrance);
|
||||
break;
|
||||
case HOST_GAME:
|
||||
DirectUtils.directToGameDetail(this, path, "", ENTRANCE_BROWSER, "true".equals(uri.getQueryParameter("auto_download")), to, null);
|
||||
DirectUtils.directToGameDetail(this, path, "", entrance, "true".equals(uri.getQueryParameter("auto_download")), to, null);
|
||||
break;
|
||||
case HOST_COLUMN:
|
||||
DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), ENTRANCE_BROWSER, null, false);
|
||||
DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), entrance, null, false);
|
||||
break;
|
||||
case HOST_SUGGESTION:
|
||||
if (!TextUtils.isEmpty(qaId)) {
|
||||
DirectUtils.directToQa(this, qaTitle, qaId);
|
||||
} else {
|
||||
// 插件反馈跳转到意见反馈分类页
|
||||
DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, true, false, EntranceConsts.ENTRANCE_BROWSER);
|
||||
DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, true, false, entrance);
|
||||
}
|
||||
break;
|
||||
case HOST_DOWNLOAD:
|
||||
DirectUtils.directToDownloadManagerAndStartUpdate(this, path, uri.getQueryParameter(KEY_PACKAGENAME), ENTRANCE_BROWSER);
|
||||
DirectUtils.directToDownloadManagerAndStartUpdate(this, path, uri.getQueryParameter(KEY_PACKAGENAME), entrance);
|
||||
break;
|
||||
case HOST_ANSWER:
|
||||
DirectUtils.directToAnswerDetail(this, path, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToAnswerDetail(this, path, entrance, pathName);
|
||||
break;
|
||||
case HOST_QUESTION:
|
||||
DirectUtils.directToQuestionDetail(this, path, ENTRANCE_BROWSER, "浏览器", "");
|
||||
DirectUtils.directToQuestionDetail(this, path, entrance, pathName, "");
|
||||
break;
|
||||
case HOST_TOOLBOX:
|
||||
DirectUtils.directToToolbox(this, uri.getQueryParameter("gameId"), uri.getQueryParameter("toolboxUrl"), ENTRANCE_BROWSER);
|
||||
DirectUtils.directToToolbox(this, uri.getQueryParameter("gameId"), uri.getQueryParameter("toolboxUrl"), entrance);
|
||||
break;
|
||||
case HOST_COMMUNITY:
|
||||
DirectUtils.directToHomeCommunityTab(this);
|
||||
break;
|
||||
// 社区文章格式一
|
||||
case "community.article":
|
||||
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), ENTRANCE_BROWSER, "浏览器", "");
|
||||
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), entrance, pathName, "");
|
||||
break;
|
||||
// 社区文章格式二
|
||||
case "communities":
|
||||
@ -195,13 +200,13 @@ public class SkipActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
if ("articles".equals(type)) {
|
||||
DirectUtils.directToCommunityArticle(this, typeId, communityId, ENTRANCE_BROWSER, "浏览器", "");
|
||||
DirectUtils.directToCommunityArticle(this, typeId, communityId, entrance, pathName, "");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HOST_VIDEO:
|
||||
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.HOTTEST_GAME_VIDEO.getValue(),
|
||||
false, id, ENTRANCE_BROWSER, "浏览器", TextUtils.isEmpty(referer) ? "" : referer, "");
|
||||
false, id, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
|
||||
break;
|
||||
case HOST_UPLOAD_VIDEO://跳转上传视频
|
||||
String titleParameter = uri.getQueryParameter("title");
|
||||
@ -215,13 +220,13 @@ public class SkipActivity extends BaseActivity {
|
||||
VideoLinkEntity linkEntity = new VideoLinkEntity(title, categoryId, link, tagActivityId, tagActivityName);
|
||||
|
||||
SimpleGameEntity simpleGameEntity = new SimpleGameEntity(gameId != null ? gameId : "", gameName != null ? gameName : "", "", "");
|
||||
Bundle nextToBundle = VideoManagerActivity.getVideoManagerBundle(linkEntity, simpleGameEntity, EntranceConsts.ENTRANCE_BROWSER, "");
|
||||
CheckLoginUtils.checkLogin(this, nextToBundle, true, EntranceConsts.ENTRANCE_BROWSER, () ->
|
||||
DirectUtils.directToVideoManager(SkipActivity.this, linkEntity, simpleGameEntity, EntranceConsts.ENTRANCE_BROWSER, "浏览器"));
|
||||
Bundle nextToBundle = VideoManagerActivity.getVideoManagerBundle(linkEntity, simpleGameEntity, entrance, "");
|
||||
CheckLoginUtils.checkLogin(this, nextToBundle, true, entrance, () ->
|
||||
DirectUtils.directToVideoManager(SkipActivity.this, linkEntity, simpleGameEntity, entrance, pathName));
|
||||
break;
|
||||
case HOST_VIDEO_SINGLE:
|
||||
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.getValue(),
|
||||
false, "", ENTRANCE_BROWSER, "浏览器", TextUtils.isEmpty(referer) ? "" : referer, "");
|
||||
false, "", entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
|
||||
break;
|
||||
case HOST_VIDEO_MORE:
|
||||
gameId = uri.getQueryParameter("gameId");
|
||||
@ -238,7 +243,7 @@ public class SkipActivity extends BaseActivity {
|
||||
location = path;
|
||||
}
|
||||
DirectUtils.directToLegacyVideoDetail(this, path, location,
|
||||
false, TextUtils.isEmpty(gameId) ? "" : gameId, ENTRANCE_BROWSER, "浏览器", TextUtils.isEmpty(referer) ? "" : referer,
|
||||
false, TextUtils.isEmpty(gameId) ? "" : gameId, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer,
|
||||
TextUtils.isEmpty(type) ? "" : type, TextUtils.isEmpty(act) ? "" : act, TextUtils.isEmpty(paginationType) ? "page" : paginationType, TextUtils.isEmpty(fieldId) ? "" : fieldId,
|
||||
TextUtils.isEmpty(sectionName) ? "" : sectionName, false, "");
|
||||
break;
|
||||
@ -246,10 +251,10 @@ public class SkipActivity extends BaseActivity {
|
||||
DirectUtils.directToHomeVideoTab(this);
|
||||
break;
|
||||
case HOST_VIDEO_STREAMING_DESC:
|
||||
DirectUtils.directToGameDetailVideoStreaming(this, path, ENTRANCE_BROWSER);
|
||||
DirectUtils.directToGameDetailVideoStreaming(this, path, entrance);
|
||||
break;
|
||||
case HOST_VIDEO_COLLECTION:
|
||||
DirectUtils.directToGameVideo(this, path, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToGameVideo(this, path, entrance, pathName);
|
||||
break;
|
||||
case HOST_QQ:
|
||||
bundle = new Bundle();
|
||||
@ -278,32 +283,32 @@ public class SkipActivity extends BaseActivity {
|
||||
EntranceUtils.jumpActivityCompat(this, bundle);
|
||||
break;
|
||||
case EntranceConsts.HOST_VIDEO_DETAIL:
|
||||
DirectUtils.directToVideoDetail(this, path, ENTRANCE_BROWSER, "", "");
|
||||
DirectUtils.directToVideoDetail(this, path, entrance, "", "");
|
||||
break;
|
||||
case HOST_LIBAO:
|
||||
DirectUtils.directToGiftDetail(this, path, ENTRANCE_BROWSER);
|
||||
DirectUtils.directToGiftDetail(this, path, entrance);
|
||||
break;
|
||||
case HOST_USERHOME:
|
||||
String position = uri.getQueryParameter("position");
|
||||
String subTypeString = uri.getQueryParameter("sub_type");
|
||||
String subGameType = uri.getQueryParameter("sub_game_type");
|
||||
|
||||
DirectUtils.directToHomeActivity(this, path, subTypeString, subGameType, TextUtils.isEmpty(position) ? -1 : Integer.parseInt(position), ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToHomeActivity(this, path, subTypeString, subGameType, TextUtils.isEmpty(position) ? -1 : Integer.parseInt(position), entrance, pathName);
|
||||
break;
|
||||
case HOST_COMMUNITY_COLUMN:
|
||||
CommunityEntity community = new CommunityEntity();
|
||||
community.setId(uri.getQueryParameter("community_id"));
|
||||
community.setName(uri.getQueryParameter("community_name"));
|
||||
String columnId = uri.getQueryParameter("column_id");
|
||||
DirectUtils.directToCommunityColumn(this, community, columnId, ENTRANCE_BROWSER, "");
|
||||
DirectUtils.directToCommunityColumn(this, community, columnId, entrance, "");
|
||||
break;
|
||||
|
||||
case HOST_CATEGORY:
|
||||
title = uri.getQueryParameter("title");
|
||||
DirectUtils.directCategoryDirectory(this, path, title, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directCategoryDirectory(this, path, title, entrance, pathName);
|
||||
break;
|
||||
case HOST_COLUMN_COLLECTION:
|
||||
DirectUtils.directToColumnCollection(this, path, -1, ENTRANCE_BROWSER, "", "", "", "", null,false);
|
||||
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null,false);
|
||||
break;
|
||||
case EntranceConsts.HOST_BLOCK:
|
||||
name = uri.getQueryParameter("name");
|
||||
@ -315,11 +320,11 @@ public class SkipActivity extends BaseActivity {
|
||||
break;
|
||||
|
||||
case EntranceConsts.HOST_SERVER_BLOCK:
|
||||
DirectUtils.directToGameServers(this, ENTRANCE_BROWSER, "浏览器", null);
|
||||
DirectUtils.directToGameServers(this, entrance, pathName, null);
|
||||
break;
|
||||
|
||||
case EntranceConsts.HOST_AMWAY_BLOCK:
|
||||
DirectUtils.directToAmway(this, null, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToAmway(this, null, entrance, pathName);
|
||||
break;
|
||||
|
||||
case EntranceConsts.HOST_HELP:
|
||||
@ -332,11 +337,11 @@ public class SkipActivity extends BaseActivity {
|
||||
DirectUtils.directToQaCollection(this, name, path);
|
||||
break;
|
||||
case EntranceConsts.HOST_GAME_UPLOAD:
|
||||
DirectUtils.directGameUpload(this, ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directGameUpload(this, entrance, pathName);
|
||||
break;
|
||||
case EntranceConsts.HOST_GAME_ZONE:
|
||||
String zoneUrl = uri.getQueryParameter("url");
|
||||
DirectUtils.directGameZone(this, path, zoneUrl, ENTRANCE_BROWSER);
|
||||
DirectUtils.directGameZone(this, path, zoneUrl, entrance);
|
||||
break;
|
||||
case EntranceConsts.HOST_LINK:
|
||||
try {
|
||||
@ -345,7 +350,7 @@ public class SkipActivity extends BaseActivity {
|
||||
byte[] linkData = Base64.decode(dataString, Base64.DEFAULT);
|
||||
String linkDataString = new String(linkData, "UTF-8");
|
||||
LinkEntity le = GsonUtils.INSTANCE.getGson().fromJson(linkDataString, LinkEntity.class);
|
||||
DirectUtils.directToLinkPage(this, le, ENTRANCE_BROWSER, "", "");
|
||||
DirectUtils.directToLinkPage(this, le, entrance, "", "");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -360,7 +365,7 @@ public class SkipActivity extends BaseActivity {
|
||||
this,
|
||||
uri.getQueryParameter(EntranceConsts.KEY_GAME_ID),
|
||||
uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME),
|
||||
EntranceConsts.ENTRANCE_BROWSER);
|
||||
entrance);
|
||||
break;
|
||||
case EntranceConsts.HOST_GAME_CALENDAR:
|
||||
DirectUtils.directToGameServerCalendar(this, uri.getQueryParameter(EntranceConsts.KEY_GAME_ID), 0);
|
||||
@ -370,26 +375,26 @@ public class SkipActivity extends BaseActivity {
|
||||
break;
|
||||
case EntranceConsts.HOST_FORUM_DETAIL:
|
||||
String sectionId = uri.getQueryParameter("section_id");
|
||||
DirectUtils.directForumDetailSection(this, id, sectionId, ENTRANCE_BROWSER);
|
||||
DirectUtils.directForumDetailSection(this, id, sectionId, entrance);
|
||||
break;
|
||||
case EntranceConsts.HOST_GAME_RATING_DETAIL:
|
||||
DirectUtils.directToGameRatingDetail(this, uri.getQueryParameter(EntranceConsts.KEY_GAME_ID), uri.getQueryParameter(EntranceConsts.KEY_COMMENT_ID), ENTRANCE_BROWSER);
|
||||
DirectUtils.directToGameRatingDetail(this, uri.getQueryParameter(EntranceConsts.KEY_GAME_ID), uri.getQueryParameter(EntranceConsts.KEY_COMMENT_ID), entrance);
|
||||
break;
|
||||
case EntranceConsts.HOST_FORUM:
|
||||
DirectUtils.directToHomeCommunityTab(this);
|
||||
break;
|
||||
case EntranceConsts.HOST_HELP_AND_FEEDBACK:
|
||||
if ("vgame".equals(suggestionType)) {
|
||||
DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, false, true, EntranceConsts.ENTRANCE_BROWSER);
|
||||
DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, false, true, entrance);
|
||||
} else {
|
||||
DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, true, false, EntranceConsts.ENTRANCE_BROWSER);
|
||||
DirectUtils.directToHelpAndFeedback(this, content, isQaFeedback, qaContentId, true, false, entrance);
|
||||
}
|
||||
break;
|
||||
case HOST_GAME_COLLECTION_DETAIL:
|
||||
DirectUtils.directToGameCollectionDetail(this, path, ENTRANCE_BROWSER, "", null);
|
||||
DirectUtils.directToGameCollectionDetail(this, path, entrance, "", null);
|
||||
break;
|
||||
case HOST_GAME_COLLECTION_SQUARE:
|
||||
DirectUtils.directToGameCollectionSquare(this, ENTRANCE_BROWSER, "", "", "", "", "", null);
|
||||
DirectUtils.directToGameCollectionSquare(this, entrance, "", "", "", "", "", null);
|
||||
break;
|
||||
case HOST_QQ_GAME:
|
||||
String extJson = uri.getQueryParameter("ext");
|
||||
|
||||
Reference in New Issue
Block a user