123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- #import <Foundation/Foundation.h>
- #if TARGET_OS_IOS
- #import <WebKit/WebKit.h>
- #endif
- #if TARGET_OS_IOS
- typedef NS_ENUM(NSUInteger, TDProfileType) {
- TDProfileTypeAnonymous = 0,
- TDProfileTypeRegistered = 1,
- TDProfileTypeSinaWeibo = 2,
- TDProfileTypeQQ = 3,
- TDProfileTypeTencentWeibo = 4,
- TDProfileTypeND91 = 5,
- TDProfileTypeWeiXin = 6,
- TDProfileTypeType1 = 11,
- TDProfileTypeType2 = 12,
- TDProfileTypeType3 = 13,
- TDProfileTypeType4 = 14,
- TDProfileTypeType5 = 15,
- TDProfileTypeType6 = 16,
- TDProfileTypeType7 = 17,
- TDProfileTypeType8 = 18,
- TDProfileTypeType9 = 19,
- TDProfileTypeType10 = 20
- };
- #endif
- #if TARGET_OS_IOS
- @interface TalkingDataOrder : NSObject
- + (TalkingDataOrder *)createOrder:(NSString *)orderId total:(int)total currencyType:(NSString *)currencyType;
- - (TalkingDataOrder *)addItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
- @end
- @interface TalkingDataShoppingCart : NSObject
- + (TalkingDataShoppingCart *)createShoppingCart;
- - (TalkingDataShoppingCart *)addItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
- @end
- #endif
- typedef NS_ENUM(NSUInteger, TDVendorIdType) {
- TDVendorIdTypeZX = 1,
- TDVendorIdTypeGX = 2,
- };
- @interface TalkingData: NSObject
- + (NSString *)getDeviceID;
- + (void)setVendorID:(NSString *)vendorID ofType:(TDVendorIdType)type;
- + (void)setLogEnabled:(BOOL)enable;
- #if TARGET_OS_IOS
- + (void)setExceptionReportEnabled:(BOOL)enable;
- + (void)setSignalReportEnabled:(BOOL)enable;
- #endif
- #if TARGET_OS_IOS
- + (void)setLatitude:(double)latitude longitude:(double)longitude;
- #endif
- + (void)backgroundSessionEnabled;
- #if TARGET_OS_IOS
- + (void)sessionStarted:(NSString *)appKey withChannelId:(NSString *)channelId;
- #endif
- + (void)setProfileId:(NSString *)profileId API_DEPRECATED("", ios(1, 1));
- #if TARGET_OS_IOS
- + (void)onRegister:(NSString *)profileId type:(TDProfileType)type name:(NSString *)name;
- + (void)onLogin:(NSString *)profileId type:(TDProfileType)type name:(NSString *)name;
- #endif
- + (void)trackEvent:(NSString *)eventId;
- + (void)trackEvent:(NSString *)eventId label:(NSString *)eventLabel;
- + (void)trackEvent:(NSString *)eventId
- label:(NSString *)eventLabel
- parameters:(NSDictionary *)parameters;
- + (void)trackEvent:(NSString *)eventId
- label:(NSString *)eventLabel
- parameters:(NSDictionary *)parameters
- value:(double)eventValue;
- + (void)setGlobalKV:(NSString *)key value:(id)value;
- + (void)removeGlobalKV:(NSString *)key;
- + (void)trackPageBegin:(NSString *)pageName;
- + (void)trackPageEnd:(NSString *)pageName;
- #if TARGET_OS_IOS
- + (void)onPlaceOrder:(NSString *)profileId order:(TalkingDataOrder *)order API_DEPRECATED_WITH_REPLACEMENT("onPlaceOrder:amount:currencyType:", ios(1, 1));
- + (void)onOrderPaySucc:(NSString *)profileId payType:(NSString *)payType order:(TalkingDataOrder *)order API_DEPRECATED_WITH_REPLACEMENT("onOrderPaySucc:amount:currencyType:paymentType:", ios(1, 1));
- + (void)onPlaceOrder:(NSString *)orderId amount:(int)amount currencyType:(NSString *)currencyType;
- + (void)onOrderPaySucc:(NSString *)orderId amount:(int)amount currencyType:(NSString *)currencyType paymentType:(NSString *)paymentType;
- + (void)onCancelOrder:(NSString *)orderId amount:(int)amount currencyType:(NSString *)currencyType;
- + (void)onViewItem:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice;
- + (void)onAddItemToShoppingCart:(NSString *)itemId category:(NSString *)category name:(NSString *)name unitPrice:(int)unitPrice amount:(int)amount;
- + (void)onViewShoppingCart:(TalkingDataShoppingCart *)shoppingCart;
- #endif
- #if TARGET_OS_IOS
- + (BOOL)handleUrl:(NSURL *)url;
- + (void)bindWKWebView:(WKWebView*)wkwebview API_AVAILABLE(ios(8.0));
- + (void)loadWKWebViewConfig:(WKWebView*)wkwebview API_AVAILABLE(ios(8.0));
- #endif
- @end
|