FireBase Analytics
Some Times we need to track our application like (Most view page, most like the product, the number of logins, places) etc. for that Google fireBase provide functionality.
Follow some steps.
1: Go to that URL and registered for firebase. https://firebase.google.com/docs/ios/setup
Follow steps .
2: Now download SDK manually or you can use POD.
3: In SDK folder there is Analytics folder , so just drag onto your project.
4: Download googleService.info.plist from your console and drag to your project root.
5: Now write some code in Appdelegate.m
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#import "AppDelegate.h" #include "Firebase.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [FIROptions defaultOptions].deepLinkURLScheme = @"https://sb86x.app.goo.gl/OvKB" ;//CUSTOM_URL_SCHEME; [FIRApp configure]; return YES; } } |
6: Now we start analytics part.
There is some in build action provided by google Firebase or you can use customized action.
Here, lines of code if it will execute then we would get information in Firebase console.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [FIRAnalytics logEventWithName:kFIREventSelectContent parameters:@{ kFIRParameterContentType:@"cont", kFIRParameterItemID:@"1" [FIRAnalytics logEventWithName:@"share_image" parameters:@{ @"name": @"kunal", @"full_text": @"pradsad" }]; } |
7: There is lots of action provided by google firebase so you can use according to your need.