iOS Reference

Download SDK

A class representing a user of your application. If you query for users with CintricAct, you will receive an array of CintricUserProfiles. You should also use the class methods of this class to set fields and sync information for the current user. It is highly recommended to set fields for you users if you have that information. You should always call updateFaceBookUser if you use facebook login. This will allow you to better view your users on the web panel. It will also help with demographics and profiling of users, making the rules engine, and demographic information much better. Any information you share will be securely stored for your use.

CintricFind enables battery efficient location monitoring 24/7.

It will handle permissions and will update even after the user has force quit the app. Our testing shows that our location updates will use 1% or less of a users battery on an average day. To use this SDK you must request an api key from http://cintric.com.

Make sure in your appDelegate application:didFinishLaunchingWithOptions: method you call

[Cintric initWithApiKey:@"YOUR_API_KEY_HERE" andSecret:@"YOUR_SECRET_HERE"];

To start location updates, you must also at some point in your app, call:

[CintricFind updateLocation];
+ (void)setDelegate:(id <CintricFindDelegate>)delegateResponder;

Parameters

delegateResponder
An object which implements the CintricFindDelegate protocol
+ (CLLocation *)getCurrentLocation;

The current location of the device.

This should stay accurate to within 400 feet at all times. Some cases such as very poor reception may reduce accuracy, however this is uncommon. To get the lat and lon:

    CLLocation *location = [CintricFind getCurrentLocation];
    location.coordinate.latitude //CGFloat
    location.coordinate.longitude // CGFloat
                    
+ (void)setDebug:(BOOL)loggingEnabled;

Set this to NO to turn off NSLogging. This is enabled in debug build by default. In production this will automatically be set to NO.

Parameters

loggingEnabled
NO disables logging
- (void)didUpdateDeviceLocation:(CLLocation *)location;

This is called whenever the location is updated.

Use this to do things like update your UI, or notify your server of the location change. You should expect the location to be at its best accuracy when this is called.

Parameters

location CLLocation
The device's current location
- (void)locationServicesAuthorized;

This will be called if the user allows location updates

- (void)locationServicesRestricted;

This will be called if the user's device can not update location. Some devices may be restricted, for example, by parental controls. DO NOT ask your user to change their settings in this case.

- (void)locationServicesDenied;

This will be called if the user denied access location services. We recommend you ask the user to open settings and enable their location services

+ (void)setUserRealName:(NSString *)realName;

Set the real name of the current user.

+ (void)setUserPhoneNumber:(NSString *)phoneNumber;

Set the phone number of your current user.

+ (void)setUserEmail:(NSString *)email;

Set the email of your current user.

+ (void)setUserCustomId:(NSString *)customId;

Set a custom unique id for your user, this can be used to match users in your database with our database.

+ (void)setUserFacebookId:(NSString *)facebookId;

If you know the facebook id of your user, but dont use facebook login call this method.

+ (void)setUserAdvertisingIdentifier:(NSString *)adId;

If your app uses ASIdentifierManager you should call this method with the adId obtained from this method

Setting the advertising identifier allows you to attribute advertising campaigns with user locations and track conversions.

If you want to save additional custom information about your user, especially to view in the web panel, use this method.

#import <AdSupport/AdSupport.h>

if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
    NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
        [CintricUserProfile setUserAdvertisingIdentifier:adId];
}

Parameters

adId
UUIDString obtained from the ASIdentifierManager

+ (void)setUserAdvertisingIdentifier:(NSString *)adId;

Setting the advertising identifier allows you to attribute advertising campaigns with user locations and track conversions.

If you want to save additional custom information about your user, especially to view in the web panel, use this method.

+ (void)setUserCustomJson:(id)customJson;

Parameters

customJson
A valid JSON object of type NSArray or NSDictionary

+ (void)updateFaceBookUser:(id)fbGraphUser;

Automatically send information from facebook login to our server. It is highly recommended to call this method if you use facebook login. This information will be available to you in the web browser. All information is securely stored for your use.

When your user logs in with facebook, call this method with the id <FBGraphUser> object passed to you by the facebook sdk.

    - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user {
        [CintricUserProfile updateFaceBookUser:user];
    }
    

Parameters

fbGraphUser
id object from the facebook SDK.

+ (void)syncAddresssBook;

Call this method at any time to enable address book sync. If your user has granted permission, or grants permission in the future, their address book will sync with our server. Using this method will allow you to view additional information about your users on the web panel. This greatly improves Cintric's ability to learn about who your users friends are, when, where, and for how long they spend time together.

All information is securely stored for your use.

+ (void)requestNearestUsersToLocation:(CLLocationCoordinate2D)coordinate count:(int)count completion:(cintricResponse)completionBlock;

Asynchronously request an array of CintricUserProfile objects nearest to a specified coordinate.

This method will send a request to the Cintric Act API to get nearby users. Once complete the completionBlock will be called with the array of user objects. The number of users returned will be "count" (or fewer if you don't have that many users). "count" can not be more than 200 (a larger number will be set to 200).

    + (void)setGoalConversionForCoordinate:(CLLocationCoordinate2D)coord
    radius:(double)radius
    startTime:(NSDate *)startTime
    endTime:(NSDate *)endTime
    name:(NSString *)name
    tags:(NSArray *)tags
    uniqueId:(NSString *)uniqueId __deprecated;