Skip to content

Commit 9e96826

Browse files
author
Olha Danylova
authored
Merge pull request #239 from olgadanylova/master
fixed device registration for iOS 13
2 parents 4c30fc2 + 8bffb51 commit 9e96826

21 files changed

+39
-56
lines changed

CHANGELOG.md

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

3+
## 5.5.0 October 8, 2019
4+
* fixed the device registration for iOS 13 and above
5+
36
## 5.4.1 August 19, 2019
47
* added the blUserLocale property (two character code) to the BackendlessUser object
58
* added methods to UserService:

Pods/Backendless.podspec

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ DEPENDENCIES:
77
- Socket.IO-Client-Swift
88

99
SPEC REPOS:
10-
https://github.com/cocoapods/specs.git:
10+
https://github.com/CocoaPods/Specs.git:
1111
- Socket.IO-Client-Swift
1212
- Starscream
1313

1414
SPEC CHECKSUMS:
1515
Socket.IO-Client-Swift: 7cb44c0ffb86e158cee32d0642d30ec5fdcf8f61
1616
Starscream: 08172b481e145289c4930cb567230fb55897cfa4
1717

18-
PODFILE CHECKSUM: 675cc991d5f2f8cb6bcd0ce2d67444ed1b8f2a74
18+
PODFILE CHECKSUM: 5cd4b8ef98be7dc5a7082de9b679e21d33e284c4
1919

20-
COCOAPODS: 1.7.4
20+
COCOAPODS: 1.8.1

SDK/backendless.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
<dict>
55
<key>BuildSystemType</key>
66
<string>Original</string>
7+
<key>PreviewsEnabled</key>
8+
<false/>
79
</dict>
810
</plist>

SDK/backendlessAPI/Classes/Messaging/MessagingService.m

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,24 @@ -(DeviceRegistration *)currentDevice {
153153
}
154154

155155
-(NSString *)deviceTokenAsString:(NSData *)token {
156-
NSString *str = [NSString stringWithFormat:@"%@", token];
157-
return [[[str stringByReplacingOccurrencesOfString:@" " withString:@""] stringByReplacingOccurrencesOfString:@"<" withString:@""] stringByReplacingOccurrencesOfString:@">" withString:@""];
156+
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
157+
NSInteger majorVersion = version.majorVersion;
158+
if (majorVersion >= 13) {
159+
NSUInteger length = token.length;
160+
if (length == 0) {
161+
return nil;
162+
}
163+
const unsigned char *buffer = token.bytes;
164+
NSMutableString *hexString = [NSMutableString stringWithCapacity:(length * 2)];
165+
for (int i = 0; i < length; ++i) {
166+
[hexString appendFormat:@"%02x", buffer[i]];
167+
}
168+
return [hexString copy];
169+
}
170+
else {
171+
NSString *str = [NSString stringWithFormat:@"%@", token];
172+
return [[[str stringByReplacingOccurrencesOfString:@" " withString:@""] stringByReplacingOccurrencesOfString:@"<" withString:@""] stringByReplacingOccurrencesOfString:@">" withString:@""];
173+
}
158174
}
159175

160176
// Channel

SDK/backendlessAPI/backendlessAPI.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8677,7 +8677,7 @@
86778677
F9042AFA15FDD8D300C9381A /* Project object */ = {
86788678
isa = PBXProject;
86798679
attributes = {
8680-
LastUpgradeCheck = 1020;
8680+
LastUpgradeCheck = 1100;
86818681
ORGANIZATIONNAME = BACKENDLESS.COM;
86828682
TargetAttributes = {
86838683
5A06BCDE20D1109F00E0315F = {

SDK/backendlessAPI/backendlessAPI.xcodeproj/xcshareddata/xcschemes/backendless-device.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Release"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:backendlessAPI.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

SDK/backendlessAPI/backendlessAPI.xcodeproj/xcshareddata/xcschemes/backendless-fat.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Release"

SDK/backendlessAPI/backendlessAPI.xcodeproj/xcshareddata/xcschemes/backendless-mac.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Release"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:backendlessAPI.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

SDK/backendlessAPI/backendlessAPI.xcodeproj/xcshareddata/xcschemes/backendless-simulator.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Release"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:backendlessAPI.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

0 commit comments

Comments
 (0)