将RCAnalytics作为依赖项添加
target 'MyAppTargetHere' do
use_frameworks!
pod "RCAnalytics", "~> 0.2.0"
end
安装依赖项
$> pod install
在应用程序启动时初始化RCAnalytics
Swift中使用
import UIKit;
import RCAnalytics;
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// called after your app launches
func application(
application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?
) -> Bool {
RCAnalytics.create("your-product-id-here").launch(); // Launch RCAnalytics
return true;
}
}
Objective-C中使用
#import "AppDelegate.h"
#import <Foundation/Foundation.h>
@import RCAnalytics;
@implementation AppDelegate
// called after your app launches
-(BOOL)
application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[RCAnalytics create:@"your-product-id-here"] launch]; // Launch RCAnalytics
return YES;
}
@end
Reelcontent, Inc., [email protected]
RCAnalytics可在MIT许可协议下使用。有关更多信息,请参阅LICENSE文件。