Supported AndroidNotificationGroup for Push and MassPush.

This commit is contained in:
sdk-team
2022-10-13 10:01:26 +00:00
parent df03038e74
commit 0ff3487fe7
12 changed files with 53 additions and 289 deletions

View File

@@ -1 +1 @@
1.36.1291
1.36.1292

View File

@@ -57,8 +57,6 @@ set(push_public_header_model
include/alibabacloud/push/model/PushNoticeToiOSResult.h
include/alibabacloud/push/model/QueryAliasesRequest.h
include/alibabacloud/push/model/QueryAliasesResult.h
include/alibabacloud/push/model/QueryDeviceCountRequest.h
include/alibabacloud/push/model/QueryDeviceCountResult.h
include/alibabacloud/push/model/QueryDeviceInfoRequest.h
include/alibabacloud/push/model/QueryDeviceInfoResult.h
include/alibabacloud/push/model/QueryDeviceStatRequest.h
@@ -124,8 +122,6 @@ set(push_src
src/model/PushNoticeToiOSResult.cc
src/model/QueryAliasesRequest.cc
src/model/QueryAliasesResult.cc
src/model/QueryDeviceCountRequest.cc
src/model/QueryDeviceCountResult.cc
src/model/QueryDeviceInfoRequest.cc
src/model/QueryDeviceInfoResult.cc
src/model/QueryDeviceStatRequest.cc

View File

@@ -58,8 +58,6 @@
#include "model/PushNoticeToiOSResult.h"
#include "model/QueryAliasesRequest.h"
#include "model/QueryAliasesResult.h"
#include "model/QueryDeviceCountRequest.h"
#include "model/QueryDeviceCountResult.h"
#include "model/QueryDeviceInfoRequest.h"
#include "model/QueryDeviceInfoResult.h"
#include "model/QueryDeviceStatRequest.h"
@@ -149,9 +147,6 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::QueryAliasesResult> QueryAliasesOutcome;
typedef std::future<QueryAliasesOutcome> QueryAliasesOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::QueryAliasesRequest&, const QueryAliasesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryAliasesAsyncHandler;
typedef Outcome<Error, Model::QueryDeviceCountResult> QueryDeviceCountOutcome;
typedef std::future<QueryDeviceCountOutcome> QueryDeviceCountOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::QueryDeviceCountRequest&, const QueryDeviceCountOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceCountAsyncHandler;
typedef Outcome<Error, Model::QueryDeviceInfoResult> QueryDeviceInfoOutcome;
typedef std::future<QueryDeviceInfoOutcome> QueryDeviceInfoOutcomeCallable;
typedef std::function<void(const PushClient*, const Model::QueryDeviceInfoRequest&, const QueryDeviceInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceInfoAsyncHandler;
@@ -250,9 +245,6 @@ namespace AlibabaCloud
QueryAliasesOutcome queryAliases(const Model::QueryAliasesRequest &request)const;
void queryAliasesAsync(const Model::QueryAliasesRequest& request, const QueryAliasesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryAliasesOutcomeCallable queryAliasesCallable(const Model::QueryAliasesRequest& request) const;
QueryDeviceCountOutcome queryDeviceCount(const Model::QueryDeviceCountRequest &request)const;
void queryDeviceCountAsync(const Model::QueryDeviceCountRequest& request, const QueryDeviceCountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryDeviceCountOutcomeCallable queryDeviceCountCallable(const Model::QueryDeviceCountRequest& request) const;
QueryDeviceInfoOutcome queryDeviceInfo(const Model::QueryDeviceInfoRequest &request)const;
void queryDeviceInfoAsync(const Model::QueryDeviceInfoRequest& request, const QueryDeviceInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryDeviceInfoOutcomeCallable queryDeviceInfoCallable(const Model::QueryDeviceInfoRequest& request) const;

View File

@@ -74,10 +74,12 @@ public:
std::string title;
std::string androidRenderStyle;
std::string iOSExtParameters;
std::string androidNotificationHonorChannel;
std::string androidXiaomiImageUrl;
std::string androidPopupBody;
std::string androidBigPictureUrl;
bool iOSSilentNotification;
std::string androidNotificationGroup;
std::string sendChannels;
std::string target;
std::string androidBigTitle;

View File

@@ -76,10 +76,10 @@ public:
void setAndroidNotificationXiaomiChannel(const std::string &androidNotificationXiaomiChannel);
bool getStoreOffline() const;
void setStoreOffline(bool storeOffline);
std::string getSmsParams() const;
void setSmsParams(const std::string &smsParams);
double getIOSRelevanceScore() const;
void setIOSRelevanceScore(double iOSRelevanceScore);
std::string getSmsParams() const;
void setSmsParams(const std::string &smsParams);
int getAndroidVivoPushMode() const;
void setAndroidVivoPushMode(int androidVivoPushMode);
std::string getAndroidInboxBody() const;
@@ -128,6 +128,8 @@ public:
void setAndroidRenderStyle(int androidRenderStyle);
std::string getIOSExtParameters() const;
void setIOSExtParameters(const std::string &iOSExtParameters);
std::string getAndroidNotificationHonorChannel() const;
void setAndroidNotificationHonorChannel(const std::string &androidNotificationHonorChannel);
std::string getAndroidXiaomiImageUrl() const;
void setAndroidXiaomiImageUrl(const std::string &androidXiaomiImageUrl);
std::string getSmsTemplateName() const;
@@ -138,6 +140,8 @@ public:
void setAndroidBigPictureUrl(const std::string &androidBigPictureUrl);
bool getIOSSilentNotification() const;
void setIOSSilentNotification(bool iOSSilentNotification);
std::string getAndroidNotificationGroup() const;
void setAndroidNotificationGroup(const std::string &androidNotificationGroup);
std::string getSendChannels() const;
void setSendChannels(const std::string &sendChannels);
std::string getTarget() const;
@@ -158,10 +162,10 @@ public:
void setAppKey(long appKey);
std::string getTargetValue() const;
void setTargetValue(const std::string &targetValue);
std::string getAndroidXiaoMiActivity() const;
void setAndroidXiaoMiActivity(const std::string &androidXiaoMiActivity);
std::string getAndroidXiaoMiNotifyTitle() const;
void setAndroidXiaoMiNotifyTitle(const std::string &androidXiaoMiNotifyTitle);
std::string getAndroidXiaoMiActivity() const;
void setAndroidXiaoMiActivity(const std::string &androidXiaoMiActivity);
private:
int androidNotificationBarType_;
@@ -187,8 +191,8 @@ private:
std::string iOSNotificationCategory_;
std::string androidNotificationXiaomiChannel_;
bool storeOffline_;
std::string smsParams_;
double iOSRelevanceScore_;
std::string smsParams_;
int androidVivoPushMode_;
std::string androidInboxBody_;
std::string jobKey_;
@@ -213,11 +217,13 @@ private:
int smsDelaySecs_;
int androidRenderStyle_;
std::string iOSExtParameters_;
std::string androidNotificationHonorChannel_;
std::string androidXiaomiImageUrl_;
std::string smsTemplateName_;
std::string androidPopupBody_;
std::string androidBigPictureUrl_;
bool iOSSilentNotification_;
std::string androidNotificationGroup_;
std::string sendChannels_;
std::string target_;
std::string androidBigTitle_;
@@ -228,8 +234,8 @@ private:
int androidNotificationNotifyId_;
long appKey_;
std::string targetValue_;
std::string androidXiaoMiActivity_;
std::string androidXiaoMiNotifyTitle_;
std::string androidXiaoMiActivity_;
};
} // namespace Model
} // namespace Push

View File

@@ -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.
*/
#ifndef ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTREQUEST_H_
#define ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTREQUEST_H_
#include <alibabacloud/push/PushExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Push {
namespace Model {
class ALIBABACLOUD_PUSH_EXPORT QueryDeviceCountRequest : public RpcServiceRequest {
public:
QueryDeviceCountRequest();
~QueryDeviceCountRequest();
std::string getAccessKeyId() const;
void setAccessKeyId(const std::string &accessKeyId);
std::string getTarget() const;
void setTarget(const std::string &target);
long getAppKey() const;
void setAppKey(long appKey);
std::string getTargetValue() const;
void setTargetValue(const std::string &targetValue);
private:
std::string accessKeyId_;
std::string target_;
long appKey_;
std::string targetValue_;
};
} // namespace Model
} // namespace Push
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTREQUEST_H_

View File

@@ -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.
*/
#ifndef ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTRESULT_H_
#define ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/push/PushExport.h>
namespace AlibabaCloud
{
namespace Push
{
namespace Model
{
class ALIBABACLOUD_PUSH_EXPORT QueryDeviceCountResult : public ServiceResult
{
public:
QueryDeviceCountResult();
explicit QueryDeviceCountResult(const std::string &payload);
~QueryDeviceCountResult();
long getDeviceCount()const;
protected:
void parse(const std::string &payload);
private:
long deviceCount_;
};
}
}
}
#endif // !ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTRESULT_H_

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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_;
}