Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
4.7.15 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfing committed Jul 15, 2019
1 parent 2f2316f commit 1224341
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ public void onPushMsg(Context var1, byte[] var2, String var3) {
}

/**
* 响应通知栏点击事件
* 注意:这一机制基本上是失效的,华为官方不推荐使用这一接口来响应不同的通知内容。
* 响应通知栏点击事件(已废弃)
* 注意:这一机制现在已经是失效的了,华为官方不推荐使用这一接口来响应不同的通知内容。
*
* @param context
* @param event
* @param extras
*/
@Override
@Deprecated
public void onEvent(Context context, Event event, Bundle extras) {
LogUtil.avlog.d("received Notify Event. Event=" + event);
if (Event.NOTIFICATION_CLICK_BTN.equals(event) || Event.NOTIFICATION_OPENED.equals(event)) {
Expand All @@ -112,7 +113,7 @@ public void onEvent(Context context, Event event, Bundle extras) {
* @param context
* @param pushState
*/
@Override
@Deprecated
public void onPushState(Context context, boolean pushState) {
LogUtil.avlog.d("pushState changed, current=" + pushState);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,15 @@ public static List<String> getVIVOTopics(Context context) {
* Oppo push
*/


/**
* register Oppo Push.
*
* @param context
* @param appKey
* @param appSecret
* @param callback
* @return
*/
public static boolean registerOppoPush(Context context, String appKey, String appSecret,
AVOPPOPushAdapter callback) {
if (!isSupportOppoPush(context)) {
Expand All @@ -494,68 +502,130 @@ public static boolean registerOppoPush(Context context, String appKey, String ap
return true;
}

/**
* judgement if support oppo push or not.
*
* @param context
* @return
*/
public static boolean isSupportOppoPush(Context context) {
return com.coloros.mcssdk.PushManager.isSupportPush(context);
}

/**
* pause oppo push
*/
public static void pauseOppoPush() {
com.coloros.mcssdk.PushManager.getInstance().pausePush();
}

/**
* resume oppo push
*/
public static void resumeOppoPush() {
com.coloros.mcssdk.PushManager.getInstance().resumePush();
}

/**
* set oppo push time.
* @param weekDays
* @param startHour
* @param startMinute
* @param endHour
* @param endMinute
*/
public static void setOppoPushTime(List<Integer> weekDays, int startHour, int startMinute,
int endHour, int endMinute) {
com.coloros.mcssdk.PushManager.getInstance().setPushTime(weekDays, startHour, startMinute,
endHour, endMinute);
}

/**
* retrieve oppo push time.
*/
public static void getOppoPushTime() {
com.coloros.mcssdk.PushManager.getInstance().getPushTime();
}

/**
* set oppo push aliases.
* @param aliases
*/
public static void setOppoAliases(List<String> aliases) {
com.coloros.mcssdk.PushManager.getInstance().setAliases(aliases);
}

/**
* unset oppo push aliases.
* @param alias
*/
public static void unsetOppoAlias(String alias) {
com.coloros.mcssdk.PushManager.getInstance().unsetAlias(alias);
}

/**
* get oppo aliases.
*/
public static void getOppoAliases() {
com.coloros.mcssdk.PushManager.getInstance().getAliases();
}

/**
* set oppo push account.
* @param account
*/
public static void setOppoUserAccount(String account) {
com.coloros.mcssdk.PushManager.getInstance().setUserAccount(account);
}

/**
* unset oppo push accounts.
* @param accounts
*/
public static void unsetOppoUserAccouts(List<String> accounts) {
com.coloros.mcssdk.PushManager.getInstance().unsetUserAccounts(accounts);
}

/**
* get oppo push accounts.
*/
public static void getOppoUserAccounts() {
com.coloros.mcssdk.PushManager.getInstance().getUserAccounts();
}

/**
* set oppo push tags.
* @param tags
*/
public static void setOppoTags(List<String> tags) {
com.coloros.mcssdk.PushManager.getInstance().setTags(tags);
}

/**
* unset oppo push tags.
* @param tags
*/
public static void unsetOppoTags(List<String> tags) {
com.coloros.mcssdk.PushManager.getInstance().unsetTags(tags);
}

/**
* retrieve oppo push tags.
*/
public static void getOppoTags() {
com.coloros.mcssdk.PushManager.getInstance().getTags();
}

/**
* get oppo push status
*/
public static void getOppoPushStatus() {
com.coloros.mcssdk.PushManager.getInstance().getPushStatus();
}

/**
* get oppo notification status.
*/
public static void getOppoNotificationStatus() {
com.coloros.mcssdk.PushManager.getInstance().getNotificationStatus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class PaasClient {
static final String DEFAULT_CONTENT_TYPE = "application/json";
public static final String DEFAULT_FAIL_STRING = "request failed!!!";

public static final String sdkVersion = "4.7.14";
public static final String sdkVersion = "4.7.15";

private static final String userAgent = "AVOS Cloud android-" + sdkVersion + " SDK";
private AVUser currentUser = null;
Expand Down
35 changes: 35 additions & 0 deletions avoscloud-sdk/src/test/java/com/avos/avoscloud/AVObjectTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.avos.avoscloud;

import com.alibaba.fastjson.JSON;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -22,9 +24,42 @@ public class AVObjectTest {

@Before
public void initAvos() {
AVOSCloud.setServer(AVOSCloud.SERVER_TYPE.API, "avoscloud.com");
AVOSCloud.setServer(AVOSCloud.SERVER_TYPE.ENGINE, "avoscloud.com");
AVOSCloud.setServer(AVOSCloud.SERVER_TYPE.PUSH, "avoscloud.com");
AVOSCloud.setServer(AVOSCloud.SERVER_TYPE.RTM, "avoscloud.com");
AVOSCloud.initialize(RuntimeEnvironment.application, TestConfig.TEST_APP_ID, TestConfig.TEST_APP_KEY);
}

@Test
public void testAVObjectDeserialize() {
String data = "{\n" +
" \"image\": {\n" +
" \"bucket\": \"xtuccgoj\",\n" +
" \"metaData\": {\n" +
" \"owner\": \"unknown\",\n" +
" \"size\": 12382\n" +
" },\n" +
" \"createdAt\": \"2019-06-22T07:18:09.584Z\",\n" +
" \"mime_type\": \"image/jpeg\",\n" +
" \"__type\": \"File\",\n" +
" \"name\": \"shop_vip_qq.jpg\",\n" +
" \"url\": \"http://file2.i7play.com/8de5fdb6cf3f8e91010f/shop_vip_qq.jpg\",\n" +
" \"objectId\": \"5d0dd631eaa375007402d28a\",\n" +
" \"updatedAt\": \"2019-06-22T07:18:09.584Z\"\n" +
" },\n" +
" \"createdAt\": \"2019-06-22T06:48:28.395Z\",\n" +
" \"__type\": \"Object\",\n" +
" \"name\": \"腾讯会员月卡\",\n" +
" \"end\": \"-1\",\n" +
" \"className\": \"ShopItem\",\n" +
" \"type\": 1,\n" +
" \"value\": 19000,\n" +
" \"objectId\": \"5d0dcf3c43e78c0073024a19\",\n" +
" \"updatedAt\": \"2019-06-22T12:11:50.924Z\"\n" +
"}";
AVObject obj = JSON.parseObject(data, AVObject.class);
}
@Test
public void testAVObjectSave() throws AVException {
AVObject object = new AVObject(TEST_TABLE_NAME);
Expand Down
114 changes: 0 additions & 114 deletions avoscloud-statistics/avoscloud-statistics.iml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.7.14
VERSION_NAME=4.7.15
VERSION_CODE=2695
GROUP=cn.leancloud.android

Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include ':avoscloud-sdk'
include ':avoscloud-feedback'
include ':avoscloud-push'
include ':avoscloud-search'
include ':avoscloud-statistics'
include ':avoscloud-fcm'
include ':hmsagent'
include ':avoscloud-mixpush'

0 comments on commit 1224341

Please sign in to comment.