Skip to content

Commit 7a1f259

Browse files
authored
Merge pull request #257 from olha-danylova/master
BKNDLSS-34001
2 parents a52e13a + 4205407 commit 7a1f259

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

BackendlessSwift.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Pod::Spec.new do |s|
22
s.name = 'BackendlessSwift'
33
s.module_name = 'Backendless'
4-
s.version = '7.0.1'
5-
s.source = { :git => 'https://github.com/Backendless/Swift-SDK.git', :tag => '7.0.1' }
4+
s.version = '7.0.2'
5+
s.source = { :git => 'https://github.com/Backendless/Swift-SDK.git', :tag => '7.0.2' }
66
s.license = { :type => 'MIT', :text => 'Copyright (c) 2013-2023 by Backendless Corp' }
77
s.homepage = 'http://backendless.com'
88
s.authors = { 'Mark Piller' => '[email protected]', 'Olha Danylova' => '[email protected]' }

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# RELEASE HISTORY
22

3+
### 7.0.2 / October 4, 2023
4+
* fixed issue when publishing without PublishOptions
5+
* fixed issue with pushing broadcast
6+
* added @dynamicMemberLookup for the BackendlessUser
7+
38
### 7.0.1 / September 21, 2023
49
* fixed RT issue when user was able to subscribe only for one messaging channel
510
* some deprecated code was updated under the hood

Sources/SwiftSDK/Messaging/DeliveryOptions.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,42 @@ import Foundation
4141
case FOR_NONE = 0
4242
case FOR_IOS = 1
4343
case FOR_ANDROID = 2
44+
case FOR_IOS_ANDROID = 3
4445
case FOR_WP = 4
46+
case FOR_IOS_WP = 5
47+
case FOR_ANDROID_WP = 6
48+
case FOR_IOS_ANDROID_WP = 7
4549
case FOR_OSX = 8
50+
case FOR_IOS_OSX = 9
51+
case FOR_ANDROID_OSX = 10
52+
case FOR_IOS_ANDROID_OSX = 11
53+
case FOR_WP_OSX = 12
54+
case FOR_IOS_WP_OSX = 13
55+
case FOR_ANDROID_WP_OSX = 14
4656
case FOR_ALL = 15
57+
58+
static func from(intValue: Int) -> String {
59+
if intValue == 1 { return "FOR_IOS" }
60+
else if intValue == 2 { return "FOR_ANDROID" }
61+
else if intValue == 3 { return "FOR_IOS|FOR_ANDROID" }
62+
else if intValue == 4 { return "FOR_WP" }
63+
else if intValue == 5 { return "FOR_IOS|FOR_WP" }
64+
else if intValue == 6 { return "FOR_ANDROID|FOR_WP" }
65+
else if intValue == 7 { return "FOR_IOS|FOR_ANDROID|FOR_WP" }
66+
else if intValue == 8 { return "FOR_OSX" }
67+
else if intValue == 9 { return "FOR_IOS|FOR_OSX" }
68+
else if intValue == 10 { return "FOR_ANDROID|FOR_OSX" }
69+
else if intValue == 11 { return "FOR_IOS|FOR_ANDROID|FOR_OSX" }
70+
else if intValue == 12 { return "FOR_WP|FOR_OSX" }
71+
else if intValue == 13 { return "FOR_IOS|FOR_WP|FOR_OSX" }
72+
else if intValue == 14 { return "FOR_ANDROID|FOR_WP|FOR_OSX" }
73+
else if intValue == 15 { return "FOR_ALL" }
74+
return "FOR_NONE"
75+
}
76+
77+
public func getPushBroadcastName() -> String {
78+
return PushBroadcastEnum.from(intValue: self.rawValue)
79+
}
4780
}
4881

4982
@objcMembers public class DeliveryOptions: NSObject, Codable {

Sources/SwiftSDK/Messaging/MessagingService.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,13 @@ import Foundation
245245
parameters["repeatExpiresAt"] = DataTypesUtils.shared.dateToInt(date: repeatExpiresAt)
246246
}
247247
if let publishPolicy = deliveryOptions?.publishPolicy {
248-
parameters["publishPolicy"] = publishPolicy
248+
parameters["publishPolicy"] = PublishPolicyEnum(rawValue: publishPolicy)?.getPublishPolicyName()
249+
}
250+
else {
251+
parameters["publishPolicy"] = PublishPolicyEnum.PUBSUB.getPublishPolicyName()
249252
}
250253
if let pushBroadcast = deliveryOptions?.pushBroadcast {
251-
parameters["pushBroadcast"] = pushBroadcast
254+
parameters["pushBroadcast"] = PushBroadcastEnum(rawValue: pushBroadcast)?.getPushBroadcastName()
252255
}
253256
if let pushSinglecast = deliveryOptions?.pushSinglecast, pushSinglecast.count > 0 {
254257
parameters["pushSinglecast"] = pushSinglecast
Binary file not shown.

0 commit comments

Comments
 (0)