Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
[super load];
[self aspect_hookSelector:@selector(viewWillAppear:) withOptions:0 usingBlock:^(id<AspectInfo> info, BOOL animated) {
HDFAppLog(@"**************==");
NSString *currentPageName = [[info instance] hdf_className]; //页面名称,如:HDFSearchHospitalViewController
//FireBaseAnalytics
[FIRAnalytics logEventWithName:"page" parameters:{
"pageName":currentPageName
//GoogleAnalystics
id<GAITracker> tracker = [GAI sharedInstance].defaultTracker; //调用默认跟踪器
[tracker set:kGAIScreenName value:currentPageName];
[tracker send:[[GAIDictionaryBuilder createScreenView]build]];
} error:NULL];
use FIRAnalytics like this,
but it print error below:
FIRAnalytics/DEBUG> No network. Upload task will not be scheduled
and these:
2016-10-10 15:01:58.038 newPatient[8480:] FIRAnalytics/DEBUG> Do not schedule an upload task. Task already exists
2016-10-10 15:02:07.134 newPatient[8480:] FIRAnalytics/DEBUG> Network status has changed. Code, status: 1, Disconnected
2016-10-10 15:02:07.136 newPatient[8480:] FIRAnalytics/ERROR> Encounter network error. Code, error: -1003, Error Domain=NSURLErrorDomain Code=-1003 "未能找到使用指定主机名的服务器。" UserInfo={NSUnderlyingError=0x7fbf305dcd30 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, NSErrorFailingURLKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=未能找到使用指定主机名的服务器。}
2016-10-10 15:02:07.138 newPatient[8480:] FIRAnalytics/DEBUG> Fetched configuration. Status code: 0
2016-10-10 15:02:07.138 newPatient[8480:] FIRAnalytics/DEBUG> Unable to get the configuration from server. Network request failed. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-1003 "未能找到使用指定主机名的服务器。" UserInfo={NSUnderlyingError=0x7fbf305dcd30 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, NSErrorFailingURLKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=未能找到使用指定主机名的服务器。}
2016-10-10 15:02:07.139 newPatient[8480:] FIRAnalytics/DEBUG> Network fetch failed. Will retry later. Code, error: 0, Error Domain=NSURLErrorDomain Code=-1003 "未能找到使用指定主机名的服务器。" UserInfo={NSUnderlyingError=0x7fbf305dcd30 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, NSErrorFailingURLKey=
https://app-measurement.com/config/app/1:442821079824:ios:88cc404211cdcfea?platform=ios&app_instance_id=1419B4CCA10A4607861CEDB35CB95174&gmp_version=3403
, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=未能找到使用指定主机名的服务器。}
2016-10-10 15:02:07.139 newPatient[8480:] FIRAnalytics/DEBUG> No network. Upload task will not be scheduled
2016-10-10 15:02:07.139 newPatient[8480:] FIRAnalytics/DEBUG> Canceling active timer
2016-10-10 15:02:27.958 newPatient[8480:13764850] Firebase/Network/ERROR> Encounter network error. Code, error: -1001, Error Domain=NSURLErrorDomain Code=-1001 "请求超时。" UserInfo={NSErrorFailingURLStringKey=
https://play.googleapis.com/log
, NSErrorFailingURLKey=
https://play.googleapis.com/log
, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2103, NSLocalizedDescription=请求超时。}
2016-10-10 15:02:27.961 newPatient[8480] [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1001 "请求超时。" UserInfo={NSErrorFailingURLStringKey=
https://play.googleapis.com/log
, NSErrorFailingURLKey=
https://play.googleapis.com/log
, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2103, NSLocalizedDescription=请求超时。}, with Status Code: 0
debug logs below:
2016-10-10 11:38:58.152 newPatient[7428:] FIRAnalytics/DEBUG> Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: page, {
"_dbg" = 1;
"_o" = app;
"_r" = 1;
pageName = HDFPhDoctorIntroduceViewController;
–
–
–
There is either no network connection or your network condition is flaky that it could not send data to the server. If there is no network, it will not schedule upload task. Sometimes, depending on where you are from, the network traffic might be filtered so it also fail to upload data. I think this is normal behavior.
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.