Supported AndroidNotificationHuaweiChannel for Push and MassPush.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2020-09-02 Version: 1.36.628
|
||||
- Supported AndroidNotificationHuaweiChannel for Push and MassPush.
|
||||
|
||||
2020-09-01 Version: 1.36.627
|
||||
- Add Smart Verify API.
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ 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
|
||||
@@ -118,6 +120,8 @@ 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
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
#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"
|
||||
@@ -142,6 +144,9 @@ 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;
|
||||
@@ -237,6 +242,9 @@ 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;
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace AlibabaCloud
|
||||
bool iOSMutableContent;
|
||||
int androidNotificationBarPriority;
|
||||
std::string expireTime;
|
||||
std::string androidNotificationVivoChannel;
|
||||
std::string androidPopupBody;
|
||||
std::string iOSNotificationCategory;
|
||||
std::string androidNotificationXiaomiChannel;
|
||||
|
||||
@@ -65,6 +65,8 @@ namespace AlibabaCloud
|
||||
void setAndroidNotificationBarPriority(int androidNotificationBarPriority);
|
||||
std::string getExpireTime()const;
|
||||
void setExpireTime(const std::string& expireTime);
|
||||
std::string getAndroidNotificationVivoChannel()const;
|
||||
void setAndroidNotificationVivoChannel(const std::string& androidNotificationVivoChannel);
|
||||
std::string getIOSNotificationCategory()const;
|
||||
void setIOSNotificationCategory(const std::string& iOSNotificationCategory);
|
||||
std::string getAndroidNotificationXiaomiChannel()const;
|
||||
@@ -144,6 +146,7 @@ namespace AlibabaCloud
|
||||
bool iOSMutableContent_;
|
||||
int androidNotificationBarPriority_;
|
||||
std::string expireTime_;
|
||||
std::string androidNotificationVivoChannel_;
|
||||
std::string iOSNotificationCategory_;
|
||||
std::string androidNotificationXiaomiChannel_;
|
||||
bool storeOffline_;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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 <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/push/PushExport.h>
|
||||
|
||||
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_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_PUSH_MODEL_QUERYDEVICECOUNTREQUEST_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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_
|
||||
@@ -663,6 +663,42 @@ 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();
|
||||
|
||||
@@ -69,6 +69,7 @@ void MassPushRequest::setPushTask(const std::vector<PushTask>& pushTask)
|
||||
setParameter(pushTaskObjStr + ".IOSMutableContent", pushTaskObj.iOSMutableContent ? "true" : "false");
|
||||
setParameter(pushTaskObjStr + ".AndroidNotificationBarPriority", std::to_string(pushTaskObj.androidNotificationBarPriority));
|
||||
setParameter(pushTaskObjStr + ".ExpireTime", pushTaskObj.expireTime);
|
||||
setParameter(pushTaskObjStr + ".AndroidNotificationVivoChannel", pushTaskObj.androidNotificationVivoChannel);
|
||||
setParameter(pushTaskObjStr + ".AndroidPopupBody", pushTaskObj.androidPopupBody);
|
||||
setParameter(pushTaskObjStr + ".IOSNotificationCategory", pushTaskObj.iOSNotificationCategory);
|
||||
setParameter(pushTaskObjStr + ".AndroidNotificationXiaomiChannel", pushTaskObj.androidNotificationXiaomiChannel);
|
||||
|
||||
@@ -192,6 +192,17 @@ void PushRequest::setExpireTime(const std::string& expireTime)
|
||||
setParameter("ExpireTime", expireTime);
|
||||
}
|
||||
|
||||
std::string PushRequest::getAndroidNotificationVivoChannel()const
|
||||
{
|
||||
return androidNotificationVivoChannel_;
|
||||
}
|
||||
|
||||
void PushRequest::setAndroidNotificationVivoChannel(const std::string& androidNotificationVivoChannel)
|
||||
{
|
||||
androidNotificationVivoChannel_ = androidNotificationVivoChannel;
|
||||
setParameter("AndroidNotificationVivoChannel", androidNotificationVivoChannel);
|
||||
}
|
||||
|
||||
std::string PushRequest::getIOSNotificationCategory()const
|
||||
{
|
||||
return iOSNotificationCategory_;
|
||||
|
||||
73
push/src/model/QueryDeviceCountRequest.cc
Normal file
73
push/src/model/QueryDeviceCountRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
std::string QueryDeviceCountRequest::getTarget()const
|
||||
{
|
||||
return target_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setTarget(const std::string& target)
|
||||
{
|
||||
target_ = target;
|
||||
setParameter("Target", target);
|
||||
}
|
||||
|
||||
long QueryDeviceCountRequest::getAppKey()const
|
||||
{
|
||||
return appKey_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setAppKey(long appKey)
|
||||
{
|
||||
appKey_ = appKey;
|
||||
setParameter("AppKey", std::to_string(appKey));
|
||||
}
|
||||
|
||||
std::string QueryDeviceCountRequest::getTargetValue()const
|
||||
{
|
||||
return targetValue_;
|
||||
}
|
||||
|
||||
void QueryDeviceCountRequest::setTargetValue(const std::string& targetValue)
|
||||
{
|
||||
targetValue_ = targetValue;
|
||||
setParameter("TargetValue", targetValue);
|
||||
}
|
||||
|
||||
51
push/src/model/QueryDeviceCountResult.cc
Normal file
51
push/src/model/QueryDeviceCountResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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