Update Your Application

Now that all the required frameworks have been added to your project, you need to implement them in the code base.

This section outlines how to implement the frameworks in the code base, using either Objective_C or Swift.


Info
Please make sure you have retrieved the YOUR_APP_KEY and YOUR_APP_GROUP_KEY values from the HurreeSDK website


Using Objective-C

Add the following line of code to the top of your AppDelegate.h file:

#import <HurreeSDK/HurreeSDK-Swift.h>;

The final line contains the property:

@property(nonatomic, strong) AnalyticsSingleton *YOUR_OBJECT_NAME

Ensure you have implemented the following method in your AppDelegate.m file:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:
        (NSData *) deviceToken 
{ 
}

This method will ensure that an appropriate device Token is generated which needs to be sent to the Hurree platform via the deportKeyValues method - along with the YOUR_APP_KEY and YOUR_APP_GROUP_KEY values. Please refer to the Methods and Arguments section for more information.

Note:

To enable the application to start the SDK, start the login process and receive notifications from the server - the following sequence of method calls is recommended and required on user login.

[YOUR_OBJECT_NAME deportKeyValues: YOUR_APP_GROUP_KEY 
    app_key: YOUR_APP_KEY 
    uniqueUserID: USER_ID 
    deviceTokenString: DEVICE_TOKEN_STRING 
    timerValue: TIME_VALUE 
    isiOSNative:BOOL_IOS_VALUE];

[YOUR_OBJECT_NAME deportUserValues: FIRSTNAME 
    lastName:LASTNAME 
    email:EMAIL_ADDRESS 
    userImageURL:IMAGE_URL 
    gender:USER_GENDER 
    dateOfBirth:DOB_VALUE
];

[YOUR_OBJECT_NAME sendLoginDetails:^(id result) {
    //Print Result
}];

Using Swift

Add the following line of code to the top of your AppDelegate file:

import HurreeSDK

Ensure you have implemented the following method in your AppDelegate file:

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken 
        deviceToken: Data) {
 }

This method will ensure that an appropriate device Token is generated which needs to be sent to the Hurree platform via the deportKeyValues method - along with the YOUR_APP_KEY and YOUR_APP_GROUP_KEY values. Please refer to the Methods and Arguments section for more information.

Note:

To enable the application to start the SDK, start the login process and receive notifications from the server - the following sequence of method calls is recommended and required on user login.

let analytics = AnalyticsSingleton.sharedInstance()

analytics.deportKeyValues(
    YOUR_APP_GROUP_KEY,
    app_group_key: YOUR_APP_KEY,
    uniqueUserID: UserId.text! as AnyObject ,
    deviceTokenString: deviceToken as AnyObject,
    timerValue: Constants.TIMER_VALUE_SECONDS as AnyObject
)

analytics.deportUserValues(
    Forename.text!,
    lastName: Surname.text!,
    email: EmailAddr.text,
    userImageURL: "",
    gender: Constants.GENDER_MALE,
    dateOfBirth: DOB.text
)

analytics.sendLoginDetails{(result) in

}

If you need more guidance, you can refer to the iOS sample application which provides a complete integration overview of how to use the included framework.

results matching ""

    No results matching ""