Skip to content

Commit

Permalink
Merge pull request #543 from zapcannon87/master
Browse files Browse the repository at this point in the history
Release v11.5.0
  • Loading branch information
zapcannon87 authored Jan 29, 2019
2 parents 4fe2512 + f32a314 commit 4bd7203
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions AVOS/AVOSCloud/Push/AVPush.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ extern NSString *const kAVPushTargetPlatformWindowsPhone;
*/
+ (void)setProductionMode:(BOOL)isProduction;

/**
Default is false, if set true, AVPush will remove 'prod' Key-Value.
@param isIgnoreProd trigger.
*/
+ (void)setIgnoreProdParameterEnabled:(BOOL)isIgnoreProd;

/*! @name Configuring a Push Notification */

/*!
Expand Down
11 changes: 9 additions & 2 deletions AVOS/AVOSCloud/Push/AVPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

static BOOL _isProduction = YES;
static BOOL _isIgnoreProd = false;

NSString *const kAVPushTargetPlatformIOS = @"ios";
NSString *const kAVPushTargetPlatformAndroid = @"android";
Expand Down Expand Up @@ -154,6 +155,10 @@ + (void)setProductionMode:(BOOL)isProduction {
_isProduction = isProduction;
}

+ (void)setIgnoreProdParameterEnabled:(BOOL)isIgnoreProd {
_isIgnoreProd = isIgnoreProd;
}

+ (BOOL)sendPushMessage:(AVPush *)push
wait:(BOOL)wait
block:(AVBooleanResultBlock)block
Expand Down Expand Up @@ -291,7 +296,9 @@ -(NSMutableDictionary *)postData
if (!_isProduction) {
prod = @"dev";
}
[data setObject:prod forKey:@"prod"];
if (!_isIgnoreProd) {
[data setObject:prod forKey:@"prod"];
}
if (self.pushQuery)
{
[data addEntriesFromDictionary:[self queryData]];
Expand Down Expand Up @@ -333,7 +340,7 @@ - (void)sendPushInBackgroundWithBlock:(AVBooleanResultBlock)block
NSString *path = [AVPush myObjectPath];
[[AVPaasClient sharedInstance] postObject:path
withParameters:[self postData]
eventually:YES
eventually:false
block:^(id object, NSError *error) {
[AVUtils callBooleanResultBlock:block error:error];
}];
Expand Down
2 changes: 1 addition & 1 deletion AVOS/AVOSCloud/UserAgent.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define SDK_VERSION @"v11.4.9"
#define SDK_VERSION @"v11.5.0"
2 changes: 1 addition & 1 deletion AVOSCloud.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloud'
s.version = '11.4.9'
s.version = '11.5.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down
2 changes: 1 addition & 1 deletion AVOSCloudIM.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloudIM'
s.version = '11.4.9'
s.version = '11.5.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud IM Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down
2 changes: 1 addition & 1 deletion AVOSCloudLiveQuery.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVOSCloudLiveQuery'
s.version = '11.4.9'
s.version = '11.5.0'
s.homepage = 'https://leancloud.cn/'
s.summary = 'LeanCloud LiveQuery Objective-C SDK'
s.authors = 'LeanCloud'
Expand Down

0 comments on commit 4bd7203

Please sign in to comment.