-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): pulling release/1.16.0 into master
- Loading branch information
Showing
20 changed files
with
180 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
<p align="center"> | ||
<a href="https://cocoapods.org/pods/Rudder"> | ||
<img src="https://img.shields.io/static/v1?label=pod&message=v1.15.1&color=blue&style=flat"> | ||
<img src="https://img.shields.io/static/v1?label=pod&message=v1.16.0&color=blue&style=flat"> | ||
</a> | ||
</p> | ||
|
||
|
@@ -39,15 +39,15 @@ The iOS SDK is available through [**CocoaPods**](https://cocoapods.org), [**Cart | |
To install the SDK, simply add the following line to your Podfile: | ||
|
||
```xcode | ||
pod 'Rudder', '1.15.1' | ||
pod 'Rudder', '1.16.0' | ||
``` | ||
|
||
### Carthage | ||
|
||
For Carthage support, add the following line to your `Cartfile`: | ||
|
||
```xcode | ||
github "rudderlabs/rudder-sdk-ios" "v1.15.1" | ||
github "rudderlabs/rudder-sdk-ios" "v1.16.0" | ||
``` | ||
|
||
> Remember to include the following code in all `.m` and `.h` files where you want to refer to or use the RudderStack SDK classes, as shown: | ||
|
@@ -71,7 +71,7 @@ You can also add the RudderStack iOS SDK via Swift Package Mangaer, via one of t | |
|
||
* Enter the package repository (`[email protected]:rudderlabs/rudder-sdk-ios.git`) in the search bar. | ||
|
||
* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.15.1` as the value, as shown: | ||
* In **Dependency Rule**, select **Up to Next Major Version** and enter `1.16.0` as the value, as shown: | ||
|
||
![Setting dependency](https://user-images.githubusercontent.com/59817155/145574696-8c849749-13e0-40d5-aacb-3fccb5c8e67d.png) | ||
|
||
|
@@ -99,7 +99,7 @@ let package = Package( | |
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
.package(url: "[email protected]:rudderlabs/rudder-sdk-ios.git", from: "1.15.1") | ||
.package(url: "[email protected]:rudderlabs/rudder-sdk-ios.git", from: "1.16.0") | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// NSData+GZIP.h | ||
// Rudder | ||
// | ||
// Created by Pallab Maiti on 17/05/23. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
|
||
@interface NSData (GZIP) | ||
|
||
- (nullable NSData *)gzippedDataWithCompressionLevel:(float)level; | ||
- (nullable NSData *)gzippedData; | ||
- (nullable NSData *)gunzippedData; | ||
- (BOOL)isGzippedData; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// | ||
// NSData+GZIP.m | ||
// Rudder | ||
// | ||
// Created by Pallab Maiti on 17/05/23. | ||
// | ||
|
||
#import "NSData+GZIP.h" | ||
#import <zlib.h> | ||
|
||
|
||
#pragma clang diagnostic ignored "-Wcast-qual" | ||
|
||
|
||
@implementation NSData (GZIP) | ||
|
||
- (NSData *)gzippedDataWithCompressionLevel:(float)level { | ||
if (self.length == 0 || [self isGzippedData]) { | ||
return self; | ||
} | ||
|
||
z_stream stream; | ||
stream.zalloc = Z_NULL; | ||
stream.zfree = Z_NULL; | ||
stream.opaque = Z_NULL; | ||
stream.avail_in = (uint)self.length; | ||
stream.next_in = (Bytef *)(void *)self.bytes; | ||
stream.total_out = 0; | ||
stream.avail_out = 0; | ||
|
||
static const NSUInteger ChunkSize = 16384; | ||
|
||
NSMutableData *output = nil; | ||
int compression = (level < 0.0f)? Z_DEFAULT_COMPRESSION: (int)(roundf(level * 9)); | ||
if (deflateInit2(&stream, compression, Z_DEFLATED, 31, 8, Z_DEFAULT_STRATEGY) == Z_OK) { | ||
output = [NSMutableData dataWithLength:ChunkSize]; | ||
while (stream.avail_out == 0) { | ||
if (stream.total_out >= output.length) { | ||
output.length += ChunkSize; | ||
} | ||
stream.next_out = (uint8_t *)output.mutableBytes + stream.total_out; | ||
stream.avail_out = (uInt)(output.length - stream.total_out); | ||
deflate(&stream, Z_FINISH); | ||
} | ||
deflateEnd(&stream); | ||
output.length = stream.total_out; | ||
} | ||
|
||
return output; | ||
} | ||
|
||
- (NSData *)gzippedData { | ||
return [self gzippedDataWithCompressionLevel:-1.0f]; | ||
} | ||
|
||
- (NSData *)gunzippedData { | ||
if (self.length == 0 || ![self isGzippedData]) { | ||
return self; | ||
} | ||
|
||
z_stream stream; | ||
stream.zalloc = Z_NULL; | ||
stream.zfree = Z_NULL; | ||
stream.avail_in = (uint)self.length; | ||
stream.next_in = (Bytef *)self.bytes; | ||
stream.total_out = 0; | ||
stream.avail_out = 0; | ||
|
||
NSMutableData *output = nil; | ||
if (inflateInit2(&stream, 47) == Z_OK) { | ||
int status = Z_OK; | ||
output = [NSMutableData dataWithCapacity:self.length * 2]; | ||
while (status == Z_OK) { | ||
if (stream.total_out >= output.length) { | ||
output.length += self.length / 2; | ||
} | ||
stream.next_out = (uint8_t *)output.mutableBytes + stream.total_out; | ||
stream.avail_out = (uInt)(output.length - stream.total_out); | ||
status = inflate (&stream, Z_SYNC_FLUSH); | ||
} | ||
if (inflateEnd(&stream) == Z_OK && status == Z_STREAM_END) { | ||
output.length = stream.total_out; | ||
} | ||
} | ||
|
||
return output; | ||
} | ||
|
||
- (BOOL)isGzippedData { | ||
const UInt8 *bytes = (const UInt8 *)self.bytes; | ||
return (self.length >= 2 && bytes[0] == 0x1f && bytes[1] == 0x8b); | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.