Supported AndroidNotificationGroup for Push and MassPush.
This commit is contained in:
@@ -699,42 +699,6 @@ PushClient::QueryAliasesOutcomeCallable PushClient::queryAliasesCallable(const Q
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
PushClient::QueryDeviceCountOutcome PushClient::queryDeviceCount(const QueryDeviceCountRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryDeviceCountOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryDeviceCountOutcome(QueryDeviceCountResult(outcome.result()));
|
||||
else
|
||||
return QueryDeviceCountOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void PushClient::queryDeviceCountAsync(const QueryDeviceCountRequest& request, const QueryDeviceCountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryDeviceCount(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
PushClient::QueryDeviceCountOutcomeCallable PushClient::queryDeviceCountCallable(const QueryDeviceCountRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryDeviceCountOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryDeviceCount(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
PushClient::QueryDeviceInfoOutcome PushClient::queryDeviceInfo(const QueryDeviceInfoRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -88,10 +88,12 @@ void MassPushRequest::setPushTask(const std::vector<MassPushRequest::PushTask> &
|
||||
setBodyParameter(pushTaskObjStr + ".Title", pushTaskObj.title);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidRenderStyle", pushTaskObj.androidRenderStyle);
|
||||
setBodyParameter(pushTaskObjStr + ".iOSExtParameters", pushTaskObj.iOSExtParameters);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidNotificationHonorChannel", pushTaskObj.androidNotificationHonorChannel);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidXiaomiImageUrl", pushTaskObj.androidXiaomiImageUrl);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidPopupBody", pushTaskObj.androidPopupBody);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidBigPictureUrl", pushTaskObj.androidBigPictureUrl);
|
||||
setBodyParameter(pushTaskObjStr + ".iOSSilentNotification", pushTaskObj.iOSSilentNotification ? "true" : "false");
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidNotificationGroup", pushTaskObj.androidNotificationGroup);
|
||||
setBodyParameter(pushTaskObjStr + ".SendChannels", pushTaskObj.sendChannels);
|
||||
setBodyParameter(pushTaskObjStr + ".Target", pushTaskObj.target);
|
||||
setBodyParameter(pushTaskObjStr + ".AndroidBigTitle", pushTaskObj.androidBigTitle);
|
||||
|
||||
@@ -232,15 +232,6 @@ void PushRequest::setStoreOffline(bool storeOffline) {
|
||||
setParameter(std::string("StoreOffline"), storeOffline ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string PushRequest::getSmsParams() const {
|
||||
return smsParams_;
|
||||
}
|
||||
|
||||
void PushRequest::setSmsParams(const std::string &smsParams) {
|
||||
smsParams_ = smsParams;
|
||||
setParameter(std::string("SmsParams"), smsParams);
|
||||
}
|
||||
|
||||
double PushRequest::getIOSRelevanceScore() const {
|
||||
return iOSRelevanceScore_;
|
||||
}
|
||||
@@ -250,6 +241,15 @@ void PushRequest::setIOSRelevanceScore(double iOSRelevanceScore) {
|
||||
setParameter(std::string("iOSRelevanceScore"), std::to_string(iOSRelevanceScore));
|
||||
}
|
||||
|
||||
std::string PushRequest::getSmsParams() const {
|
||||
return smsParams_;
|
||||
}
|
||||
|
||||
void PushRequest::setSmsParams(const std::string &smsParams) {
|
||||
smsParams_ = smsParams;
|
||||
setParameter(std::string("SmsParams"), smsParams);
|
||||
}
|
||||
|
||||
int PushRequest::getAndroidVivoPushMode() const {
|
||||
return androidVivoPushMode_;
|
||||
}
|
||||
@@ -466,6 +466,15 @@ void PushRequest::setIOSExtParameters(const std::string &iOSExtParameters) {
|
||||
setParameter(std::string("iOSExtParameters"), iOSExtParameters);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidNotificationHonorChannel() const {
|
||||
return androidNotificationHonorChannel_;
|
||||
}
|
||||
|
||||
void PushRequest::setAndroidNotificationHonorChannel(const std::string &androidNotificationHonorChannel) {
|
||||
androidNotificationHonorChannel_ = androidNotificationHonorChannel;
|
||||
setParameter(std::string("AndroidNotificationHonorChannel"), androidNotificationHonorChannel);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidXiaomiImageUrl() const {
|
||||
return androidXiaomiImageUrl_;
|
||||
}
|
||||
@@ -511,6 +520,15 @@ void PushRequest::setIOSSilentNotification(bool iOSSilentNotification) {
|
||||
setParameter(std::string("iOSSilentNotification"), iOSSilentNotification ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidNotificationGroup() const {
|
||||
return androidNotificationGroup_;
|
||||
}
|
||||
|
||||
void PushRequest::setAndroidNotificationGroup(const std::string &androidNotificationGroup) {
|
||||
androidNotificationGroup_ = androidNotificationGroup;
|
||||
setParameter(std::string("AndroidNotificationGroup"), androidNotificationGroup);
|
||||
}
|
||||
|
||||
std::string PushRequest::getSendChannels() const {
|
||||
return sendChannels_;
|
||||
}
|
||||
@@ -601,15 +619,6 @@ void PushRequest::setTargetValue(const std::string &targetValue) {
|
||||
setParameter(std::string("TargetValue"), targetValue);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidXiaoMiActivity() const {
|
||||
return androidXiaoMiActivity_;
|
||||
}
|
||||
|
||||
void PushRequest::setAndroidXiaoMiActivity(const std::string &androidXiaoMiActivity) {
|
||||
androidXiaoMiActivity_ = androidXiaoMiActivity;
|
||||
setParameter(std::string("AndroidXiaoMiActivity"), androidXiaoMiActivity);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidXiaoMiNotifyTitle() const {
|
||||
return androidXiaoMiNotifyTitle_;
|
||||
}
|
||||
@@ -619,3 +628,12 @@ void PushRequest::setAndroidXiaoMiNotifyTitle(const std::string &androidXiaoMiNo
|
||||
setParameter(std::string("AndroidXiaoMiNotifyTitle"), androidXiaoMiNotifyTitle);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidXiaoMiActivity() const {
|
||||
return androidXiaoMiActivity_;
|
||||
}
|
||||
|
||||
void PushRequest::setAndroidXiaoMiActivity(const std::string &androidXiaoMiActivity) {
|
||||
androidXiaoMiActivity_ = androidXiaoMiActivity;
|
||||
setParameter(std::string("AndroidXiaoMiActivity"), androidXiaoMiActivity);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/push/model/QueryDeviceCountRequest.h>
|
||||
|
||||
using AlibabaCloud::Push::Model::QueryDeviceCountRequest;
|
||||
|
||||
QueryDeviceCountRequest::QueryDeviceCountRequest()
|
||||
: RpcServiceRequest("push", "2016-08-01", "QueryDeviceCount") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
QueryDeviceCountRequest::~QueryDeviceCountRequest() {}
|
||||
|
||||
std::string QueryDeviceCountRequest::getAccessKeyId() const {
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setAccessKeyId(const std::string &accessKeyId) {
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter(std::string("AccessKeyId"), accessKeyId);
|
||||
}
|
||||
|
||||
std::string QueryDeviceCountRequest::getTarget() const {
|
||||
return target_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setTarget(const std::string &target) {
|
||||
target_ = target;
|
||||
setParameter(std::string("Target"), target);
|
||||
}
|
||||
|
||||
long QueryDeviceCountRequest::getAppKey() const {
|
||||
return appKey_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setAppKey(long appKey) {
|
||||
appKey_ = appKey;
|
||||
setParameter(std::string("AppKey"), std::to_string(appKey));
|
||||
}
|
||||
|
||||
std::string QueryDeviceCountRequest::getTargetValue() const {
|
||||
return targetValue_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setTargetValue(const std::string &targetValue) {
|
||||
targetValue_ = targetValue;
|
||||
setParameter(std::string("TargetValue"), targetValue);
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/push/model/QueryDeviceCountResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Push;
|
||||
using namespace AlibabaCloud::Push::Model;
|
||||
|
||||
QueryDeviceCountResult::QueryDeviceCountResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryDeviceCountResult::QueryDeviceCountResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryDeviceCountResult::~QueryDeviceCountResult()
|
||||
{}
|
||||
|
||||
void QueryDeviceCountResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["DeviceCount"].isNull())
|
||||
deviceCount_ = std::stol(value["DeviceCount"].asString());
|
||||
|
||||
}
|
||||
|
||||
long QueryDeviceCountResult::getDeviceCount()const
|
||||
{
|
||||
return deviceCount_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user