ios build
This commit is contained in:
@@ -12,17 +12,95 @@ PluginImporter:
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude LinuxUniversal: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
CompileFlags:
|
||||
FrameworkDependencies: CoreTelephony;ContactsUI;
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#import <BMKLocationkit/BMKLocationComponent.h>
|
||||
|
||||
@interface SingleLocPlugin : NSObject
|
||||
NSString *unityListner;
|
||||
@property (assign, nonatomic)NSString *unityListner;
|
||||
@property(nonatomic, strong) BMKLocationManager *locationManager;
|
||||
@property(nonatomic, copy) BMKLocatingCompletionBlock completionBlock;
|
||||
@end
|
||||
@property(nonatomic, strong) BMKLocationManager *locationManager;
|
||||
@property(nonatomic, copy) BMKLocatingCompletionBlock completionBlock;
|
||||
#endif
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MyLocation : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
#if !UNITY_EDITOR && UNITY_IOS
|
||||
#if UNITY_IOS
|
||||
[System.Runtime.InteropServices.DllImport("__Internal")]
|
||||
private static extern void _init(string ak, string goName, int coorType);
|
||||
[System.Runtime.InteropServices.DllImport("__Internal")]
|
||||
@@ -69,10 +69,6 @@ public class MyLocation : MonoBehaviour
|
||||
#endif
|
||||
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _init(string ak4Ios, string goName, int coorType);
|
||||
#endif
|
||||
public void init(int coorType)
|
||||
{
|
||||
this.coorType = coorType;
|
||||
@@ -115,10 +111,6 @@ public class MyLocation : MonoBehaviour
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
private static extern void _getMyLocation();
|
||||
#endif
|
||||
public void getMyLocation(object callback)
|
||||
{
|
||||
checkUserPermission();
|
||||
|
||||
Reference in New Issue
Block a user