This article reproduced to http://blog.csdn.net/woaifen3344/article/details/41284395 Friends League statistics Umanalyticsios Friends League statistics iOS Umanalytics
It is very convenient to use the Friend League statistic function in the project, first of all we have to go to the Friend League open platform to look at the document, not much to say, is to write me a demo
To a friend in need, here I encapsulated the Friends of the statistics function, only need to import this class, it can be very convenient to use:
[OBJC]View Plaincopyprint?
- //
- HYBUMAnalyticsHelper.h
- Umanalyticsdemo
- //
- Created by Huangyi mark on 14/11/19.
- Copyright (c) 2014 Huangyi mark. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- /*!
- * @brief AU statistics function related Operations API encapsulation
- *
- * @author Huangyibiao
- */
- @interface Hybumanalyticshelper:nsobject
- /*!
- * Activate the Friends League statistics function
- */
- + (void) Umanalyticstart;
- The viewwillappear call to get the correct page access path, access depth (PV) data
- + (void) Beginlogpageview: (__unsafe_unretained Class) PageView;
- The viewdiddisappeary call to get the correct page access path, access depth (PV) data
- + (void) Endlogpageview: (__unsafe_unretained Class) PageView;
- @end
[OBJC]View Plaincopyprint?
- //
- Hybumanalyticshelper.m
- Umanalyticsdemo
- //
- Created by Huangyi mark on 14/11/19.
- Copyright (c) 2014 Huangyi mark. All rights reserved.
- //
- #import "HYBUMAnalyticsHelper.h"
- #import "MobClick.h"
- #define Kumanalyticsappkey @ "546c4457fd98c5cb9a00319d"
- @implementation Hybumanalyticshelper
- + (void) Umanalyticstart {
- [Mobclick startwithappkey:kumanalyticsappkey reportpolicy:batch channelid:@ "App Store"];
- //Version ID
- nsstring *version = [[[NSBundle Mainbundle] infodictionary] objectforkey:@ " Cfbundleshortversionstring "];
- [Mobclick setappversion:version];
- #if DEBUG
- //Open the Friend League SDK debugging, note that the release needs to comment out this line, reduce IO consumption
- [Mobclick setlogenabled:YES];
- #endif
- return;
- }
- + (void) Beginlogpageview: (__unsafe_unretained Class) PageView {
- [Mobclick Beginlogpageview:nsstringfromclass (PageView)];
- return;
- }
- + (void) Endlogpageview: (__unsafe_unretained Class) PageView {
- [Mobclick Endlogpageview:nsstringfromclass (PageView)];
- return;
- }
- @end
To see the source code, go to my github to download it: Https://github.com/632840804/UMAnalyticsDemo
How to use IOS Friends League statistics