Authored by 曹镏

no message

... ... @@ -894,6 +894,7 @@
E7E311C71A84C6DF004DB7DF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E7E311CC1A84C6DF004DB7DF /* Build configuration list for PBXNativeTarget "YHAnalyticsTests" */ = {
isa = XCConfigurationList;
... ... @@ -902,6 +903,7 @@
E7E311C91A84C6DF004DB7DF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
... ...
... ... @@ -34,6 +34,20 @@
ReferencedContainer = "container:YH_Analytics.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E7E311B61A84C6DF004DB7DF"
BuildableName = "YHAnalyticsTests.xctest"
BlueprintName = "YHAnalyticsTests"
ReferencedContainer = "container:YH_Analytics.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
... ... @@ -52,6 +66,16 @@
ReferencedContainer = "container:YH_Analytics.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E7E311B61A84C6DF004DB7DF"
BuildableName = "YHAnalyticsTests.xctest"
BlueprintName = "YHAnalyticsTests"
ReferencedContainer = "container:YH_Analytics.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
... ...
... ... @@ -22,6 +22,16 @@
<key>primary</key>
<true/>
</dict>
<key>E7E311AC1A84C6DF004DB7DF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>E7E311B61A84C6DF004DB7DF</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
... ...
... ... @@ -20,7 +20,7 @@
// Override point for customization after application launch.
// 设置发送策略
[YH_Analytics shareInstance].logStrategy = LogStrategyCustom;
// [YH_Analytics shareInstance].logStrategy = LogStrategyCustom;
// 自定义发送时间,从服务器获取
[YH_Analytics shareInstance].customInterval = 10;
... ... @@ -30,7 +30,8 @@
// 启动
[[YH_Analytics shareInstance]startWithAppId:@"appid"];
NSLog(@"logStrategy == %d", [YH_Analytics shareInstance].logStrategy);
return YES;
}
... ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C94b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
</dependencies>
<scenes>
<!--View Controller-->
... ... @@ -17,9 +17,30 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bwP-V2-lOZ">
<rect key="frame" x="5" y="144" width="338" height="97"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gW0-dg-TMX">
<rect key="frame" x="10" y="20" width="580" height="100"/>
<color key="backgroundColor" red="0.050306309830072005" green="0.82026833496787488" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="ZI4-PW-uqg"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<state key="normal" title="Event">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">
<rect key="frame" x="0.0" y="28" width="400" height="97"/>
</variation>
<connections>
<action selector="click:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="HJw-eR-F41"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bwP-V2-lOZ">
<rect key="frame" x="10" y="130" width="580" height="100"/>
<color key="backgroundColor" red="1" green="0.69311940380909554" blue="0.023097386693144983" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="NoZ-Je-4qr"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<state key="normal" title="Error">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
... ... @@ -32,9 +53,12 @@
<action selector="error:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="a4Q-aL-zxj"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ewb-Ni-v83">
<rect key="frame" x="5" y="251" width="338" height="97"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ewb-Ni-v83">
<rect key="frame" x="10" y="240" width="580" height="100"/>
<color key="backgroundColor" red="1" green="0.029765881059811372" blue="0.12144865843591712" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="b7r-yi-EcF"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<state key="normal" title="Crash">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
... ... @@ -47,47 +71,56 @@
<action selector="crash:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Yi6-az-zUt"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gW0-dg-TMX">
<rect key="frame" x="5" y="11" width="338" height="97"/>
<color key="backgroundColor" red="0.050306309830072005" green="0.82026833496787488" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
<state key="normal" title="Event">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">
<rect key="frame" x="0.0" y="28" width="400" height="97"/>
</variation>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="nAu-Ws-BbT">
<rect key="frame" x="161" y="527" width="278" height="29"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="lfj-dM-l64"/>
</constraints>
<segments>
<segment title="启动发送"/>
<segment title="间隔时间发送"/>
<segment title="立即发送"/>
</segments>
<connections>
<action selector="click:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="HJw-eR-F41"/>
<action selector="segmentClick:" destination="vXZ-lx-hvc" eventType="valueChanged" id="Zsu-qi-jNA"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zcx-JR-zO7">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">
<rect key="frame" x="13" y="349" width="375" height="262"/>
</variation>
</imageView>
</segmentedControl>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="8" id="1aJ-tt-QeY"/>
<constraint firstItem="gW0-dg-TMX" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" id="4N3-W1-Guz"/>
<constraint firstAttribute="trailing" secondItem="gW0-dg-TMX" secondAttribute="trailing" constant="10" id="9Nj-U5-cTm"/>
<constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="10" id="9f1-iX-d2x"/>
<constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="10" id="CIg-AA-tZq"/>
<constraint firstAttribute="trailing" secondItem="ewb-Ni-v83" secondAttribute="trailing" constant="10" id="OJg-v6-WQP"/>
<constraint firstItem="ewb-Ni-v83" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="Pfw-gK-Ojb"/>
<constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="8" id="Rtg-70-QXv"/>
<constraint firstAttribute="centerX" secondItem="nAu-Ws-BbT" secondAttribute="centerX" id="abS-HB-PCF"/>
<constraint firstItem="bwP-V2-lOZ" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="ear-Q6-Cvo"/>
<constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="10" id="en3-RB-i3r"/>
<constraint firstAttribute="trailing" secondItem="bwP-V2-lOZ" secondAttribute="trailing" constant="10" id="tK7-Cs-ypv"/>
<constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="10" id="tgA-RV-Qfw"/>
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="nAu-Ws-BbT" secondAttribute="bottom" constant="45" id="u0B-Yk-3Eh"/>
<constraint firstItem="gW0-dg-TMX" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="vdS-6K-JkS"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="zcx-JR-zO7"/>
</mask>
</variation>
<variation key="heightClass=regular-widthClass=compact">
<mask key="subviews">
<include reference="zcx-JR-zO7"/>
<mask key="constraints">
<exclude reference="1aJ-tt-QeY"/>
<exclude reference="tgA-RV-Qfw"/>
<exclude reference="9f1-iX-d2x"/>
<exclude reference="Rtg-70-QXv"/>
</mask>
</variation>
</view>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<connections>
<outlet property="imageView" destination="zcx-JR-zO7" id="xDL-m6-TXH"/>
<outlet property="segment" destination="nAu-Ws-BbT" id="Rgd-K0-bFJ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-289.5" y="235.5"/>
<point key="canvasLocation" x="-290" y="235"/>
</scene>
</scenes>
</document>
... ...
... ... @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>cn.yoho.show</string>
<string>cn.yoho.test</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
... ...
... ... @@ -13,7 +13,8 @@
- (IBAction)click:(id)sender;
- (IBAction)error:(id)sender;
- (IBAction)crash:(id)sender;
@property (strong, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UISegmentedControl *segment;
@end
... ...
... ... @@ -23,7 +23,7 @@
[super viewDidLoad];
[self.imageView setImage:[UIImage imageNamed:@"stastsold"]];
self.segment.selectedSegmentIndex = [YH_Analytics shareInstance].logStrategy;
}
... ... @@ -65,6 +65,42 @@
NSString * string= [arr objectAtIndex: 2];
}
-(IBAction)segmentClick:(UISegmentedControl *)Seg {
NSInteger index = Seg.selectedSegmentIndex;
NSLog(@"Index %li", (long)index);
switch (index) {
case 0:
[YH_Analytics shareInstance].logStrategy = LogStrategyAppLaunch;
break;
case 1:
[YH_Analytics shareInstance].logStrategy = LogStrategyCustom;
break;
case 2:
[YH_Analytics shareInstance].logStrategy = LogStrategyImmedi;;
break;
default:
break;
}
}
@end
... ...
... ... @@ -77,4 +77,6 @@ typedef enum _YohoMobStatLogStrategy {
*/
@property (strong, nonatomic) NSString *uid;
@end
... ...
... ... @@ -573,5 +573,17 @@ static dispatch_queue_t persisitingQueue;
}
-(void)setLogStrategy:(YHLogStrategy)strategyNumber
{
NSUserDefaults *strategy = [NSUserDefaults standardUserDefaults];
[strategy setObject: [NSNumber numberWithInteger:strategyNumber] forKey:@"LOGSTRATEGY"];
[strategy synchronize];
}
-(YHLogStrategy)logStrategy
{
NSUserDefaults *strategy = [NSUserDefaults standardUserDefaults];
NSNumber * strategyObj = [strategy objectForKey:@"LOGSTRATEGY"];
return [strategyObj intValue];
}
@end
... ...