Skip to content

Commit

Permalink
chore(release): pulling release/1.16.0 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Pallab Maiti authored Jun 8, 2023
2 parents 8635d23 + 90b90ac commit c4c9b48
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env:
HUSKY: 0
run: |
npm i -g conventional-changelog-cli
npm i -g conventional-changelog-cli@2.2.2
SUMMARY=$(((npx conventional-changelog -u) 2>&1) | sed "s/*/<br> */g" | sed "s/#/ /g" | tr -d '\n' || true)
echo $SUMMARY
echo "Current version: $CURRENT_VERSION_VALUE"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env:
HUSKY: 0
run: |
npm i -g conventional-changelog-cli
npm i -g conventional-changelog-cli@2.2.2
SUMMARY=$(((npx conventional-changelog -u) 2>&1) | sed "s/*/<br> */g" | sed "s/#/ /g" | tr -d '\n' || true)
echo $SUMMARY
echo "Current version: $CURRENT_VERSION_VALUE"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slack-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Send message to Slack channel
id: slack
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.24.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'iOS SDK'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.16.0](https://github.com/rudderlabs/rudder-sdk-ios/compare/v1.15.1...v1.16.0) (2023-06-08)


### Features

* added support for gzip ([#325](https://github.com/rudderlabs/rudder-sdk-ios/issues/325)) ([2e1fba0](https://github.com/rudderlabs/rudder-sdk-ios/commit/2e1fba097b7f288047b5593fe2da4244dbf45ea6))

### [1.15.1](https://github.com/rudderlabs/rudder-sdk-ios/compare/v1.15.0...v1.15.1) (2023-05-12)


Expand Down
42 changes: 21 additions & 21 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PODS:
- Amplitude (7.2.2)
- Appboy-iOS-SDK (4.4.2):
- Appboy-iOS-SDK/UI (= 4.4.2)
- Appboy-iOS-SDK/ContentCards (4.4.2):
- Appboy-iOS-SDK (4.5.4):
- Appboy-iOS-SDK/UI (= 4.5.4)
- Appboy-iOS-SDK/ContentCards (4.5.4):
- Appboy-iOS-SDK/Core
- SDWebImage (< 6, >= 5.8.2)
- Appboy-iOS-SDK/Core (4.4.2)
- Appboy-iOS-SDK/InAppMessage (4.4.2):
- Appboy-iOS-SDK/Core (4.5.4)
- Appboy-iOS-SDK/InAppMessage (4.5.4):
- Appboy-iOS-SDK/Core
- SDWebImage (< 6, >= 5.8.2)
- Appboy-iOS-SDK/NewsFeed (4.4.2):
- Appboy-iOS-SDK/NewsFeed (4.5.4):
- Appboy-iOS-SDK/Core
- SDWebImage (< 6, >= 5.8.2)
- Appboy-iOS-SDK/UI (4.4.2):
- Appboy-iOS-SDK/UI (4.5.4):
- Appboy-iOS-SDK/ContentCards
- Appboy-iOS-SDK/Core
- Appboy-iOS-SDK/InAppMessage
Expand Down Expand Up @@ -43,7 +43,7 @@ PODS:
- GoogleUtilities/Reachability (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- GoogleDataTransport (9.2.2):
- GoogleDataTransport (9.2.3):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
Expand All @@ -70,16 +70,16 @@ PODS:
- nanopb/decode (2.30909.0)
- nanopb/encode (2.30909.0)
- PromisesObjC (2.2.0)
- Rudder (1.13.2)
- Rudder (1.15.1)
- Rudder-Amplitude (1.0.2):
- Amplitude (~> 7.2.0)
- Rudder
- Rudder-Braze (1.1.1):
- Appboy-iOS-SDK (= 4.4.2)
- Rudder (~> 1.0)
- SDWebImage (5.15.5):
- SDWebImage/Core (= 5.15.5)
- SDWebImage/Core (5.15.5)
- Rudder-Braze (1.2.0):
- Appboy-iOS-SDK (~> 4.5.4)
- Rudder (~> 1.12)
- SDWebImage (5.15.8):
- SDWebImage/Core (= 5.15.8)
- SDWebImage/Core (5.15.8)

DEPENDENCIES:
- Amplitude (~> 7.2.0)
Expand Down Expand Up @@ -111,21 +111,21 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Amplitude: 517cdc7c485bda64b685174426ecbf17746eb16a
Appboy-iOS-SDK: 4a7dfe908639da81e5e85849355f6066b58b4cc6
Appboy-iOS-SDK: 2fc5b290fe1caa85718b811a19b303d45caea975
FirebaseCore: 2082fffcd855f95f883c0a1641133eb9bbe76d40
FirebaseCoreDiagnostics: 99a495094b10a57eeb3ae8efa1665700ad0bdaa6
FirebaseCoreInternal: bca76517fe1ed381e989f5e7d8abb0da8d85bed3
FirebaseInstallations: 0a115432c4e223c5ab20b0dbbe4cbefa793a0e8e
FirebaseMessaging: a4d7910e4af663c9cbfc1071c5bef34651690949
GoogleDataTransport: 8378d1fa8ac49753ea6ce70d65a7cb70ce5f66e6
GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
Rudder: 1353907b7323389ad213f3ef0a30969261f67773
Rudder: 41040d4537a178e4e32477b68400f98ca0c354eb
Rudder-Amplitude: f845cc125a1a58d4de6155391a2b0392815ae898
Rudder-Braze: e8b8c76b7e7f0348c79f8cc359e43f4c6cd7ac9b
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
Rudder-Braze: e42eb914a03cb418ed8b7a3cd90b724a91476631
SDWebImage: cb032eba469c54e0000e78bcb0a13cdde0a52798

PODFILE CHECKSUM: 42bfa6ba9271b8d9518a669daca1fd9a7bbf9f6e

COCOAPODS: 1.12.0
COCOAPODS: 1.12.1
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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:
Expand All @@ -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)

Expand Down Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions Rudder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
ED38D39D29CB04C7003A7544 /* EventRepositoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED38D36E29CB01A0003A7544 /* EventRepositoryTests.swift */; };
ED38D39E29CB04C7003A7544 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED38D37D29CB01A0003A7544 /* TestUtils.swift */; };
ED38D39F29CB04C7003A7544 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED38D37029CB01A0003A7544 /* Extensions.swift */; };
ED3CC19F2A14A78200F34082 /* NSData+GZIP.h in Headers */ = {isa = PBXBuildFile; fileRef = ED3CC19D2A14A78200F34082 /* NSData+GZIP.h */; settings = {ATTRIBUTES = (Public, ); }; };
ED3CC1A02A14A78200F34082 /* NSData+GZIP.m in Sources */ = {isa = PBXBuildFile; fileRef = ED3CC19E2A14A78200F34082 /* NSData+GZIP.m */; };
ED7DFE38298C091800ED5A8E /* RSServerConfigSource.m in Sources */ = {isa = PBXBuildFile; fileRef = ED7DFD85298C091800ED5A8E /* RSServerConfigSource.m */; };
ED7DFE39298C091800ED5A8E /* RSTraits.m in Sources */ = {isa = PBXBuildFile; fileRef = ED7DFD86298C091800ED5A8E /* RSTraits.m */; };
ED7DFE3A298C091800ED5A8E /* RSLibraryInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = ED7DFD87298C091800ED5A8E /* RSLibraryInfo.m */; };
Expand Down Expand Up @@ -250,6 +252,8 @@
ED38D37129CB01A0003A7544 /* RudderUtilsTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RudderUtilsTest.swift; sourceTree = "<group>"; };
ED38D37C29CB01A0003A7544 /* ServerConfigManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerConfigManagerTests.swift; sourceTree = "<group>"; };
ED38D37D29CB01A0003A7544 /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = "<group>"; };
ED3CC19D2A14A78200F34082 /* NSData+GZIP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSData+GZIP.h"; sourceTree = "<group>"; };
ED3CC19E2A14A78200F34082 /* NSData+GZIP.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSData+GZIP.m"; sourceTree = "<group>"; };
ED7DFD85298C091800ED5A8E /* RSServerConfigSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSServerConfigSource.m; sourceTree = "<group>"; };
ED7DFD86298C091800ED5A8E /* RSTraits.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSTraits.m; sourceTree = "<group>"; };
ED7DFD87298C091800ED5A8E /* RSLibraryInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSLibraryInfo.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -556,6 +560,7 @@
children = (
ED7DFDD0298C091800ED5A8E /* Ecomm */,
EDA2C5B129C0EB9500B7FF42 /* Headers */,
ED3CC19E2A14A78200F34082 /* NSData+GZIP.m */,
ED7DFD8B298C091800ED5A8E /* RSApp.m */,
F6B4B53729C8237D00344864 /* RSApplicationLifeCycleManager.m */,
F6B4B53529C8237D00344864 /* RSBackGroundModeManager.m */,
Expand Down Expand Up @@ -610,6 +615,7 @@
isa = PBXGroup;
children = (
EDEC3CD829ADC9CF007DDE07 /* Ecomm */,
ED3CC19D2A14A78200F34082 /* NSData+GZIP.h */,
ED7DFDB1298C091800ED5A8E /* RSApp.h */,
F6B4B52529C8236100344864 /* RSApplicationLifeCycleManager.h */,
F6B4B51E29C8236100344864 /* RSBackGroundModeManager.h */,
Expand Down Expand Up @@ -946,6 +952,7 @@
F6B4B53029C8236100344864 /* RSDeviceModeTransformationManager.h in Headers */,
ED7DFED7298C091800ED5A8E /* RSProductRemovedFromWishListEvent.h in Headers */,
F6B4B52729C8236100344864 /* RSCloudModeManager.h in Headers */,
ED3CC19F2A14A78200F34082 /* NSData+GZIP.h in Headers */,
F6B4B52D29C8236100344864 /* RSDataResidencyManager.h in Headers */,
ED7DFE90298C091800ED5A8E /* RSECommerceCheckout.h in Headers */,
F6B4B52A29C8236100344864 /* RSDeviceModeManager.h in Headers */,
Expand Down Expand Up @@ -1158,6 +1165,7 @@
ED7DFE4C298C091800ED5A8E /* RSMessageType.m in Sources */,
ED7DFEAA298C091800ED5A8E /* RSProductAddedToWishListEvent.m in Sources */,
ED7DFED1298C091800ED5A8E /* RSProductViewedEvent.m in Sources */,
ED3CC1A02A14A78200F34082 /* NSData+GZIP.m in Sources */,
ED7DFE41298C091800ED5A8E /* RSEventFilteringPlugin.m in Sources */,
F6B4B54029C8237D00344864 /* RSApplicationLifeCycleManager.m in Sources */,
ED7DFEAB298C091800ED5A8E /* RSProductSearchedEvent.m in Sources */,
Expand Down
18 changes: 18 additions & 0 deletions Sources/Classes/Headers/Public/NSData+GZIP.h
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
1 change: 1 addition & 0 deletions Sources/Classes/Headers/Public/RSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readwrite) NSMutableArray* factories;
@property (nonatomic, readwrite) NSMutableArray* customFactories;
@property (nonatomic, readwrite, nullable) id<RSConsentFilter> consentFilter;
@property (nonatomic) bool gzip;

