Skip to content

Commit

Permalink
Release/5.0.0 (#511)
Browse files Browse the repository at this point in the history
* update locations podspec

* Update min location dependency version

* Minimize warnings

* update version

* update spm

Co-authored-by: leanplum-e2 <e2@leanplum.com>
  • Loading branch information
nzagorchev and leanplum-e2 authored Aug 12, 2022
1 parent ddbc900 commit c3d7469
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Leanplum-iOS-Location.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Pod::Spec.new do |s|
s.source_files = 'LeanplumSDKLocation/LeanplumSDKLocation/Classes/**/*'
s.frameworks = 'CoreLocation'
s.documentation_url = 'https://docs.leanplum.com/'
s.dependency 'Leanplum-iOS-SDK'
s.dependency 'Leanplum-iOS-SDK', "~> 5.0.0"
s.module_name = 'LeanplumLocation'
s.swift_versions = '5.0'
end
3 changes: 2 additions & 1 deletion Leanplum-iOS-LocationAndBeacons.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Pod::Spec.new do |s|
s.source_files = 'LeanplumSDKLocation/LeanplumSDKLocation/Classes/**/*'
s.frameworks = 'CoreLocation'
s.documentation_url = 'https://docs.leanplum.com/'
s.dependency 'Leanplum-iOS-SDK'
s.dependency 'Leanplum-iOS-SDK', "~> 5.0.0"
s.module_name = 'LeanplumLocationAndBeacons'
s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'LP_BEACON=1' }
s.swift_versions = '5.0'
end
2 changes: 1 addition & 1 deletion LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define IS_NOOP (IS_JAILBROKEN || [LPConstantsState sharedState].isTestMode || [LPConstantsState sharedState].isInPermanentFailureState)
#define RETURN_IF_NOOP if (IS_NOOP) return

#define LEANPLUM_SDK_VERSION @"4.1.0"
#define LEANPLUM_SDK_VERSION @"5.0.0"
#define LEANPLUM_CLIENT @"ios"
#define LEANPLUM_SUPPORTED_ENCODING @"gzip"

Expand Down
18 changes: 9 additions & 9 deletions LeanplumSDK/LeanplumSDK/Classes/Utilities/LPUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@
/**
* Checks if the object is null or empty.
*/
+ (BOOL)isNullOrEmpty:(id)obj;
+ (BOOL)isNullOrEmpty:(id _Nullable)obj;

/**
* Checks if the string is empty or have spaces.
*/
+ (BOOL)isBlank:(id)obj;
+ (BOOL)isBlank:(id _Nullable)obj;

/**
* Computes MD5 of NSData. Mostly used for uploading images.
*/
+ (NSString *)md5OfData:(NSData *)data;
+ (NSString * _Nonnull)md5OfData:(NSData * _Nullable)data;

/**
* Returns base64 encoded string from NSData. Convenience method
* that supports iOS6.
*/
+ (NSString *)base64EncodedStringFromData:(NSData *)data;
+ (NSString * _Nonnull)base64EncodedStringFromData:(NSData * _Nonnull)data;

/**
* Initialize exception handling
Expand All @@ -55,7 +55,7 @@
/**
* Report an exception
*/
+ (void)handleException:(NSException *)exception;
+ (void)handleException:(NSException * _Nonnull)exception;

/**
* Whether swizzling flag is setup in plist file
Expand All @@ -65,21 +65,21 @@
/**
* Returns Leanplum bundle
*/
+ (NSBundle *)leanplumBundle;
+ (NSBundle * _Nullable)leanplumBundle;

/**
* Open URLs from SDK
*/
+ (void)openURL:(NSURL *)url;
+ (void)openURL:(NSURL * _Nonnull)url;

/**
* Open URLs from SDK and calls the completionHandler
*/
+ (void)openURL:(NSURL *)url completionHandler:(void (^ __nullable)(BOOL success))completion;
+ (void)openURL:(NSURL * _Nonnull)url completionHandler:(void (^ __nullable)(BOOL success))completion;

/**
* Checks if given value is a NSNumber with bool value
*/
+ (BOOL)isBoolNumber:(NSNumber *)value;
+ (BOOL)isBoolNumber:(NSNumber * _Nonnull)value;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#import <Leanplum/LPRequestFactory.h>
#import <Leanplum/Leanplum-Swift.h>

NS_ASSUME_NONNULL_BEGIN

@interface Leanplum(UnitTest)

@property (class, readonly) User* _Nonnull user;
Expand All @@ -48,23 +50,25 @@

@end

NS_ASSUME_NONNULL_END

@interface LPActionContext(UnitTest)

+ (LPActionContext *)actionContextWithName:(NSString *)name
args:(NSDictionary *)args
messageId:(NSString *)messageId;
+ (nullable LPActionContext *)actionContextWithName:(nonnull NSString *)name
args:(nullable NSDictionary *)args
messageId:(nullable NSString *)messageId;

-(NSString *)htmlStringContentsOfFile:(NSString *)file;
-(nullable NSString *)htmlStringContentsOfFile:(nonnull NSString *)file;

@end

@interface LPRequestFactory(UnitTest)
+ (LPRequest *)createGetForApiMethod:(NSString *)apiMethod params:(nullable NSDictionary *)params;
+ (nullable LPRequest *)createGetForApiMethod:(nonnull NSString *)apiMethod params:(nullable NSDictionary *)params;
+ (nullable LPRequest *)createPostForApiMethod:(nonnull NSString *)apiMethod params:(nullable NSDictionary *)params;
@end

@interface LPLogManager(UnitTest)
+ (void)maybeSendLog:(NSString *)message;
+ (void)maybeSendLog:(nonnull NSString *)message;
@end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ - (void)tearDown {
[super tearDown];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
- (void)test_event_callback
{
// Test invoke methods.
Expand Down Expand Up @@ -164,5 +166,6 @@ - (void)test_event_callback_manager
[self waitForExpectations:@[response3Expectation] timeout:2];
XCTAssertTrue(eventCallbackMap.count == 0);
}
#pragma clang diagnostic pop

@end
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ extern NSInteger DISPATCH_WAIT_TIME;
/// retrieve data from a file
+ (NSData *)retrieve_data_from_file:(NSString *)file ofType:(NSString *)type;

+ (void)dismissPresentedViewControllers;

+ (void)mockThrowErrorToThrow;

+ (void)stopMockThrowErrorToThrow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ + (void)clean_up {
[[LPConstantsState sharedState] setIsInPermanentFailureState:NO];

// Reset values directly
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"
[ApiConfig shared].appId = nil;
[ApiConfig shared].accessKey = nil;
#pragma clang diagnostic pop

[LPRequest reset];
[LPRequestSender reset];
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ spm:
sh Tools/spm.sh

updateVersion:
sed -i '' -e "s/#define LEANPLUM_SDK_VERSION @.*/#define LEANPLUM_SDK_VERSION @\"`cat sdk-version.txt`\"/g" "./LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.h"
sed -i '' -e "s/#define LEANPLUM_SDK_VERSION @.*/#define LEANPLUM_SDK_VERSION @\"`cat sdk-version.txt`\"/g" "./LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.h";\
minVersion=5.0.0; version=`cat sdk-version.txt`;\
if [[ "$$version" != *"beta"* ]]; then \
sed -i '' -e "s/s.dependency 'Leanplum-iOS-SDK', .*/s.dependency 'Leanplum-iOS-SDK', \"~> $$minVersion\"/g" "./Leanplum-iOS-Location.podspec";\
sed -i '' -e "s/s.dependency 'Leanplum-iOS-SDK', .*/s.dependency 'Leanplum-iOS-SDK', \"~> $$minVersion\"/g" "./Leanplum-iOS-LocationAndBeacons.podspec";\
else \
sed -i '' -e "s/s.dependency 'Leanplum-iOS-SDK', .*/s.dependency 'Leanplum-iOS-SDK', \"~> $$minVersion-beta\"/g" "./Leanplum-iOS-Location.podspec";\
sed -i '' -e "s/s.dependency 'Leanplum-iOS-SDK', .*/s.dependency 'Leanplum-iOS-SDK', \"~> $$minVersion-beta\"/g" "./Leanplum-iOS-LocationAndBeacons.podspec";\
fi;

tagCommit:
git add LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.h; git commit -am 'update version'; git tag `cat sdk-version.txt`; git push; git push origin `cat sdk-version.txt`
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "Leanplum",
url: "https://github.com/Leanplum/Leanplum-iOS-SDK/releases/download/4.1.0/Leanplum.xcframework.zip",
checksum: "598e45b6118697ec2252fbe249dba2764ca1e094b8434818e6abeb24635fd0c8"
url: "https://github.com/Leanplum/Leanplum-iOS-SDK/releases/download/5.0.0/Leanplum.xcframework.zip",
checksum: "b49fd986f4e2394a0f46d455705085c3c39acb122d58f7098a230452a2e1b17d"
),
.target(
name: "LeanplumLocation",
Expand Down
2 changes: 1 addition & 1 deletion sdk-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0
5.0.0

0 comments on commit c3d7469

Please sign in to comment.