ios 友盟統計

來源:互聯網
上載者:User

標籤:count   instance   conf   account   eww   bool   port   部落格   base   

  最近一直在忙 版本大改  所以想分享的東西沒寫到部落格  今天就來分享下友盟統計的使用  1.下載sdk 2.方法封裝 3.在合適的地方調用

 我們在工程裡建立一個基類控制器  BaseViewController   因為這樣 我們把統計方法寫進去 子類自然有統計功能   我沒有專門針對一個點擊事件寫統計方法 不過基本道理一樣

  建立一個類 用來寫統計方法  可以複製出去使用

#import <Foundation/Foundation.h>

@interface UMUtils : NSObject

 //配置友盟

+(void)umRegister;///////  需要我們在appdelegate 裡面實現  [UMUtils umRegister];//友盟

 //帳號統計

+(void)userAccountWithPUID:(NSString *)PUID;////////傳入你要統計的帳號 一般在登入成功的時候  把手機號或者使用者名稱傳進去

 //頁面統計 在 -(void)viewWillAppear:(BOOL)animated中使用

 

+(void)beginLogPageView:(NSString *)pageName;

 //頁面統計 在 -(void)viewWillDisappear:(BOOL)animated中使用

+(void)endLogPageView:(NSString *)pageName;

 //帳號退出登入時 不在發送帳號相關內容

+(void)userLoginOut;///////////退出登入時調用     不在發送帳號的相關資訊 

 @end

///////////////////////////////////////實現

#import "UMUtils.h"

#import <UMMobClick/MobClick.h>

 @implementation UMUtils

 +(void)umRegister{

    [email protected]"你申請的友盟appkey";

    [email protected]"App Store";

    [MobClick startWithConfigure:UMConfigInstance];

    }

 +(void)userAccountWithPUID:(NSString *)PUID{

    [MobClick profileSignInWithPUID:PUID];

    }

 +(void)beginLogPageView:(NSString *)pageName{

       [MobClick beginLogPageView:pageName];

  }

 +(void)endLogPageView:(NSString *)pageName{

     [MobClick endLogPageView:pageName];

 }

 +(void)userLoginOut{

    [MobClick profileSignOff];

  }

 

ios 友盟統計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.