@end

Expand Down
1 change: 1 addition & 0 deletions Sources/Classes/Headers/Public/RSConfigBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)withFactory:(id <RSIntegrationFactory> _Nonnull)factory;
- (instancetype)withCustomFactory:(id <RSIntegrationFactory> _Nonnull)customFactory;
- (instancetype)withConsentFilter:(id <RSConsentFilter> _Nonnull)consentFilter;
- (instancetype)withGzip:(BOOL)status;
- (RSConfig*)build;

@end
Expand Down
2 changes: 2 additions & 0 deletions Sources/Classes/Headers/Public/RSConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ extern bool const RSRecordScreenViews;
extern bool const RSEnableBackgroundMode;
// default for automatic session tracking
extern bool const RSAutomaticSessionTracking;
// default for gzip request payload
extern bool const RSGzipStatus;
// SDK Version
extern NSString *const RS_VERSION;
// constant used to check if event filtering is disabled
Expand Down
2 changes: 1 addition & 1 deletion Sources/Classes/Headers/RSVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#ifndef RSVersion_h
#define RSVersion_h

NSString *const SDK_VERSION = @"1.15.1";
NSString *const SDK_VERSION = @"1.16.0";

#endif /* RSVersion_h */
94 changes: 94 additions & 0 deletions Sources/Classes/NSData+GZIP.m
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
4 changes: 2 additions & 2 deletions Sources/Classes/RSApplicationLifeCycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import "RSApplicationLifeCycleManager.h"
#import <Rudder/UIViewController+RSScreen.h>
#import <Rudder/WKInterfaceController+RSScreen.h>
#import "UIViewController+RSScreen.h"
#import "WKInterfaceController+RSScreen.h"

@implementation RSApplicationLifeCycleManager

Expand Down
1 change: 1 addition & 0 deletions Sources/Classes/RSConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ - (instancetype)init {
_controlPlaneUrl = RSControlPlaneUrl;
_factories = [[NSMutableArray alloc] init];
_customFactories = [[NSMutableArray alloc] init];
_gzip = RSGzipStatus;
}
return self;
}
Expand Down
Loading

0 comments on commit c4c9b48

Please sign in to comment.