ios build
This commit is contained in:
@@ -26,7 +26,7 @@ +(SingleLocPlugin*) instance
|
||||
|
||||
- (id)init:(NSString *)ak withUnityListner:(NSString *)listner andCoorType:(int)coordinateType
|
||||
{
|
||||
unityListner = listner;
|
||||
_unityListner = listner;
|
||||
[[BMKLocationAuth sharedInstance] checkPermisionWithKey:ak authDelegate:self];
|
||||
[self initLocation:coordinateType];
|
||||
return self;
|
||||
@@ -47,7 +47,7 @@ -(void)initLocation:(int)coordinateType
|
||||
_locationManager.coordinateType = BMKLocationCoordinateTypeGCJ02;
|
||||
}
|
||||
_locationManager.coordinateType = BMKLocationCoordinateTypeBMK09LL; //BMKLocationCoordinateTypeGCJ02
|
||||
_locationManager.distanceFilter = [distance.text doubleValue];
|
||||
_locationManager.distanceFilter = kCLDistanceFilterNone;
|
||||
_locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
||||
_locationManager.activityType = CLActivityTypeAutomotiveNavigation;
|
||||
_locationManager.pausesLocationUpdatesAutomatically = NO;
|
||||
@@ -61,7 +61,7 @@ -(void)getMyLocation
|
||||
{
|
||||
self.completionBlock = ^(BMKLocation *location, BMKLocationNetworkState state, NSError *error)
|
||||
{
|
||||
long code = 0
|
||||
long code = 0;
|
||||
NSString *msg = nil;
|
||||
float latitude = 0;
|
||||
float longitude = 0;
|
||||
@@ -89,14 +89,14 @@ -(void)getMyLocation
|
||||
NSLog(@"netstate = %d",state);
|
||||
|
||||
NSString * json = [NSString stringWithFormat:@"{\"cmd\":\"onGetLocation\", \"code\":%ld,\"msg\":\"%@\",\"latitude\":%0.6f,\"longitude\":%0.6f,\"AddrStr\":\"%@\"}",code, msg, latitude, longitude, AddrStr];
|
||||
[self sendUnityMessage:@"onCallback", json]
|
||||
[self sendUnityMessage:@"onCallback" with:json];
|
||||
};
|
||||
}
|
||||
|
||||
-(void) sendUnityMessage:(const NSString*)method with:(NSString*)msg
|
||||
{
|
||||
if(unityListner != nil && msg != nil) {
|
||||
UnitySendMessage([unityListner UTF8String],
|
||||
if(_unityListner != nil && msg != nil) {
|
||||
UnitySendMessage([_unityListner UTF8String],
|
||||
[method UTF8String], [msg UTF8String]);
|
||||
}
|
||||
}
|
||||
@@ -144,8 +144,8 @@ - (void)dealloc {
|
||||
#endif
|
||||
|
||||
|
||||
void _init(const char* ak, const char* goName, const int coorType); {
|
||||
[[SingleLocPlugin instance] init:[[NSString stringWithUTF8String:ak] withUnityListner:[NSString stringWithUTF8String:goName andCoorType:coorType] retain]];
|
||||
void _init(const char* ak, const char* goName, const int coorType) {
|
||||
[[SingleLocPlugin instance] init:[NSString stringWithUTF8String:ak] withUnityListner:[NSString stringWithUTF8String:goName] andCoorType:coorType];
|
||||
}
|
||||
|
||||
void _getMyLocation() {
|
||||
|
||||
Reference in New Issue
Block a user