Commit 803e6511 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 203bd232
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6F6B630FA5213AB083E7CEF1F986FE44"
BuildableName = "UMCCommon"
BlueprintName = "UMCCommon"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -8,57 +8,46 @@
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>MBProgressHUD.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Masonry.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>PDFGenerator.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Pods-ShorthandMaster.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>SnapKit.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>SwiftyJSON.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>SwiftyStoreKit.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>UMCCommon.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
......
......@@ -151,4 +151,9 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## UMCCommon
Copyright 2011 - 2019 umeng.com. All rights reserved.
Generated by CocoaPods - https://cocoapods.org
......@@ -205,6 +205,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Copyright 2011 - 2019 umeng.com. All rights reserved.
</string>
<key>License</key>
<string>Copyright</string>
<key>Title</key>
<string>UMCCommon</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>
......
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit" "${PODS_ROOT}/UMCCommon"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator/PDFGenerator.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit/SwiftyStoreKit.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CoreGraphics" -framework "Foundation" -framework "MBProgressHUD" -framework "Masonry" -framework "PDFGenerator" -framework "QuartzCore" -framework "SnapKit" -framework "SwiftyJSON" -framework "SwiftyStoreKit" -framework "UIKit" -framework "WebKit"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "Alamofire" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MBProgressHUD" -framework "Masonry" -framework "PDFGenerator" -framework "QuartzCore" -framework "SnapKit" -framework "SwiftyJSON" -framework "SwiftyStoreKit" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
......
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit"
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit" "${PODS_ROOT}/UMCCommon"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD/MBProgressHUD.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PDFGenerator/PDFGenerator.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SnapKit/SnapKit.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyStoreKit/SwiftyStoreKit.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CoreGraphics" -framework "Foundation" -framework "MBProgressHUD" -framework "Masonry" -framework "PDFGenerator" -framework "QuartzCore" -framework "SnapKit" -framework "SwiftyJSON" -framework "SwiftyStoreKit" -framework "UIKit" -framework "WebKit"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "Alamofire" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MBProgressHUD" -framework "Masonry" -framework "PDFGenerator" -framework "QuartzCore" -framework "SnapKit" -framework "SwiftyJSON" -framework "SwiftyStoreKit" -framework "SystemConfiguration" -framework "UIKit" -framework "UMCommon" -framework "WebKit"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
......
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/UMCCommon
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMCCommon"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/UMCCommon
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/UMCCommon
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMCCommon"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/UMCCommon
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
Versions/Current/Headers
\ No newline at end of file
Versions/Current/UMCommon
\ No newline at end of file
//
// MobClick.h
// Analytics
//
// Copyright (C) 2010-2017 Umeng.com . All rights reserved.
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
typedef void(^CallbackBlock)();
@class CLLocation;
@interface MobClick : NSObject <UIAlertViewDelegate>
#pragma mark basics
///---------------------------------------------------------------------------------------
/// @name 设置
///---------------------------------------------------------------------------------------
/** 开启CrashReport收集, 默认YES(开启状态).
@param value 设置为NO,可关闭友盟CrashReport收集功能.
@return void.
*/
+ (void)setCrashReportEnabled:(BOOL)value;
#pragma mark event logs
///---------------------------------------------------------------------------------------
/// @name 页面计时
///---------------------------------------------------------------------------------------
/** 手动页面时长统计, 记录某个页面展示的时长.
@param pageName 统计的页面名称.
@param seconds 单位为秒,int型.
@return void.
*/
+ (void)logPageView:(NSString *)pageName seconds:(int)seconds;
/** 自动页面时长统计, 开始记录某个页面展示时长.
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
@param pageName 统计的页面名称.
@return void.
*/
+ (void)beginLogPageView:(NSString *)pageName;
/** 自动页面时长统计, 结束记录某个页面展示时长.
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
@param pageName 统计的页面名称.
@return void.
*/
+ (void)endLogPageView:(NSString *)pageName;
///---------------------------------------------------------------------------------------
/// @name 事件统计
///---------------------------------------------------------------------------------------
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
@param eventId 网站上注册的事件Id.
@param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.
@param accumulation 累加值。为减少网络交互,可以自行对某一事件ID的某一分类标签进行累加,再传入次数作为参数。
@return void.
*/
+ (void)event:(NSString *)eventId; //等同于 event:eventId label:eventId;
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
*/
+ (void)event:(NSString *)eventId label:(NSString *)label; // label为nil或@""时,等同于 event:eventId label:eventId;
/** 自定义事件,数量统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID
*/
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes;
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes counter:(int)number;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
beginEvent,endEvent要配对使用,也可以自己计时后通过durations参数传递进来
@param eventId 网站上注册的事件Id.
@param label 分类标签。不同的标签会分别进行统计,方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.
@param primarykey 这个参数用于和event_id一起标示一个唯一事件,并不会被统计;对于同一个事件在beginEvent和endEvent 中要传递相同的eventId 和 primarykey
@param millisecond 自己计时需要的话需要传毫秒进来
@return void.
@warning 每个event的attributes不能超过10个
eventId、attributes中key和value都不能使用空格和特殊字符,必须是NSString,且长度不能超过255个字符(否则将截取前255个字符)
id, ts, du是保留字段,不能作为eventId及key的名称
*/
+ (void)beginEvent:(NSString *)eventId;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)beginEvent:(NSString *)eventId label:(NSString *)label;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId label:(NSString *)label;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)beginEvent:(NSString *)eventId primarykey :(NSString *)keyName attributes:(NSDictionary *)attributes;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)endEvent:(NSString *)eventId primarykey:(NSString *)keyName;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId durations:(int)millisecond;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId label:(NSString *)label durations:(int)millisecond;
/** 自定义事件,时长统计.
使用前,请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID,然后在工程中传入相应的事件ID.
*/
+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes durations:(int)millisecond;
#pragma mark - user methods
/** active user sign-in.
使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数
@param puid : user's ID
@param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。
@return void.
*/
+ (void)profileSignInWithPUID:(NSString *)puid;
+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider;
/** active user sign-off.
停止sign-in PUID的统计
@return void.
*/
+ (void)profileSignOff;
///---------------------------------------------------------------------------------------
/// @name 地理位置设置
/// 需要链接 CoreLocation.framework 并且 #import <CoreLocation/CoreLocation.h>
///---------------------------------------------------------------------------------------
/** 设置经纬度信息
@param latitude 纬度.
@param longitude 经度.
@return void
*/
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
/** 设置经纬度信息
@param location CLLocation 经纬度信息
@return void
*/
+ (void)setLocation:(CLLocation *)location;
///---------------------------------------------------------------------------------------
/// @name Utility函数
///---------------------------------------------------------------------------------------
/** 判断设备是否越狱,依据是否存在apt和Cydia.app
*/
+ (BOOL)isJailbroken;
/** 判断App是否被破解
*/
+ (BOOL)isPirated;
/** 设置 app secret
@param secret string
@return void.
*/
+ (void)setSecret:(NSString *)secret;
+ (void)setCrashCBBlock:(CallbackBlock)cbBlock;
/** DeepLink事件
@param link 唤起应用的link
@return void.
*/
+ (void)onDeepLinkReceived:(NSURL *)link;
/**
* 设置预置事件属性 键值对 会覆盖同名的key
*/
+(void) registerPreProperties:(NSDictionary *)property;
/**
*
* 删除指定预置事件属性
@param key
*/
+(void) unregisterPreProperty:(NSString *)propertyName;
/**
* 获取预置事件所有属性;如果不存在,则返回空。
*/
+(NSDictionary *)getPreProperties;
/**
*清空所有预置事件属性。
*/
+(void)clearPreProperties;
/**
* 设置关注事件是否首次触发,只关注eventList前五个合法eventID.只要已经保存五个,此接口无效
*/
+(void)setFirstLaunchEvent:(NSArray *)eventList;
/** 设置是否自动采集页面, 默认NO(不自动采集).
@param value 设置为YES, umeng SDK 会将自动采集页面信息
*/
+ (void)setAutoPageEnabled:(BOOL)value;
@end
//
// UMCommon.h
// UMCommon
//
// Created by San Zhang on 11/2/16.
// Copyright © 2016 UMeng. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for UMCommon.
FOUNDATION_EXPORT double UMCommonVersionNumber;
//! Project version string for UMCommon.
FOUNDATION_EXPORT const unsigned char UMCommonVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <UMCommon/PublicHeader.h>
#import <UMCommon/UMConfigure.h>
//
// UMConfigure.h
// UMCommon
//
// Created by San Zhang on 9/6/16.
// Copyright © 2016 UMeng. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UMConfigure : NSObject
/** 初始化友盟所有组件产品
@param appKey 开发者在友盟官网申请的appkey.
@param channel 渠道标识,可设置nil表示"App Store".
*/
+ (void)initWithAppkey:(NSString *)appKey channel:(NSString *)channel;
/** 设置是否在console输出sdk的log信息.
@param bFlag 默认NO(不输出log); 设置为YES, 输出可供调试参考的log信息. 发布产品时必须设置为NO.
*/
+ (void)setLogEnabled:(BOOL)bFlag;
/** 设置是否对日志信息进行加密, 默认NO(不加密).
@param value 设置为YES, umeng SDK 会将日志信息做加密处理
*/
+ (void)setEncryptEnabled:(BOOL)value;
+ (NSString *)umidString;
/**
集成测试需要device_id
*/
+ (NSString*)deviceIDForIntegration;
/** 是否开启统计,默认为YES(开启状态)
@param value 设置为NO,可关闭友盟统计功能.
@return void.
*/
+ (void)setAnalyticsEnabled:(BOOL)value;
@end
//
// UMRemoteConfig.h
// myFireBase
//
// Created by 张军华 on 2019/12/30.
// Copyright © 2019年 张军华. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UMRemoteConfigEnum.h"
NS_ASSUME_NONNULL_BEGIN
typedef void (^UMRemoteConfigFetchCompletion)(UMRemoteConfigFetchStatus status,
NSError *_Nullable error);
typedef void (^UMRemoteConfigActivateCompletion)(NSError *_Nullable error);
@protocol UMRemoteConfigDelegate<NSObject>
@optional
/**
* @brief 获取服务器的网络请求的回调
* @param status see UMRemoteConfigFetchStatus
* @param error 错误信息
* @param userInfo 该回调的扩展信息
* @note 调用函数触发此回调
* fetchWithCompletionHandler
* fetchAndActivateWithCompletionHandler
*/
-(void)remoteConfigFetched:(UMRemoteConfigFetchStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
/**
* @brief 远程配置被激活的回调
* @param status see UMRemoteConfigActiveStatus
* @param error 错误信息
* @param userInfo 该回调的扩展信息
* @note 调用函数触发此回调
* fetchAndActivateWithCompletionHandler
* activateWithCompletionHandler
*/
-(void)remoteConfigActivated:(UMRemoteConfigActiveStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
/**
* @brief 配置已经准备就绪
* @param status see UMRemoteConfigActiveStatus
* @param error 错误信息
* @param userInfo 该回调的扩展信息
* @note 调用函数触发此回调
* fetchWithCompletionHandler
*/
-(void)remoteConfigReady:(UMRemoteConfigActiveStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
@end
@class UMRemoteConfigSettings;
@interface UMRemoteConfig : NSObject
@property(nonatomic,assign)id<UMRemoteConfigDelegate> remoteConfigDelegate;
@property(nonatomic, readwrite, strong) UMRemoteConfigSettings *configSettings;
#pragma mark - init
/**
* @brief 远程配置单例
* @param delegate see UMRemoteConfigDelegate
* @note 用户初始化时候,
先调用 remoteConfigWithDelegate:(id<UMRemoteConfigDelegate>)delegate,可以保证上次ready的数据可以回调给用户。
*/
+ (UMRemoteConfig *)remoteConfigWithDelegate:(nullable id<UMRemoteConfigDelegate>)delegate
withConfigSettings:(nullable UMRemoteConfigSettings*)configSettings;
+ (UMRemoteConfig *)remoteConfig;
#pragma mark - activate
/**
* @brief 激活本地配置
* @param completionHandler 回调
*/
+ (void)activateWithCompletionHandler:(nullable UMRemoteConfigActivateCompletion)completionHandler;
#pragma mark - Get Config
/**
* @brief 获取配置信息
* @param key 对应的key
* @note 获取配置的有限顺利,远程配置->Defaults
*/
+ (nullable id)configValueForKey:(nullable NSString *)key;
#pragma mark - Defaults
/**
* @brief 设置本地默认配置
* @param defaults 对应的本地配置
*/
+ (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaults;
/**
* @brief 设置本地默认配置
* @param fileName 包含本地配置的plist文件
*/
+ (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName;
@end
NS_ASSUME_NONNULL_END
//
// UMRemoteConfigEnum.h
// myFireBase
//
// Created by 张军华 on 2019/12/30.
// Copyright © 2019年 张军华. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// Indicates whether updated data was successfully fetched.
typedef NS_ENUM(NSInteger, UMRemoteConfigFetchStatus) {
/// Config has never been fetched.
UMRemoteConfigFetchStatusNoFetchYet,
/// Config fetch succeeded.
UMRemoteConfigFetchStatusSuccess,
/// Config fetch failed.
UMRemoteConfigFetchStatusFailure,
/// Config fetch was throttled.
UMRemoteConfigFetchStatusThrottled,
};
/// Indicates whether ActiveStatus in the local data .
typedef NS_ENUM(NSInteger, UMRemoteConfigActiveStatus) {
UMRemoteConfigActiveStatus_None,
UMRemoteConfigActiveStatus_Ready,
UMRemoteConfigActiveStatus_Active,
UMRemoteConfigActiveStatus_Expiration
};
///// Indicates whether updated data was successfully fetched and activated.
//typedef NS_ENUM(NSInteger, UMRemoteConfigFetchAndActivateStatus) {
// // The remote fetch succeeded and fetched data was activated.
// UMRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote,
// // The fetch and activate succeeded from already fetched but yet unexpired config data. You can
// // control this using minimumFetchInterval property in FIRRemoteConfigSettings.
// UMRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData,
// // The fetch and activate failed.
// UMRemoteConfigFetchAndActivateStatusError
//};
//typedef NS_ENUM(NSInteger, UMRemoteConfigSource) {
// UMRemoteConfigSourceRemote, ///< The data source is the Remote Config service.
// UMRemoteConfigSourceDefault, ///< The data source is the DefaultConfig defined for this app.
// UMRemoteConfigSourceStatic, ///< The data doesn't exist, return a static initialized value.
//};
NS_ASSUME_NONNULL_END
//
// UMRemoteConfigSettings.h
// myFireBase
//
// Created by 张军华 on 2019/12/30.
// Copyright © 2019年 张军华. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface UMRemoteConfigSettings : NSObject
/// Indicates the default value in seconds to set for the minimum interval that needs to elapse
/// before a fetch request can again be made to the Remote Config backend. After a fetch request to
/// the backend has succeeded, no additional fetch requests to the backend will be allowed until the
/// minimum fetch interval expires.
/// @note 目前没用,保留字段
@property(atomic, assign) NSTimeInterval minimumFetchInterval;
/// Indicates the default value in seconds to abandon a pending fetch request made to the backend.
/// This value is set for outgoing requests as the timeoutIntervalForRequest as well as the
/// timeoutIntervalForResource on the NSURLSession's configuration.
/// @note 目前没用,保留字段
@property(atomic, assign) NSTimeInterval fetchTimeout;
///active after fetch config
///获取远程配置后,是否激活
@property(atomic, assign) BOOL activateAfterFetch;
@end
NS_ASSUME_NONNULL_END
......@@ -39,6 +39,7 @@
A94DD58224FE37DF00B1B5A2 /* UITextField+LimitLength.m in Sources */ = {isa = PBXBuildFile; fileRef = A94DD57F24FE37DF00B1B5A2 /* UITextField+LimitLength.m */; };
A94DD58424FE40E600B1B5A2 /* Goods.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A94DD58324FE40E600B1B5A2 /* Goods.storyboard */; };
A94DD58624FE490E00B1B5A2 /* SHGoodsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94DD58524FE490E00B1B5A2 /* SHGoodsViewController.swift */; };
A94DD58824FF3CE400B1B5A2 /* Array+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94DD58724FF3CE400B1B5A2 /* Array+Extension.swift */; };
A950F5A824F36F55007AB63E /* SHRecordListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A950F5A724F36F55007AB63E /* SHRecordListViewController.swift */; };
A950F5AA24F3727A007AB63E /* SHRecordListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A950F5A924F3727A007AB63E /* SHRecordListCell.swift */; };
A950F5AC24F39EC1007AB63E /* SHRecordShowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A950F5AB24F39EC1007AB63E /* SHRecordShowViewController.swift */; };
......@@ -185,6 +186,7 @@
A94DD58024FE37DF00B1B5A2 /* UITextField+LimitLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextField+LimitLength.h"; sourceTree = "<group>"; };
A94DD58324FE40E600B1B5A2 /* Goods.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Goods.storyboard; sourceTree = "<group>"; };
A94DD58524FE490E00B1B5A2 /* SHGoodsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHGoodsViewController.swift; sourceTree = "<group>"; };
A94DD58724FF3CE400B1B5A2 /* Array+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Extension.swift"; sourceTree = "<group>"; };
A950F5A724F36F55007AB63E /* SHRecordListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordListViewController.swift; sourceTree = "<group>"; };
A950F5A924F3727A007AB63E /* SHRecordListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordListCell.swift; sourceTree = "<group>"; };
A950F5AB24F39EC1007AB63E /* SHRecordShowViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHRecordShowViewController.swift; sourceTree = "<group>"; };
......@@ -521,6 +523,7 @@
A95CDFA824E0EBF10066DAE6 /* UIView+IBLayer.swift */,
A95CDFA924E0EBF10066DAE6 /* UIView+Nib.swift */,
A95CDFA324E0EBF10066DAE6 /* UIStoryboard+Extension.swift */,
A94DD58724FF3CE400B1B5A2 /* Array+Extension.swift */,
);
path = Extensions;
sourceTree = "<group>";
......@@ -888,6 +891,7 @@
A95CDFE124E0ED950066DAE6 /* SHWebViewController.swift in Sources */,
A950F5BD24F4E66B007AB63E /* PopContainerView.swift in Sources */,
A95CDFCA24E0EBF10066DAE6 /* UserDefaults+Extension.swift in Sources */,
A94DD58824FF3CE400B1B5A2 /* Array+Extension.swift in Sources */,
A95CDFDF24E0ECD20066DAE6 /* SHBaseViewController.swift in Sources */,
A95CDFE324E0EE1A0066DAE6 /* SHBaseTabBarController.swift in Sources */,
A95CDFBD24E0EBF10066DAE6 /* UIDevice+Extension.swift in Sources */,
......
......@@ -17,14 +17,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.
SHStoreManager.launchWithSwiftyStoreKit()
// UMConfigure.initWithAppkey("5f310903b4b08b653e92e421", channel: "App Store")
// MobClick.event("app_start")
UMConfigure.initWithAppkey("5f4f1164636b2b13182afc13", channel: "App Store")
SHUserAccountManager.shared.getUserInfo({ (model) in
}, failure: {
})
SHUserAccountManager.shared.logCollection(with: .appStart)
// SHUserAccountManager.shared.logCollection(with: .appStart)
SHUserAccountManager.shared.getNovelInfo { (json) in
}
......
//
// Array+Extension.swift
// ShorthandMaster
//
// Created by 明津李 on 2020/9/2.
// Copyright © 2020 明津李. All rights reserved.
//
import UIKit
public extension Array {
// 去重
func filterDuplicates<E: Equatable>(_ filter: (Element) -> E) -> [Element] {
var result = [Element]()
for value in self {
let key = filter(value)
if !result.map({filter($0)}).contains(key) {
result.append(value)
}
}
return result
}
}
......@@ -15,6 +15,10 @@ extension UIDevice {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
}
static var appBundleVersion: String {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String
}
/// 设备 UUID
static var deviceID: String {
return UIDevice.current.identifierForVendor?.uuidString ?? ""
......
This diff is collapsed.
......@@ -19,6 +19,9 @@ class SHGoodsViewController: SHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
if SHUserAccountManager.shared.isMember == true {
MBProgressHUD.showSuccess("您已成为会员", to: self.view)
}
}
override func viewWillAppear(_ animated: Bool) {
......@@ -32,6 +35,20 @@ class SHGoodsViewController: SHBaseViewController {
yearStoreBtnBgView.layer.cornerRadius = yearStoreBtnBgView.frame.size.height/2
yearStoreBtn.layer.cornerRadius = yearStoreBtn.frame.size.height/2
// yearStoreBtn.setTitle(SHUserAccountManager.shared.autoButtonText, for: .normal)
// yearStoreLab.text = SHUserAccountManager.shared.threeDayText
let animation = CABasicAnimation.init()
animation.duration = 0.66
animation.beginTime = 0
animation.fromValue = 1.00
animation.toValue = 1.08
animation.keyPath = "transform.scale";
animation.timingFunction = CAMediaTimingFunction.init(name: .easeInEaseOut)
animation.autoreverses = true;
animation.repeatCount = MAXFLOAT;
yearStoreBtnBgView.layer.add(animation, forKey: "transform.scale")
}
func getDataSource(){
......
......@@ -31,7 +31,7 @@
<key>NSMicrophoneUsageDescription</key>
<string>App需要访问麦克风,进行录音并保存</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>XXXXXXX</string>
<string>App需要您允许以使用语音识别进行语音转译</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
......
......@@ -29,6 +29,7 @@ class SHRecordListViewController: SHBaseViewController {
self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(image: leftImage, style: .plain, target: self, action: #selector(userCilck))
setupUI()
// preposeMember()
/*
SHCloudManager.shared.cheakAccountStatus { (result) in
......@@ -53,15 +54,16 @@ class SHRecordListViewController: SHBaseViewController {
func prepareDateSource(){
dataSources = []
// if let list = CRUserDefaults.recordList {
// for dic in list.reversed(){
// let model = SHRecordModel()
// model.setValuesForKeys(dic)
// if model.delete == false{
// dataSources.append(model)
// }
// }
// }
if let list = CRUserDefaults.recordList {
for dic in list.reversed(){
let model = SHRecordModel()
model.setValuesForKeys(dic)
if model.delete == false{
dataSources.append(model)
}
}
}
let keyValueStore = NSUbiquitousKeyValueStore.default
let list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
......@@ -73,9 +75,20 @@ class SHRecordListViewController: SHBaseViewController {
dataSources.append(model)
}
}
tableView?.reloadData()
dataSources = dataSources.filterDuplicates({$0.pathFile})
dataSources.sort { (model0, model1) -> Bool in
return model0.time.compare(model1.time) == ComparisonResult.orderedDescending
}
}else{
dataSources.sort { (model0, model1) -> Bool in
return model0.time.compare(model1.time) == ComparisonResult.orderedDescending
}
}
tableView?.reloadData()
if dataSources.count == 0 {
self.view.bringSubviewToFront(maskView)
self.view.bringSubviewToFront(recorderBtn)
......@@ -86,24 +99,24 @@ class SHRecordListViewController: SHBaseViewController {
func removeModel(_ indexPath: IndexPath){
// var list = CRUserDefaults.recordList
//
// let deleteModel = dataSources[indexPath.row]
//
// for (index, dic) in list!.enumerated(){
// if dic["pathFile"] as! String == deleteModel.pathFile{
var list = CRUserDefaults.recordList
let deleteModel = dataSources[indexPath.row]
for (index, dic) in list!.enumerated(){
if dic["pathFile"] as! String == deleteModel.pathFile{
// var subDic = dic
// subDic["delete"] = true
// subDic["deleteDate"] = Date.init()
// list![index] = subDic
// }
// }
// CRUserDefaults.recordList = list
let deleteModel = dataSources[indexPath.row]
list!.remove(at: index)
break
}
}
CRUserDefaults.recordList = list
let keyValueStore = NSUbiquitousKeyValueStore.default
let list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if var list = list {
for (index, dic) in list.enumerated(){
......@@ -113,17 +126,22 @@ class SHRecordListViewController: SHBaseViewController {
// subDic["deleteDate"] = Date.init()
// list[index] = subDic
list.remove(at: index)
break
}
}
keyValueStore.set(list, forKey: "list")
keyValueStore.synchronize()
}
self.prepareDateSource()
dataSources.remove(at: indexPath.row)
self.tableView?.beginUpdates()
self.tableView?.deleteRows(at: [indexPath], with: .left)
self.tableView?.endUpdates()
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(333)) {
self.prepareDateSource()
}
// let range: Range = model.pathFile.range(of: "/record.wav")!
// let location: Int = model.pathFile.distance(from: model.pathFile.startIndex, to: range.lowerBound)
// let subStr = model.pathFile.prefix(location)
......@@ -146,11 +164,22 @@ class SHRecordListViewController: SHBaseViewController {
@objc func userCilck(){
// if SHUserAccountManager.shared.isMember == false {
self.goGoods()
MobClick.event("home_pop")
let params = ["event": "guazinovel", "action": "", "value": "home_pop"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
// }
}
@objc func preposeMember(){
if SHUserAccountManager.shared.isMember == false {
self.goRecord()
self.goGoods()
MobClick.event("home_pay")
let params = ["event": "guazinovel", "action": "", "value": "home_pay"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
}
......@@ -162,6 +191,12 @@ class SHRecordListViewController: SHBaseViewController {
return
}
}
MobClick.event("home_record")
let params = ["event": "guazinovel", "action": "", "value": "home_record"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
let record = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordViewController") as! SHRecordViewController
self.navigationController?.pushViewController(record, animated: true)
}
......
......@@ -122,7 +122,7 @@ class SHRecordShowViewController: SHBaseViewController {
recordTextView?.attributedText = self.textView_text(model!.txt)
recordTextView?.textContainerInset = UIEdgeInsets.init(top: 20, left: 20, bottom: 20, right: 30)
recordTextView?.isEditable = false
// recordTextView?.isEditable = false
view.layoutIfNeeded()
view.layoutSubviews()
......@@ -169,6 +169,22 @@ class SHRecordShowViewController: SHBaseViewController {
}
}
CRUserDefaults.recordList = list
let keyValueStore = NSUbiquitousKeyValueStore.default
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if var list = list {
for (index, dic) in list.enumerated(){
if dic["pathFile"] as! String == self.model!.pathFile{
var subDic = dic
subDic["rename"] = rename
list[index] = subDic
break
}
}
keyValueStore.set(list, forKey: "list")
keyValueStore.synchronize()
}
}
}, finish: nil)
}
......@@ -298,6 +314,10 @@ class SHRecordShowViewController: SHBaseViewController {
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
MobClick.event("draft_trans_pdf")
let params = ["event": "guazinovel", "action": "", "value": "draft_trans_pdf"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
present(activityVC, animated: true, completion: nil)
......@@ -311,23 +331,37 @@ class SHRecordShowViewController: SHBaseViewController {
do{
let documentsFile_mp3 = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!.appending(model!.pathFile)
let fileURL_wav = URL.init(fileURLWithPath: documentsFile_mp3)
let range: Range = model!.pathFile.range(of: "/record.mp3")!
let location: Int = model!.pathFile.distance(from: model!.pathFile.startIndex, to: range.lowerBound)
let subStr = model!.pathFile.prefix(location)
//没有 先创建 有 直接拿
if FileManager.default.fileExists(atPath: documentsFile_mp3) == false {
let range: Range = model!.pathFile.range(of: "/record.mp3")!
let location: Int = model!.pathFile.distance(from: model!.pathFile.startIndex, to: range.lowerBound)
let subStr = model!.pathFile.prefix(location)
let documentsFile_sub = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!+subStr
let documentsFile_sub = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!+subStr
try! FileManager.default.createDirectory(atPath: documentsFile_sub, withIntermediateDirectories: true, attributes: nil)
try! FileManager.default.createDirectory(atPath: documentsFile_sub, withIntermediateDirectories: true, attributes: nil)
let fileURL_wav = URL.init(fileURLWithPath: documentsFile_mp3)
SHMp3RecordManager.shared().write(model!.fileData, path: documentsFile_mp3)
SHMp3RecordManager.shared().write(model!.fileData, path: documentsFile_mp3)
}
let data_wav = try Data.init(contentsOf: fileURL_wav)
// let data_wav = try Data.init(contentsOf: fileURL_wav)
if FileManager.default.fileExists(atPath: documentsFile_mp3) == false {}
let range: Range = model!.pathFile.range(of: "/record.mp3")!
let location: Int = model!.pathFile.distance(from: model!.pathFile.startIndex, to: range.lowerBound)
let subStr = model!.pathFile.prefix(location)
let documentsFile_rename = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!+subStr+"/\(model!.rename).mp3"
let fileURL_rename = URL.init(fileURLWithPath: documentsFile_rename)
if FileManager.default.fileExists(atPath: documentsFile_rename) == false {
try FileManager.default.copyItem(at: fileURL_wav, to: fileURL_rename)
}
let data_rename = try Data.init(contentsOf: fileURL_rename)
let activityVC = UIActivityViewController(activityItems: [data_wav, fileURL_wav], applicationActivities: nil)
let activityVC = UIActivityViewController(activityItems: [data_rename, fileURL_rename], applicationActivities: nil)
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
......
......@@ -30,6 +30,7 @@ class SHRecordViewController: SHBaseViewController{
private var secondTimer: SHTimer?
private var seconds: NSInteger = 0
private let non_member_limit_seconds: NSInteger = 60
/// 录音计时器
private var waveTimer: SHTimer?
/// 波形更新间隔
......@@ -122,6 +123,11 @@ class SHRecordViewController: SHBaseViewController{
}
@objc func confirmCilck(){
if currentModel == nil {
return
}
stopRecord()
save = true
......@@ -192,7 +198,7 @@ class SHRecordViewController: SHBaseViewController{
@objc @IBAction func recordBtnClick(_ sender:UIButton){
if seconds >= 3 {
if seconds >= non_member_limit_seconds {
let isMember = self.verityMember()
if isMember == false {
return
......@@ -259,6 +265,10 @@ class SHRecordViewController: SHBaseViewController{
let alert = SHMemberUpgradeAlertView.init()
self.view.window?.addSubview(alert)
alert.callBack = {
MobClick.event("record_upgrade")
let params = ["event": "guazinovel", "action": "", "value": "record_upgrade"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
self.goGoods()
}
}
......@@ -450,27 +460,27 @@ class SHRecordViewController: SHBaseViewController{
model.pcmPathFile = pcm_file_path!
model.during = seconds
// let dic = ["time":model.time, "address":model.address, "txt":model.txt, "pathFile":model.pathFile, "during":model.during, "delete":model.delete, "rename":model.rename] as [String : Any]
// var list = CRUserDefaults.recordList
// if list == nil {
// list = [dic]
// }else{
// var contains = false
// for (index, subDic) in list!.enumerated(){
// if (subDic["pathFile"] as! String) == model.pathFile {
// contains = true
// list![index] = dic
// break
// }
// }
// if contains == false {
// list?.append(dic)
// }
// }
// CRUserDefaults.recordList = list
//
// currentModel = model
let dic = ["time":model.time, "address":model.address, "txt":model.txt, "pathFile":model.pathFile, "during":model.during, "delete":model.delete, "rename":model.rename] as [String : Any]
var list = CRUserDefaults.recordList
if list == nil {
list = [dic]
}else{
var contains = false
for (index, subDic) in list!.enumerated(){
if (subDic["pathFile"] as! String) == model.pathFile {
contains = true
list![index] = dic
break
}
}
if contains == false {
list?.append(dic)
}
}
CRUserDefaults.recordList = list
currentModel = model
do{
let documentsFile = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!.appending(model.pathFile)
......@@ -551,7 +561,7 @@ extension SHRecordViewController{
secondsLabel.text = timeString
saveContent()
if seconds == 3 {
if seconds == non_member_limit_seconds {
_ = self.verityMember()
}
}
......@@ -653,6 +663,11 @@ extension SHRecordViewController{
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
MobClick.event("dialog_record_success_trans_pdf")
let params = ["event": "guazinovel", "action": "", "value": "dialog_record_success_trans_pdf"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
present(activityVC, animated: true, completion: nil)
......@@ -666,9 +681,22 @@ extension SHRecordViewController{
do{
let documentsFile_wav = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!.appending(currentModel!.pathFile)
let fileURL_wav = URL.init(fileURLWithPath: documentsFile_wav)
let data_wav = try Data.init(contentsOf: fileURL_wav)
// let data_wav = try Data.init(contentsOf: fileURL_wav)
let range: Range = currentModel!.pathFile.range(of: "/record.mp3")!
let location: Int = currentModel!.pathFile.distance(from: currentModel!.pathFile.startIndex, to: range.lowerBound)
let subStr = currentModel!.pathFile.prefix(location)
let documentsFile_rename = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!+subStr+"/\(currentModel!.rename).mp3"
let fileURL_rename = URL.init(fileURLWithPath: documentsFile_rename)
if FileManager.default.fileExists(atPath: documentsFile_rename) == false {
try FileManager.default.copyItem(at: fileURL_wav, to: fileURL_rename)
}
let data_rename = try Data.init(contentsOf: fileURL_rename)
let activityVC = UIActivityViewController(activityItems: [data_wav, fileURL_wav], applicationActivities: nil)
let activityVC = UIActivityViewController(activityItems: [data_rename, fileURL_rename], applicationActivities: nil)
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
......
......@@ -80,8 +80,8 @@ import SwiftyJSON
func logCollection(with action: CMLogCollecAction, value: String = "") {
let params = ["event": "guazinovel", "action": action.rawValue, "value": value]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
func getNovelInfo(_ success: @escaping((JSON)->Void)) {
......
......@@ -266,7 +266,8 @@ private extension CMNetworkManager {
params["w"] = String(format: "%.0f", UIScreen.main.bounds.width)
params["h"] = String(format: "%.0f", UIScreen.main.bounds.height)
params["model"] = UIDevice.current.model
params["vc"] = UIDevice.appVersion
params["vc"] = UIDevice.appBundleVersion
params["vn"] = UIDevice.appVersion
params["platform"] = "ios"
params["pkg"] = Bundle.main.bundleIdentifier
params["appLs"] = "2eb3fbed00dc4752"
......
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