Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue #40. when using type region of circular TiBeacon module crashes #41

Merged
merged 3 commits into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Classes/OrgBeuckmanTibeaconsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,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 @@ -206,26 +207,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)