用户工具

站点工具


差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
en:razor:ios-developer-guide [2015/03/18 15:52]
cobub [2.2 SDK Usage Step]
en:razor:ios-developer-guide [2017/07/14 11:18] (当前版本)
行 1: 行 1:
 +~~Title:​Cobub Razor iOS Developer Guide - Mobile Apps Marketing Platform of Open Source - Mobile Analytics & Mobile Push Notification Solutions - Cobub Mobile Developer Center~~
 +{{description>​Cobub Razor is an Open Source Mobile Analytics. The goal of this document is to explain usage rules of Cobub Razor iOS SDK for facilitating developers.}}
 +{{keywords>​Cobub Razor,open source mobile analytics,​mobile analytics,​mobile app analytics, ios, developer guide}}
 +
 ====== Cobub Razor iOS Developer Guide ====== ====== Cobub Razor iOS Developer Guide ======
 ===== 1   ​Overview ===== ===== 1   ​Overview =====
行 28: 行 32:
  
 Select Add->​Existing files in project directory and select the two unzipped files above, or drag two files to project directory directly. Select Copy Items into destination group’s folder(if needed). Select Add->​Existing files in project directory and select the two unzipped files above, or drag two files to project directory directly. Select Copy Items into destination group’s folder(if needed).
 +
 {{:​en:​razor:​20150318-075044.png}} {{:​en:​razor:​20150318-075044.png}}
  
-2.2.3   Add Dependent Framework+=== 2.2.3   Add Dependent Framework ​=== 
  
 To obtain network info and operator logo, you need adding CoreTelephony Class Library. To obtain network info and operator logo, you need adding CoreTelephony Class Library.
 {{:​en:​razor:​20150318-075129.png}} {{:​en:​razor:​20150318-075129.png}}
  
 +=== 2.2.4   Setup Other Linker Flags ===
 +
 +
 +Add –all_load and –ObjC flags
 +{{:​en:​razor:​20150318-075233.png}}
 +
 +=== 2.2.5   Embed Code ===
 +
 +
 +Add #import “UMSAgent.h” into AppDelegate.h. Add following method into didFinishLaunchingWithOptions method of AppDelegate.m:​
 +<​code>​[UMSAgent startWithAppKey:​@"​14aaa92e098df46cb63ed5196e0c331c"​ ReportPolicy:​BATCH ServerURL:@
 +"YOUR SDK SERVICE URL"];
 +-(BOOL)application:​(UIApplication *)application didFinishLaunchingWithOptions:​(NSDictionary *)
 +launchOptions
 +{
 +[UMSAgent startWith]AppKey:​@"​UMSAgentKey"​ ReportPolicy:​BATCH];​
 +}</​code>​
 +
 +UMSAgentKey is the AgentKey obtained from registering App in UMS.
 +
 +ServiceURL is Service interface url of  Server SDK.
 +
 +BATCH model means that uploading data once when system starts next time
 +
 +Please modify BATCH to REALTIME if you want to use real-time model.
 +
 +BATCH model is recommended. It can reduce interaction between App and network, save traffic and improve user experience
 +
 +**Usage Duration Analytics**
 +
 +UMS platform defines intervals between entering front and entering background of App every time as a lifecycle process. UMS makes lifecycle as data and submits it to UMS background. It provides corresponding data statistics reports for developers.
 +
 +=== 2.2.6   ​Custom Event ===
 +
 +Custom event is used to provide more detailed user behavior analysis for app developers. Adding custom event in UMS background in advance before using it and obtaining Event_identifier of event. Thus, the system can do corresponding processing in background. Otherwise,it do not process unregistered event of client.
 +
 +== 2.2.6.1 Simple Event ==
 +
 +<​code>​+(void)postEvent:​(NSString *)event_id;
 +event_id: the ID of current event, defined on  the Web Server and could not have spaces.</​code>​
 +
 +
 +Invoke this API will send event info to the server and generate the event data statistics report on the server which analyzes sending times and changing trends corresponding to event_id, such as AD clicks, message numbers and so on.
 +
 +For example, to monitor AD clicks of App, the Event ID  of which is “ ad_click“ defined on the Web Server, you need call  //​postEvent:​@“ad_click“// ​ in App , which will notify server that an AD click event has occurred.
 +
 +== 2.2.6.2 ​ Multi Tag Event ==
 +
 +<​code>​+(void)postEvent:​(NSString *)event_id label:​(NSString *)label;</​code>​
 +
 +This API is an overloaded method of  //​postEvent:​ (NSString *)// event_id which will monitor the proportion of specific label in event. The label is the devision name and event_id could not have spaces.
 +
 +For example, a province has a corresponding event_id and one city of which has a corresponding label in App. Thus, we can observe the proportion of event corresponding to the city in generated data statistics reports.
 +
 +== 2.2.6.3 Accumulative Event ==
 +
 +<​code>​+(void)postEvent:​(NSString *)event_id acc:​(NSInteger)acc;</​code>​
 +
 +For the frequent events ,you can maintain a counter for them. In this way, event that are triggered by many times will just generate one message and be sent to the server. This message ​ includes triggered times of this event.
 +
 +Here is overloaded two APIs:
 +<​code>​+(void)postEvent:​(NSString *)event_id acc:​(NSInteger)acc;​
 ++(void)postEvnet:​(NSString *)event_id label:​(NSString *)label acc:​(NSInteger)acc;</​code>​
 +
 +acc: triggered times of corresponding event.
 +
 +== 2.2.7 Auto Update ==
 +
 +<​code>​[UMSAgent checkUpdate];</​code>​
 +
 +Invoke this API when you want the APP to check that whether Web Server has a new version of the App automatically.
 +
 +If you already create a new version on the Web Server, your App will notify user to upgrade the APP. Users  can choose to upgrade it or not.
 +
 +Cobub Razor background provides a single Key for every channel of every App. Please change to different Key when providing update for different channels.
 +
 +=== 2.2.8   ​Online Configuration ===
 +
 +<​code>​[IMSAgent setOnLineConfig:​false];</​code>​
 +
 +Invoke this API in //​didFinishLaunchingWithOptions//​ method of AppDelegate.m and SDK will get your online configuration on the server and store this info in local if you choose true, or will not.
 +
 +=== 2.2.9   Page View ===
 +
 +<​code>​+(void)startTracPage:​(NSString*)page_name;</​code>​
 +
 +Call this API in //​viewWillAppear()//​ method in App(UIViewController),​ this method records the time of user enters this page.
 +<​code>​-(void) //​viewWillAppear(BOOL)animated//​
 +{
 + [UMSAgent startTracPage:​@"​Main"​];​
 +}
 ++(void)endTracPage:​(NSString*)page_name;</​code>​
 +
 +Call this API in viewWillDisappear() method in App(UIViewController),​ this method records the time of user leaves this page.
 +<​code>​-(void) viewWillDisappear:​(BOOL)animation {
 +    [UMSAgent endTracPage:​@"​Main"​];​
 +}</​code>​
 +
 +Note: You need to call 2 APIs  above in pair.
 +
 +=== 2.2.10 Bind User account ===
 +
 +<​code>​[UMSAgetnt bindUserIdentifier:​@"​userid"​];</​code>​
 +
 +You can bind user account to your app when this metheod was called.
 +
 +=== 2.2.11 Bind Tags ===
 +
 +<​code>​[UMSAgetnt postTag:​@"​tag"​];</​code>​
  
 +User can bind tag information,​ and send it to server. Later the tags will be used to group users.
en/razor/ios-developer-guide.1426665122.txt.gz · 最后更改: 2017/07/14 11:12 (外部编辑)