Conviva Client Library  2.187.0.0
app_tracker.h
1 //
2 // Copyright (c) 2014 Conviva. All rights reserved.
3 //
4 
8 
9 
15 
16 #ifndef APPTRACKER_H
17 #define APPTRACKER_H
18 
19 #include "ccl_dictionary.h"
20 
21 #define CAT_MAX_APP_NAME_LENGTH 64
22 #define CAT_MAX_USER_ID_LENGTH 64
23 #define CAT_MAX_IID_LENGTH 64
24 
25 #define CCL_APP_MAX_SCREEN_NAME_LEN 1024
26 #define CCL_APP_MAX_SCREEN_ID_LEN 38
27 
28 // Network Reequest Info Constants
29 #define CAT_MAX_URL_LENGTH 1024
30 #define CAT_MAX_METHOD_LENGTH 15
31 #define CAT_MAX_BODY_LENGTH 10000 // 10 KB
32 
33 #define CAT_MEMORY_ERROR -1
34 #define CAT_MUTEX_ERROR -2
35 #define CAT_INPUT_ERROR -3
36 #define CAT_TIMER_ERROR -4
37 #define CAT_ERROR 0
38 #define CAT_SUCCESS 1
39 
40 #define CAT_MAX_APP_BUILD_LENGTH 64
41 #define CAT_MAX_APP_VERSION_LENGTH 64
42 
43 
45 typedef struct cat_network_request_info {
57 
64  void *request_body;
68 
70 typedef struct cat_anr_info {
72  uint64_t anr_start;
74  char *anr_reason;
76 
78 typedef struct cat_app_info {
84 
87  uint64_t app_load_start;
89  uint64_t app_load_end;
91 
92 
94 typedef enum cat_error_lang {
95  CAT_ERROR_LANG_UNKNOWN = 0, // Unknown language
121 
122 #define STR_MAX_LEN_1024 1024
123 #define STR_MAX_LEN_2048 2048
124 #define STR_MAX_LEN_8192 8192
125 
127 typedef struct cat_app_error_info {
132  char *error_msg;
133 
136  char *thread_name;
140  char *stack_trace;
148  char *class_name;
152  char *file_name;
154  int is_fatal;
156 
157 
159 typedef struct cat_screen_info {
162  char *screen_name;
163 
166  char *screen_type;
170  uint64_t load_start;
172  uint64_t load_end;
174 
175 
179 int cat_set_user_id(const char* uid);
180 
185 int cat_send_custom_event(const char *name, ccl_dictionary_t *attributes);
186 
190 int cat_track_screen_view(cat_screen_info_t *screen_info);
191 
196 
201 int cat_pause_tracker(void);
202 
207 int cat_resume_tracker(void);
208 
213 int cat_track_app_install(void);
214 
221 
227 int cat_track_anr(cat_anr_info_t *anr_info);
228 
229 
236 
243 
250 int cat_clear_custom_tags(char *keys[], int key_count);
251 
257 
258 
259 
260 #endif /* APPTRACKER_H*/
261 
CAT_ERROR_LANG_JAVA
@ CAT_ERROR_LANG_JAVA
Definition: app_tracker.h:96
cat_track_app_install
int cat_track_app_install(void)
notifies the app install event, normally calls on fresh launch after install or upgrade
cat_app_info::app_version
char app_version[CAT_MAX_APP_VERSION_LENGTH]
Definition: app_tracker.h:83
cat_app_error_info::stack_trace
char * stack_trace
Definition: app_tracker.h:140
CAT_ERROR_LANG_RUBY
@ CAT_ERROR_LANG_RUBY
Definition: app_tracker.h:100
CAT_ERROR_LANG_JAVASCRIPT
@ CAT_ERROR_LANG_JAVASCRIPT
Definition: app_tracker.h:102
cat_network_request_info::request_body
void * request_body
Definition: app_tracker.h:64
CAT_ERROR_LANG_C
@ CAT_ERROR_LANG_C
Definition: app_tracker.h:107
ccl_dictionary_t
struct ccl_dictionary ccl_dictionary_t
Definition: ccl_dictionary.h:18
CAT_ERROR_LANG_ELIXIR
@ CAT_ERROR_LANG_ELIXIR
Definition: app_tracker.h:116
cat_screen_info::load_end
uint64_t load_end
Definition: app_tracker.h:172
cat_clear_all_custom_tags
int cat_clear_all_custom_tags()
clear all custom tags
cat_network_request_info::response_body
void * response_body
Definition: app_tracker.h:66
cat_anr_info
Application Not Responding details.
Definition: app_tracker.h:70
cat_anr_info_t
struct cat_anr_info cat_anr_info_t
Application Not Responding details.
cat_network_request_info::request_timestamp
uint64_t request_timestamp
Definition: app_tracker.h:54
cat_app_error_info::file_name
char * file_name
Definition: app_tracker.h:152
CAT_ERROR_LANG_CLOJURE
@ CAT_ERROR_LANG_CLOJURE
Definition: app_tracker.h:114
cat_app_error_info::error_lang
cat_error_lang_t error_lang
Definition: app_tracker.h:130
CAT_MAX_APP_BUILD_LENGTH
#define CAT_MAX_APP_BUILD_LENGTH
Definition: app_tracker.h:40
cat_app_error_info_t
struct cat_app_error_info cat_app_error_info_t
Application Error Information.
cat_anr_info::anr_reason
char * anr_reason
Definition: app_tracker.h:74
cat_app_info::app_build
char app_build[CAT_MAX_APP_BUILD_LENGTH]
Definition: app_tracker.h:81
cat_app_error_info::is_fatal
int is_fatal
Definition: app_tracker.h:154
cat_network_request_info
Use to set the network request details.
Definition: app_tracker.h:45
cat_app_error_info::line_column
int line_column
Definition: app_tracker.h:146
cat_app_info::app_load_end
uint64_t app_load_end
Definition: app_tracker.h:89
cat_app_error_info::class_name
char * class_name
Definition: app_tracker.h:148
CAT_ERROR_LANG_RUST
@ CAT_ERROR_LANG_RUST
Definition: app_tracker.h:112
CAT_ERROR_LANG_CPLUSPLUS
@ CAT_ERROR_LANG_CPLUSPLUS
Definition: app_tracker.h:108
cat_app_info_t
struct cat_app_info cat_app_info_t
Use to set the application details.
CAT_ERROR_LANG_ERLANG
@ CAT_ERROR_LANG_ERLANG
Definition: app_tracker.h:115
cat_screen_info_t
struct cat_screen_info cat_screen_info_t
Screen details.
cat_set_application_info
int cat_set_application_info(cat_app_info_t *app_info)
set application info, can set right after the tracker creation.
cat_error_lang
cat_error_lang
Language of the error message.
Definition: app_tracker.h:94
cat_screen_info::screen_transition_type
char * screen_transition_type
Definition: app_tracker.h:168
CAT_ERROR_LANG_HASKELL
@ CAT_ERROR_LANG_HASKELL
Definition: app_tracker.h:113
cat_network_request_info::response_code
int response_code
Definition: app_tracker.h:52
CAT_ERROR_LANG_NIM
@ CAT_ERROR_LANG_NIM
Definition: app_tracker.h:119
CAT_ERROR_LANG_UNKNOWN
@ CAT_ERROR_LANG_UNKNOWN
Definition: app_tracker.h:95
cat_set_user_id
int cat_set_user_id(const char *uid)
Sets the user ID for ECO.
cat_app_error_info::cause_stack_trace
char * cause_stack_trace
Definition: app_tracker.h:142
CAT_ERROR_LANG_OBJECTIVEC
@ CAT_ERROR_LANG_OBJECTIVEC
Definition: app_tracker.h:105
cat_network_request_info::request_header
void * request_header
Definition: app_tracker.h:60
cat_screen_info
Screen details.
Definition: app_tracker.h:159
cat_network_request_info::response_header
void * response_header
Definition: app_tracker.h:62
cat_pause_tracker
int cat_pause_tracker(void)
pause the app tracker to stop monitoring
CAT_ERROR_LANG_LUA
@ CAT_ERROR_LANG_LUA
Definition: app_tracker.h:111
CAT_MAX_URL_LENGTH
#define CAT_MAX_URL_LENGTH
Definition: app_tracker.h:29
cat_app_error_info::exception_name
char * exception_name
Definition: app_tracker.h:150
CAT_ERROR_LANG_KOTLIN
@ CAT_ERROR_LANG_KOTLIN
Definition: app_tracker.h:98
cat_app_error_info
Application Error Information.
Definition: app_tracker.h:127
CAT_ERROR_LANG_CSHARP
@ CAT_ERROR_LANG_CSHARP
Definition: app_tracker.h:109
cat_clear_custom_tags
int cat_clear_custom_tags(char *keys[], int key_count)
clear the specific custom tags with keys
cat_app_info::app_load_start
uint64_t app_load_start
Definition: app_tracker.h:87
cat_screen_info::screen_type
char * screen_type
Definition: app_tracker.h:166
CAT_ERROR_LANG_GROOVY
@ CAT_ERROR_LANG_GROOVY
Definition: app_tracker.h:99
CAT_ERROR_LANG_ACTIONSCRIPT
@ CAT_ERROR_LANG_ACTIONSCRIPT
Definition: app_tracker.h:110
cat_app_info
Use to set the application details.
Definition: app_tracker.h:78
cat_set_custom_tags
int cat_set_custom_tags(ccl_dictionary_t *tags)
set the custom tags
cat_app_error_info::thread_name
char * thread_name
Definition: app_tracker.h:136
CAT_ERROR_LANG_SCALA
@ CAT_ERROR_LANG_SCALA
Definition: app_tracker.h:97
CAT_ERROR_LANG_PYTHON
@ CAT_ERROR_LANG_PYTHON
Definition: app_tracker.h:104
cat_app_error_info::thread_id
int thread_id
Definition: app_tracker.h:138
CAT_ERROR_LANG_PONY
@ CAT_ERROR_LANG_PONY
Definition: app_tracker.h:118
cat_resume_tracker
int cat_resume_tracker(void)
resume the app tracker to start monitoring again
cat_app_error_info::line_number
int line_number
Definition: app_tracker.h:144
CAT_ERROR_LANG_CRYSTAL
@ CAT_ERROR_LANG_CRYSTAL
Definition: app_tracker.h:117
cat_error_lang_t
enum cat_error_lang cat_error_lang_t
Language of the error message.
cat_network_request_info::target_url
char target_url[CAT_MAX_URL_LENGTH]
Definition: app_tracker.h:48
cat_track_screen_view
int cat_track_screen_view(cat_screen_info_t *screen_info)
send the screen info
cat_screen_info::load_start
uint64_t load_start
Definition: app_tracker.h:170
cat_track_network_request
int cat_track_network_request(cat_network_request_info_t *nw_info)
send the network request info to eco
cat_app_error_info::error_msg
char * error_msg
Definition: app_tracker.h:132
CAT_ERROR_LANG_GOLANG
@ CAT_ERROR_LANG_GOLANG
Definition: app_tracker.h:101
cat_track_application_error
int cat_track_application_error(cat_app_error_info_t *error_info)
send the application error to eco, use this API for realtime error tracking.
cat_send_custom_event
int cat_send_custom_event(const char *name, ccl_dictionary_t *attributes)
send custom event to eco
cat_network_request_info::response_timestamp
uint64_t response_timestamp
Definition: app_tracker.h:56
CAT_MAX_METHOD_LENGTH
#define CAT_MAX_METHOD_LENGTH
Definition: app_tracker.h:30
cat_network_request_info_t
struct cat_network_request_info cat_network_request_info_t
Use to set the network request details.
CAT_ERROR_LANG_SWIFT
@ CAT_ERROR_LANG_SWIFT
Definition: app_tracker.h:106
cat_network_request_info::method
char method[CAT_MAX_METHOD_LENGTH]
Definition: app_tracker.h:50
CAT_MAX_APP_VERSION_LENGTH
#define CAT_MAX_APP_VERSION_LENGTH
Definition: app_tracker.h:41
CAT_ERROR_LANG_PHP
@ CAT_ERROR_LANG_PHP
Definition: app_tracker.h:103
cat_anr_info::anr_start
uint64_t anr_start
Definition: app_tracker.h:72
cat_screen_info::screen_name
char * screen_name
Definition: app_tracker.h:162
cat_track_anr
int cat_track_anr(cat_anr_info_t *anr_info)
send the ANR(application not responding) event, shall send on unrecovered ANRs on next launch.