Commit 3e2d0fe6 authored by 井庆林's avatar 井庆林

code review

parent c606fc11
......@@ -21,6 +21,7 @@
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
6393936E24122A6A0090348B /* swiftVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6393936D24122A6A0090348B /* swiftVC.swift */; };
63EFAB1122658352005EEAC6 /* GMPhobos_ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63EFAB1022658352005EEAC6 /* GMPhobos_ExampleTests.m */; };
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
9822812B60126E270C6B388F /* Pods_GMPhobos_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3D30FF32AFC059EC87D69DA /* Pods_GMPhobos_Tests.framework */; };
......@@ -75,6 +76,8 @@
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
6393936C24122A690090348B /* GMPhobos_Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GMPhobos_Example-Bridging-Header.h"; sourceTree = "<group>"; };
6393936D24122A6A0090348B /* swiftVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = swiftVC.swift; sourceTree = "<group>"; };
63EFAB0E22658352005EEAC6 /* GMPhobos_ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GMPhobos_ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
63EFAB1022658352005EEAC6 /* GMPhobos_ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GMPhobos_ExampleTests.m; sourceTree = "<group>"; };
63EFAB1222658352005EEAC6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
......@@ -170,8 +173,10 @@
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
6003F5A5195388D20070C39A /* GMViewController.h */,
6003F5A6195388D20070C39A /* GMViewController.m */,
6393936D24122A6A0090348B /* swiftVC.swift */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
6393936C24122A690090348B /* GMPhobos_Example-Bridging-Header.h */,
);
name = "Example for GMPhobos";
path = GMPhobos;
......@@ -326,6 +331,7 @@
TargetAttributes = {
6003F589195388D20070C39A = {
DevelopmentTeam = 86R4V3XFLU;
LastSwiftMigration = 1130;
};
6003F5AD195388D20070C39A = {
DevelopmentTeam = 86R4V3XFLU;
......@@ -460,6 +466,7 @@
buildActionMask = 2147483647;
files = (
D3435C101E49662000A93ED8 /* GMPhobosController.m in Sources */,
6393936E24122A6A0090348B /* swiftVC.swift in Sources */,
6003F59E195388D20070C39A /* GMAppDelegate.m in Sources */,
6003F5A7195388D20070C39A /* GMViewController.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */,
......@@ -619,17 +626,22 @@
baseConfigurationReference = 773D510F733436C849F61689 /* Pods-GMPhobos_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = 86R4V3XFLU;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "GMPhobos/GMPhobos-Prefix.pch";
INFOPLIST_FILE = "GMPhobos/GMPhobos-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "263a3bb1-1a96-42d8-9117-a6893cf835c9";
PROVISIONING_PROFILE_SPECIFIER = Wildcard;
SWIFT_OBJC_BRIDGING_HEADER = "GMPhobos/GMPhobos_Example-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
......@@ -640,17 +652,21 @@
baseConfigurationReference = 5BECCE13A9644D7FC0ABE491 /* Pods-GMPhobos_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = 86R4V3XFLU;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "GMPhobos/GMPhobos-Prefix.pch";
INFOPLIST_FILE = "GMPhobos/GMPhobos-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "c7e6dc21-c52f-40e4-a435-5e942f0af080";
PROVISIONING_PROFILE_SPECIFIER = Wildcard;
SWIFT_OBJC_BRIDGING_HEADER = "GMPhobos/GMPhobos_Example-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
......@@ -660,6 +676,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = EBFF902F7DDD31799747B1A0 /* Pods-GMPhobos_Tests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = 86R4V3XFLU;
......@@ -687,6 +704,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 39F84A4B7451E3C570109001 /* Pods-GMPhobos_Tests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "iPhone Developer";
FRAMEWORK_SEARCH_PATHS = (
......@@ -709,6 +727,7 @@
63EFAB1522658352005EEAC6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
......@@ -738,6 +757,7 @@
63EFAB1622658352005EEAC6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
......
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
......@@ -9,6 +9,8 @@
#import "GMViewController.h"
#import <GMPhobos/Phobos.h>
#import <GMCache/GMCache.h>
#import "GMPhobos_Example-Swift.h"
//@import GMCache;
@import GMPhobos.PhobosUtil;
@import GMPhobos.Phobos;
......@@ -81,6 +83,11 @@ NSString *const MockCityId = @"beijing";
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
swiftVC *vc = [swiftVC new];
[self presentViewController:vc animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
......@@ -14,9 +16,9 @@
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
//
// swiftVC.swift
// GMPhobos_Example
//
// Created by Locus on 2020/3/6.
// Copyright © 2020 licong. All rights reserved.
//
import Foundation
import GMPhobos
class swiftVC: UIViewController {
override func viewDidLoad() {
let attr = Dictionary<String, Any>.init()
Phobos.track("swift", attributes: attr, sendNow: true)
}
}
......@@ -10,6 +10,7 @@
#import "PhobosPVProtocol.h"
#import "PhobosConfig.h"
#import <CoreLocation/CLLocation.h>
#import "Phobos.h"
NS_ASSUME_NONNULL_BEGIN
......
......@@ -399,7 +399,7 @@ static NSString *sdkVersion = @"1.4.0";
*/
+ (void)disposeSendDataWithImmediately:(BOOL)immediately {
NSArray<SendDataEntity *> *entities = [PhobosDataManager fetchToBeSendDataEntities];
if (immediately || entities.count > 50) {
if (immediately || entities.count > PhobosShardCount) {
[PhobosDataManager updateDataEntities:entities sendStatus:PhobosDataSendStatusSending completion:nil];
[PhobosSendManager sendDataWithEntities:entities completion:^(NSArray<SendDataEntity *> * _Nonnull finishEntities, NSInteger code) {
if (code == 200) {
......
......@@ -10,6 +10,7 @@
#import "PhobosPVProtocol.h"
#import <CoreLocation/CLLocation.h>
#import "PhobosConfig.h"
#import "Phobos.h"
NS_ASSUME_NONNULL_BEGIN
......
......@@ -13,6 +13,13 @@
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM (NSInteger, PhobosSigningType) {
PhobosSigningTypeUndefined = 0,
PhobosSigningTypeAppStore,
PhobosSigningTypeRelease,
PhobosSigningTypeDebug
};
@interface Phobos : NSObject
/**
......
......@@ -9,14 +9,6 @@
#ifndef PhobosConfig_h
#define PhobosConfig_h
typedef NS_ENUM (NSInteger, PhobosSigningType) {
PhobosSigningTypeUndefined = 0,
PhobosSigningTypeAppStore,
PhobosSigningTypeRelease,
PhobosSigningTypeDebug
};
#ifdef DEBUG
#define phobosLog(...) NSLog(@"[Phobos] %@",__VA_ARGS__)
#else
......@@ -27,10 +19,6 @@ typedef NS_ENUM (NSInteger, PhobosSigningType) {
#define PhobosBeginTime @"PhobosBeginTime" //记录APP打开|从后台启动时的时间戳
#define PhobosEndTime @"PhobosEndTime" //记录APP退出|退到后台时的时间戳
#define PhobosNormalCacheKey @"PhobosNormalCacheKey" //存放持久化埋点数据的key
#define PhobosImmediatelyCacheKey @"PhobosImmediatelyCacheKey" //存放持久化实时埋点数据的key
#define PhobosNewCacheKey @"PhobosNewCacheKey"
#define PhobosCacheKey @"PhobosCacheKey" //old 存放持久化埋点数据的key
#define PhobosTempCacheKey @"PhobosTempCacheKey" //old 临时存放待发送埋点数据的key
......
......@@ -7,7 +7,6 @@
#import <Foundation/Foundation.h>
#import "PhobosDataManager.h"
#import "PhobosUtil.h"
NS_ASSUME_NONNULL_BEGIN
......
......@@ -10,6 +10,7 @@
#import <MJExtension/MJExtension.h>
#import "PhobosConfig.h"
#import "Phobos.h"
#import "PhobosUtil.h"
#ifdef APPSTORE
#define GMExactExposureApi @"https://log.igengmei.com/log/precise_exposure"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment