Skip to content

Commit

Permalink
Release 1.6.30
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhzh committed Nov 30, 2016
1 parent 09652e5 commit c9594c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 60 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.6.29"
version = "1.6.30"

android {
compileSdkVersion 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,6 @@ boolean isDebugWriteData() {
}
}


/**
* 第三方 App 推送平台。
*
* BAIDU - 百度云推送
* JIGUANG - 极光推送
* QQ - 腾讯云推送
* GETUI - 个推
* XIAOMI - 小米推送
*/
public enum AppPushService {
BAIDU("Android_Baidu_"),
JIGUANG("Android_Jiguang_"),
QQ("Android_QQ_"),
GETUI("Android_Getui_"),
XIAOMI("Android_Xiaomi_");

private final String profileName;

AppPushService(String profileName) {
this.profileName = profileName;
}

String getProfileName() {
return profileName;
}
}


SensorsDataAPI(Context context, String serverURL, String configureURL,
String vtrackServerURL, DebugMode debugMode) {
mContext = context;
Expand All @@ -117,20 +88,20 @@ String getProfileName() {

{
//中国移动
sCarrierMap.put("46000", " 中国移动");
sCarrierMap.put("46002", " 中国移动");
sCarrierMap.put("46007", " 中国移动");
sCarrierMap.put("46008", " 中国移动");
sCarrierMap.put("46000", "中国移动");
sCarrierMap.put("46002", "中国移动");
sCarrierMap.put("46007", "中国移动");
sCarrierMap.put("46008", "中国移动");

//中国联通
sCarrierMap.put("46001", " 中国联通");
sCarrierMap.put("46006", " 中国联通");
sCarrierMap.put("46009", " 中国联通");
sCarrierMap.put("46001", "中国联通");
sCarrierMap.put("46006", "中国联通");
sCarrierMap.put("46009", "中国联通");

//中国电信
sCarrierMap.put("46003", " 中国电信");
sCarrierMap.put("46005", " 中国电信");
sCarrierMap.put("46011", " 中国电信");
sCarrierMap.put("46003", "中国电信");
sCarrierMap.put("46005", "中国电信");
sCarrierMap.put("46011", "中国电信");
}

mFilterActivities = new ArrayList<>();
Expand Down Expand Up @@ -1048,25 +1019,6 @@ public void profileDelete() throws InvalidDataException {
trackEvent(EventType.PROFILE_DELETE, null, null, null);
}

/**
* 将第三方 App 推送平台的 Register Id 提交到 Sensors Analytics
*
* @param appPushService 第三方推送平台
* @param appKey 当前 App 第三方推送平台中的 App Key
* @param registerId 当前设备在第三方推送平台的注册 ID
* @throws com.sensorsdata.analytics.android.sdk.exceptions.InvalidDataException 当 Register ID 不符合规范时抛出异常
*/
public void registerAppPushService(AppPushService appPushService, String appKey, String
registerId) throws InvalidDataException {
String profileKey = "$app_push_key_" + appKey.replaceAll("[^a-zA-Z0-9]", "");
String profileValue = appPushService.getProfileName() + registerId;
try {
trackEvent(EventType.PROFILE_SET, null, new JSONObject().put(profileKey, profileValue), null);
} catch (JSONException e) {
throw new InvalidDataException(e);
}
}

boolean isDebugMode() {
return mDebugMode.isDebugMode();
}
Expand Down Expand Up @@ -1400,6 +1352,7 @@ public void onActivityResumed(Activity activity) {
try {
JSONObject properties = new JSONObject();
properties.put("$screen_name", activity.getClass().getCanonicalName());

if (activity instanceof ScreenAutoTracker) {
ScreenAutoTracker screenAutoTracker = (ScreenAutoTracker) activity;

Expand Down Expand Up @@ -1648,7 +1601,7 @@ private static void mergeJSONObject(final JSONObject source, JSONObject dest)
static final int VTRACK_SUPPORTED_MIN_API = 16;

// SDK版本
static final String VERSION = "1.6.29";
static final String VERSION = "1.6.30";

static Boolean ENABLE_LOG = false;

Expand Down

0 comments on commit c9594c8

Please sign in to comment.