oppo 推送内容限制200字符大小
This commit is contained in:
@@ -18,6 +18,7 @@ import javax.annotation.PostConstruct;
|
|||||||
@Component
|
@Component
|
||||||
public class OppoPush {
|
public class OppoPush {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(OppoPush.class);
|
private static final Logger LOG = LoggerFactory.getLogger(OppoPush.class);
|
||||||
|
private static final int OPPO_PUSH_MAX_CONTENT = 200;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
OppoConfig mConfig;
|
OppoConfig mConfig;
|
||||||
@@ -81,6 +82,10 @@ public class OppoPush {
|
|||||||
String[] arr = Utility.getPushTitleAndContent(pushMessage);
|
String[] arr = Utility.getPushTitleAndContent(pushMessage);
|
||||||
String title = arr[0];
|
String title = arr[0];
|
||||||
String body = arr[1];
|
String body = arr[1];
|
||||||
|
if(body != null && body.length() > OPPO_PUSH_MAX_CONTENT) {
|
||||||
|
body = body.substring(0, OPPO_PUSH_MAX_CONTENT-3);
|
||||||
|
body += "...";
|
||||||
|
}
|
||||||
|
|
||||||
notification.setTitle(title);
|
notification.setTitle(title);
|
||||||
notification.setContent(body);
|
notification.setContent(body);
|
||||||
|
|||||||
Reference in New Issue
Block a user