在哪裏可以找到關於如何使用IBM MobileFirst在本機iOS應用程序中使用Objective-C進行自定義分析的示例?如何使用MobileFirst在本機iOS中使用自定義分析?
我希望能夠在MobileFirst分析控制檯中創建自定義值分析圖表。
我嘗試了不同的編碼版本,要做到這一點,但它不工作
NSDictionary *stringInventory = @{
@"GERMANY" : @"1",
@"USA" : @"2",
@"GREECE" : @"3",
@"UK" : @"4",
};
NSDictionary *inventory = @{
@"GERMANY" : [NSNumber numberWithInt:1],
@"USA" : [NSNumber numberWithInt:2],
@"GREECE" : [NSNumber numberWithInt:3],
@"UK" : [NSNumber numberWithInt:3],
};
// OPTION 1
// *******
OCLogger *logger = [OCLogger getInstanceWithPackage:@"CalculatorViewController"]; // IBM MF LOGGER
[OCLogger setCapture:TRUE]; // IBM MF LOGGER
[OCLogger setAutoSendLogs:TRUE]; // IBM MF LOGGER
[logger log:@"success - online"]; // IBM MF LOGGER
[logger log:@"Using OCLogger for WL Analytis"]; // IBM MF LOGGER
[logger logWithLevel:OCLogger_ANALYTICS message:@"This is a Analyitics Message CalculatorViewController:onSuccess" args:@"USA" userInfo:inventory]; // IBM MF LOGGER
[logger logWithLevel:OCLogger_ANALYTICS message:@"This is a Analyitics Message CalculatorViewController:onSuccess" args:@"GERMANY" userInfo:stringInventory]; // IBM MF LOGGER
// Option 2
// ********
WLAnalytics *doAnaylitics = [WLAnalytics sharedInstance]; // IBM MF ANALYTICS
[doAnaylitics enable]; // IBM MF ANALYTICS
[doAnaylitics log:@"MY ANALYITIS LOG" withMetadata:inventory[@"GERMANY"]]; // IBM MF ANALYTICS
[doAnaylitics send]; // IBM MF ANALYTICS
//[doAnaylitics setValuesForKeysWithDictionary:stringInventory]; // IBM MF Analytics
[doAnaylitics log:@"MY ANALYITIS LOG" withMetadata:stringInventory[@"USA"]];
[doAnaylitics send]; // IBM MF ANALYTICS
[doAnaylitics disable]; // IBM MF ANALYTICS
我發現this getting started但對於Objective-C的沒有樣品。
This? https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/advanced-client-side-development/remote-controlled-client-side-log-collection/logging-native-ios-objective- c/ –
Idan @感謝您的快速反饋: 但是這並沒有真正的幫助,因爲OCLogger基本上適用於「非定製分析」主題。最後,我希望能夠在MF Analytics Console中創建自定義圖表。 我可能會操作[logger logWithLevel:<#(OCLogType)#> message:<#(NSString *)#> args:<#(va_list)#> userInfo:<#(NSDictionary *)#>]會有所幫助。使用「OCLogger_ANALYTICS」作爲類型,但沒有奏效。所以我試圖使用WLAnalytics類,但沒有工作。 我做錯了什麼......但是什麼? –