Skip to content

Commit

Permalink
Release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyue committed Sep 13, 2024
1 parent 088cc78 commit 8b07b83
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Example/Example-iOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
static NSString* kSABResultsTestURL = @"http://10.1.131.245:8202/api/v2/abtest/online/results?project-key=D9493739E8353F0917275C992F0C605A31D120AB";

// 测试环境,数据接收地址
static NSString* kSABTestServerURL = @"http://10.129.28.106:8106/sa?project=default";
static NSString* kSABTestServerURL = @"http://10.1.137.85:8106/sa?project=default";

@interface AppDelegate ()

Expand Down
13 changes: 9 additions & 4 deletions Example/Example-macOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
#import <SensorsABTest.h>


static NSString *const SADefaultServerURL = @"http://10.130.6.4:8106/sa?project=default";

/// 测试环境,获取试验地址
static NSString* kSABResultsTestURL = @"http://10.129.29.10:8202/api/v2/abtest/online/results?project-key=130EB9E0EE57A09D91AC167C6CE63F7723CE0B22";
static NSString* kSABResultsTestURL = @"http://10.1.131.245:8202/api/v2/abtest/online/results?project-key=D9493739E8353F0917275C992F0C605A31D120AB";

// 测试环境,数据接收地址
static NSString* SADefaultServerURL = @"http://10.1.137.85:8106/sa?project=default";


@interface AppDelegate ()

Expand All @@ -46,8 +48,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
- (void)startSensorsAnalyticsSDKWithLaunching:(NSNotification *)aNotification {
SAConfigOptions *options = [[SAConfigOptions alloc] initWithServerURL:SADefaultServerURL launchOptions:nil];
options.enableJavaScriptBridge = YES;

#ifdef DEBUG
options.enableLog = YES;
options.flushNetworkPolicy = SensorsAnalyticsNetworkTypeALL;
options.flushNetworkPolicy = SensorsAnalyticsNetworkTypeNONE;
#endif

[SensorsAnalyticsSDK startWithConfigOptions:options];
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Example-macOS/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ - (void)viewDidLoad {
#pragma mark - fetchABTest
#pragma mark STRING
- (IBAction)stringFetchCache:(NSButton *)sender {
NSString *result = [SensorsABTest.sharedInstance fetchCacheABTestWithParamName:@"sringId" defaultValue:@"默认值"];
NSLog(@"fetchCacheABTest STRING experiment,paramName:%@ - result:%@\n", @"sringId", result);
NSString *result = [SensorsABTest.sharedInstance fetchCacheABTestWithParamName:@"device_color" defaultValue:@"默认值"];
NSLog(@"fetchCacheABTest STRING experiment,paramName:%@ - result:%@\n", @"device_color", result);
}

- (IBAction)stringAsyncFetch:(NSButton *)sender {
Expand Down
10 changes: 5 additions & 5 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -176,7 +176,7 @@
4D15CF0F24EE82E0003D2748 /* Sources */,
4D15CF1024EE82E0003D2748 /* Frameworks */,
4D15CF1124EE82E0003D2748 /* Resources */,
9E7C06554C1C8314F56450A5 /* [CP] Embed Pods Frameworks */,
F3FD2B84FC7DEBD9021B33D1 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -287,7 +287,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9E7C06554C1C8314F56450A5 /* [CP] Embed Pods Frameworks */ = {
F3FD2B84FC7DEBD9021B33D1 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -556,7 +556,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = "cn.sensorsdata.Example-macOS";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -581,7 +581,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = "cn.sensorsdata.Example-macOS";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end


target 'Example-macOS' do
platform :osx, '10.10'
platform :osx, '10.13'
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

Expand Down
2 changes: 1 addition & 1 deletion SensorsABTest/SABConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#import "SABConstants.h"

// 当前版本号
NSString *const kSABLibVersion = @"1.0.4";
NSString *const kSABLibVersion = @"1.0.5";

// SA 最低支持版本
NSString *const kSABMinSupportedSALibVersion = @"4.5.6";
Expand Down
14 changes: 10 additions & 4 deletions SensorsABTest/Store/SABFileStorePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
@implementation SABFileStorePlugin

- (NSString *)filePath:(NSString *)key {
NSString *newKey = [key stringByReplacingOccurrencesOfString:self.type withString:@""];
NSString *filename = [NSString stringWithFormat:@"sensorsanalytics-abtest-%@.plist", newKey];
NSString *filepath = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:filename];
return filepath;
NSString *newKey = [key stringByReplacingOccurrencesOfString:kSABFileStorePluginType withString:@""];

#if TARGET_OS_OSX
NSString *appId = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
NSString *fileName = [NSString stringWithFormat:@"sensorsanalytics-abtest-%@-%@.plist", appId, newKey];
#else
NSString *fileName = [NSString stringWithFormat:@"sensorsanalytics-abtest-%@.plist", newKey];
#endif
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileName];
return filePath;
}

#pragma mark - SAStorePlugin
Expand Down
2 changes: 1 addition & 1 deletion SensorsABTesting.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SensorsABTesting'
s.version = "1.0.4"
s.version = "1.0.5"
s.summary = 'The official iOS/macOS SDK of Sensors A/B Testing.'
s.homepage = 'http://www.sensorsdata.cn'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
Expand Down

0 comments on commit 8b07b83

Please sign in to comment.