Skip to content

Commit

Permalink
Merge pull request #41 from WillDent/master
Browse files Browse the repository at this point in the history
Fixed Issue #40. when using type region of circular TiBeacon module crashes
  • Loading branch information
jbeuckm authored Sep 19, 2016
2 parents f2ae0b8 + f58cacc commit b4a3f54
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
23 changes: 18 additions & 5 deletions Classes/OrgBeuckmanTibeaconsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ - (void) locationManager:(CLLocationManager *)manager didStartMonitoringForRegio
{
NSLog(@"[INFO] Did start monitoring region: %@", region.identifier);
[self.locationManager requestStateForRegion:region];

if([region isKindOfClass: [CLBeaconRegion class]]) {
[self fireEvent:@"didStartMonitoringForRegion" withObject:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];
}
}


Expand All @@ -216,26 +217,38 @@ -(void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionS
NSLog(@"[INFO] State UNKNOWN region: %@", region.identifier);
}

if([region isKindOfClass: [CLBeaconRegion class]]) {
NSMutableDictionary *event = [NSMutableDictionary dictionaryWithDictionary:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];
[event setObject:[self decodeRegionState:state] forKey:@"regionState"];

[self fireEvent:@"determinedRegionState" withObject:event];
}

}

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {

NSLog(@"[INFO] Entered region %@", region.identifier);

[self fireEvent:@"enteredRegion" withObject:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];

if([region isKindOfClass: [CLBeaconRegion class]]) {
NSLog(@"[INFO] Entered region and determined region type is beacon");
[self fireEvent:@"enteredRegion" withObject:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];

}



}

-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region {

NSLog(@"[INFO] exited region %@", region.identifier);

[self fireEvent:@"exitedRegion" withObject:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];
if([region isKindOfClass: [CLBeaconRegion class]]) {
NSLog(@"[INFO] Entered region and determined region type is beacon");
[self fireEvent:@"exitedRegion" withObject:[self detailsForBeaconRegion:(CLBeaconRegion *)region]];

}

}


Expand Down
Binary file modified org.beuckman.tibeacons-iphone-0.9.3.zip
Binary file not shown.
12 changes: 6 additions & 6 deletions titanium.xcconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

//
//
// CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT)
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 3.5.0.GA
TITANIUM_SDK_VERSION = 5.2.0.v20151211124741


//
//
// THESE SHOULD BE OK GENERALLY AS-IS
//
TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_SDK = /Users/wdent/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.v20151211124741
TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include"
TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore"
HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2)


TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/JavaScriptCore"
HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) $(TITANIUM_BASE_SDK3)

0 comments on commit b4a3f54

Please sign in to comment.