Basic Gimbal iOS Sample Integration with Flurry
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Gimbal Flurry Integration

This sample project shows how Gimbal can be integrated with Flurry.

In this integration information regarding Place events are sent to Flurry. You can than use this information from within Flurry's analytic tools.


Please refer to the hello-gimbal-ios sample application for generic Gimbal setup and dependencies.

You will need to enter your Gimbal API Key and Flurry API Key into the AppDelegate.m file.


To make integration easier we have created a helper class GimbalFlurryAdapter that exposes a simple method

[GimbalFlurryAdapter sharedInstanceWithGimbalAPIKey:@"GIMBAL_API_KEY_HERE"

By invoking this method with the appropriate Gimbal and Flurry API keys both frameworks are initialized and place events are monitored and sent to Flurry.

The project is based on hello-gimbal-ios project. With the following changes

The code for GimbalFlurryAdapter shows how Place events are sent to Flurry.

#import "GimbalFlurryAdapter.h"
#import "Flurry.h"
#import <Gimbal/Gimbal.h>

@interface GimbalFlurryAdapter() <GMBLPlaceManagerDelegate>

@property (nonatomic) GMBLPlaceManager *placeManager;


@implementation GimbalFlurryAdapter

+ (instancetype) sharedInstanceWithGimbalAPUKey:(NSString *)gimbalAPIKey withFlurryAPIKey:(NSString *)flurryAPIKey
    static dispatch_once_t p = 0;
    __strong static id _sharedObject = nil;
    dispatch_once(&p, ^{
        [Flurry startSession:flurryAPIKey];
        [Gimbal setAPIKey:gimbalAPIKey options:nil];
        _sharedObject = [[self alloc] init];
    return _sharedObject;

-(instancetype) init {
    self = [super init];
    if (self) {
        self.placeManager = [GMBLPlaceManager new];
        self.placeManager.delegate = self;
        [GMBLPlaceManager startMonitoring];
        NSLog(@"GIMBAL and FLURRY initialized");
    return self;

- (NSDictionary*)buildVisitParameters:(GMBLVisit *)visit
    NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithDictionary:@{@"visitId" : visit.visitID,
                                                                                      @"placeId" :,
                                                                                      @"placeName" :}];
    for (NSString* key in [ allKeys])
        NSString* value = [ stringForKey:key];
        [parameters setValue:value forKey:key];
    return parameters;

# pragma mark - Gimbal Place Manager Delegate methods

- (void)placeManager:(GMBLPlaceManager *)manager didBeginVisit:(GMBLVisit *)visit
    NSLog(@"Logging didBeginVisit to Flurry for %@", [visit description]);
    [Flurry logEvent:@"didBeginVisit" withParameters:[self buildVisitParameters:visit]];

- (void)placeManager:(GMBLPlaceManager *)manager didEndVisit:(GMBLVisit *)visit
    NSLog(@"Logging didEndVisit to Flurry for %@", [visit description]);
    [Flurry logEvent:@"didEndVisit" withParameters:[self buildVisitParameters:visit]];