Oracle iOS Integration

Integrate your project with Oracle Responsys SDK

Add PushIOManager.framework  in Linked frameworks & pushio_config_debug.json in your project as below:

Integrate your project with Bluedot Point SDK

To integrate PointSDK, please refer to the integration steps documented here

Interaction between the Responsys SDK and Bluedot Point SDK

Setup Bluedot Location Services

1. Import required header files.

    @import BDPointSDK;
    @import PushIOManager;

2.  Introducing BDLocationManager which is the entry point for an app to start using the Point SDK.

[BDLocationManager instance]; 
/** * Authenticate, and start a session with Point Access. 
    * This behavior is asynchronous and this method will return immediately. Progress of the authentication process can be 
    * monitored by callbacks provided via the sessionDelegate property, or the KVO-enabled authenticationState property. 
    * Location Services are required immediately after a successful authentication. If your App has not already called 
    * [CLLocationManager auth] 
    * It is the responsibility of the Application to respect the authentication life-cycle and ensure that BDLocationManager 
    * is not already Authenticated, or in the process of Authenticating, while calling this method.
    * @exception BDPointSessionException Calling this method while in an invalid state will result in a BDPointSessionException being thrown. 
*/ 
[[BDLocationManager instance] authenticateWithApiKey: apiKey];

 

3. BDLocationManager expose properties for two delegates with additional features to enable rules which are defined via Bluedot Point Access web interface, it is necessary to call the authentication method from BDLocationManager with your API key.

  • sessionDelegate implements BDPSessionDelegate protocol
    • BDPSessionDelegate protocol provides callbacks informing the application when authentication state changes. The rules defined will only be observed while authenticated.
  • locationDelegate implements BDPLocationDelegate protocol and provide callbacks to notify your application when:
    • Zone information is received. This typically occurs immediately after the authentication process completes.
         didUpdateZoneInfo
    • Any Custom Action defined is triggered. Either of the following callbacks will be invoked, depending on whether the trigger is a geofence or a beacon.
        didCheckIntoFence:inZone:atLocation:willCheckOut:withCustomData:
        didCheckIntoBeacon:inZone:atLocation:withProximity:willCheckOut:withCustomData:
    • Leave the checked-in area. If the willCheckOut flag was set, either of the following corresponding callbacks will be made:
        didCheckOutFromFence:inZone:onDate:withDuration:withCustomData:
        didCheckOutFromBeacon:inZone:withProximity:onDate:withDuration:withCustomData:

Use case

Geofence or Beacon or GEOLINE™: Geographical boundaries, two or more real-world geographical points or BLE Beacons created in Bluedot Point AccessDashboard with Custom Action. (Note: Checkout does not apply to GEOLINE)

- (void)didCheckIntoFence: (BDFenceInfo *)fence
                   inZone: (BDZoneInfo *)zoneInfo
               atLocation: (BDLocationInfo *)location
             willCheckOut: (BOOL)willCheckOut
           withCustomData: (NSDictionary *)customData
{
    PIOGeoRegion *geoRegion = [[PIOGeoRegion alloc] initWithGeofenceId:fence.ID geofenceName:fence.name speed:location.speed bearing:location.bearing source:@"BDPointSDK" zoneId:zoneInfo.ID zoneName:zoneInfo.name dwellTime:0 extra:customData];
    [[PushIOManager sharedInstance] didEnterGeoRegion:geoRegion completionHandler:^(NSError *error, NSString *response) {
        if (nil == error) {
            //Geofence Entry Event triggered successfully
        } else {
            NSLog(@"Unable to send Geofence Entry Event, reason: %@", error.description);
        }
    }];
}

- (void)didCheckOutFromFence: (BDFenceInfo *)fence
                      inZone: (BDZoneInfo *)zoneInfo
                      onDate: (NSDate *)date
                withDuration: (NSUInteger)checkedInDuration
              withCustomData: (NSDictionary *)customData
{
    PIOGeoRegion *geoRegion = [[PIOGeoRegion alloc] initWithGeofenceId:fence.ID geofenceName:fence.name speed:0.0 bearing:0.0 source:@"BDPointSDK" zoneId:zoneInfo.ID zoneName:zoneInfo.name dwellTime:checkedInDuration extra:customData];
    [[PushIOManager sharedInstance] didExitGeoRegion:geoRegion completionHandler:^(NSError *error, NSString *response) {
        if (nil == error) {
            //Geofence Exit Event triggered successfully
        } else {
            NSLog(@"Unable to send Geofence Exit Event, reason: %@", error.description);
        }
    }];
}

- (void)didCheckIntoBeacon: (BDBeaconInfo *)beacon
                    inZone: (BDZoneInfo *)zoneInfo
                atLocation: (BDLocationInfo *)location
             withProximity: (CLProximity)proximity
              willCheckOut: (BOOL)willCheckOut
            withCustomData: (NSDictionary *)customData
{
    NSString *proximityString;
    switch(proximity)
    {
        default:
        case CLProximityUnknown:   proximityString = @"Unknown";   break;
        case CLProximityImmediate: proximityString = @"Immediate"; break;
        case CLProximityNear:      proximityString = @"Near";      break;
        case CLProximityFar:       proximityString = @"Far";       break;
    }
    PIOBeaconRegion *beaconRegion = [[PIOBeaconRegion alloc] initWithiBeaconUUID:beacon.proximityUuid iBeaconMajor:beacon.major iBeaconMinor:beacon.minor beaconId:beacon.ID beaconName:beacon.name beaconTag:@"" proximity:proximityString source:@"BDPointSDK" zoneId:zoneInfo.ID zoneName:zoneInfo.name dwellTime:0 extra:  customData];
    [[PushIOManager sharedInstance] didEnterBeaconRegion:beaconRegion completionHandler:^(NSError *error, NSString *response) {
        if (nil == error) {
            //Beacon Entry Event triggered successfully
        } else {
            NSLog(@"Unable to send Beacon Entry Event, reason: %@", error.description);
        }
    }];
}

- (void)didCheckOutFromBeacon: (BDBeaconInfo *)beacon
                       inZone: (BDZoneInfo *)zoneInfo
                withProximity: (CLProximity)proximity
                       onDate: (NSDate *)date
                 withDuration: (NSUInteger)checkedInDuration
               withCustomData: (NSDictionary *)customData
{
    NSString *proximityString;
    switch(proximity)
    {
        default:
        case CLProximityUnknown:   proximityString = @"Unknown";   break;
        case CLProximityImmediate: proximityString = @"Immediate"; break;
        case CLProximityNear:      proximityString = @"Near";      break;
        case CLProximityFar:       proximityString = @"Far";       break;
    }
    PIOBeaconRegion *beaconRegion = [[PIOBeaconRegion alloc] initWithiBeaconUUID:beacon.proximityUuid iBeaconMajor:beacon.major iBeaconMinor:beacon.minor beaconId:beacon.ID beaconName:beacon.name beaconTag:@"" proximity:proximityString source:@"BDPointSDK" zoneId:zoneInfo.ID zoneName:zoneInfo.name dwellTime:checkedInDuration extra:  customData];
    [[PushIOManager sharedInstance] didExitBeaconRegion:beaconRegion completionHandler:^(NSError *error, NSString *response) {
        if (nil == error) {
            //Beacon Exit Event triggered successfully
        } else {
            NSLog(@"Unable to send Beacon Exit Event, reason: %@", error.description);
        }
    }];
}


GitHub Sample Project

A sample project which demonstrates the integration of Responsys SDK and Bluedot Point SDK is available on GitHub.

Created by Neha Ishwar on May 2, 2019