Skip to content

Commit

Permalink
Merge pull request #556 from zapcannon87/master
Browse files Browse the repository at this point in the history
Release v11.6.1
  • Loading branch information
zapcannon87 authored Apr 1, 2019
2 parents 4192d0a + ad71f71 commit 202f5b9
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 434 deletions.
25 changes: 5 additions & 20 deletions AVOS/AVOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion AVOS/AVOSCloud/ACL/AVRole.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ + (AVQuery *)query
}

-(NSMutableDictionary *)initialBodyData {
return [self.requestManager initialSetAndAddRelationDict];
return [self._requestManager initialSetAndAddRelationDict];
}

-(void)setName:(NSString *)name {
Expand Down
7 changes: 0 additions & 7 deletions AVOS/AVOSCloud/Analytics/AVAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ typedef NS_ENUM(int, AVReportPolicy) {
} ;

@protocol AVAnalyticsDelegate;
@class CLLocation;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -316,12 +315,6 @@ NS_ASSUME_NONNULL_BEGIN

+ (void)setLatitude:(double)latitude longitude:(double)longitude;

/** 为了更精确的统计用户地理位置,可以调用此方法传入经纬度信息
@param location CLLocation *型的地理信息
*/
+ (void)setLocation:(CLLocation *)location;


/**
* 设置自定义信息
*
Expand Down
7 changes: 1 addition & 6 deletions AVOS/AVOSCloud/Analytics/AVAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#import "AVUtils.h"

#import "AVOSCloud_Internal.h"
#import <CoreLocation/CoreLocation.h>
//#import <CoreLocation/CoreLocation.h>

static NSString * endPoint = @"statistics";

Expand Down Expand Up @@ -230,11 +230,6 @@ + (void)setLatitude:(double)latitude longitude:(double)longitude {
[[AVAnalyticsImpl sharedInstance] setLatitude:latitude longitude:longitude];
}

+ (void)setLocation:(CLLocation *)location {
[[AVAnalyticsImpl sharedInstance] setLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude];
}

+(void)startInternally {
if ([[AVAnalyticsImpl sharedInstance] isLocalEnabled]) {
[AVAnalytics startInternallyWithChannel:@""];
Expand Down
42 changes: 0 additions & 42 deletions AVOS/AVOSCloud/Geo/AVGeoPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#import <Foundation/Foundation.h>

@class CLLocation;

NS_ASSUME_NONNULL_BEGIN

/*!
Expand All @@ -28,14 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (instancetype)geoPoint;

/*!
Creates a new AVGeoPoint object for the given CLLocation, set to the location's
coordinates.
@param location CLLocation object, with set latitude and longitude.
@return a new AVGeoPoint at specified location.
*/
+ (instancetype)geoPointWithLocation:(CLLocation *)location;

/*!
Creates a new AVGeoPoint object with the specified latitude and longitude.
@param latitude Latitude of point in degrees.
Expand All @@ -44,45 +34,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (instancetype)geoPointWithLatitude:(double)latitude longitude:(double)longitude;

/*!
Fetches the user's current location and returns a new AVGeoPoint object via the
provided block.
@param geoPointHandler A block which takes the newly created AVGeoPoint as an
argument.
*/
+ (void)geoPointForCurrentLocationInBackground:(void(^)(AVGeoPoint * _Nullable geoPoint, NSError * _Nullable error))geoPointHandler;

/** @name Controlling Position */

/// Latitude of point in degrees. Valid range (-90.0, 90.0).
@property (nonatomic) double latitude;
/// Longitude of point in degrees. Valid range (-180.0, 180.0).
@property (nonatomic) double longitude;

/** @name Calculating Distance */

/*!
Get distance in radians from this point to specified point.
@param point AVGeoPoint location of other point.
@return distance in radians
*/
- (double)distanceInRadiansTo:(AVGeoPoint*)point;

/*!
Get distance in miles from this point to specified point.
@param point AVGeoPoint location of other point.
@return distance in miles
*/
- (double)distanceInMilesTo:(AVGeoPoint*)point;

/*!
Get distance in kilometers from this point to specified point.
@param point AVGeoPoint location of other point.
@return distance in kilometers
*/
- (double)distanceInKilometersTo:(AVGeoPoint*)point;


@end

NS_ASSUME_NONNULL_END
35 changes: 0 additions & 35 deletions AVOS/AVOSCloud/Geo/AVGeoPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@


#import "AVGeoPoint.h"
#import "AVLocationManager.h"
#import <CoreLocation/CoreLocation.h>

@implementation AVGeoPoint

Expand Down Expand Up @@ -43,14 +41,6 @@ + (AVGeoPoint *)geoPoint
return result;
}

+ (AVGeoPoint *)geoPointWithLocation:(CLLocation *)location
{
AVGeoPoint * point = [AVGeoPoint geoPoint];
point.latitude = location.coordinate.latitude;
point.longitude = location.coordinate.longitude;
return point;
}

+ (AVGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitude
{
AVGeoPoint * point = [AVGeoPoint geoPoint];
Expand All @@ -59,31 +49,6 @@ + (AVGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitud
return point;
}

- (CLLocation *)location {
return [[CLLocation alloc] initWithLatitude:self.latitude longitude:self.longitude];
}

+ (void)geoPointForCurrentLocationInBackground:(void(^)(AVGeoPoint *geoPoint, NSError *error))geoPointHandler
{
[[AVLocationManager sharedInstance] updateWithBlock:geoPointHandler];
}

- (double)distanceInRadiansTo:(AVGeoPoint*)point
{
// 6378.140 is the Radius of the earth
return ([self distanceInKilometersTo:point] / 6378.140);
}

- (double)distanceInMilesTo:(AVGeoPoint*)point
{
return [self distanceInKilometersTo:point] / 1.609344;
}

- (double)distanceInKilometersTo:(AVGeoPoint*)point
{
return [[self location] distanceFromLocation:[point location]] / 1000.0;
}

+(NSDictionary *)dictionaryFromGeoPoint:(AVGeoPoint *)point
{
return @{ @"__type": @"GeoPoint", @"latitude": @(point.latitude), @"longitude": @(point.longitude) };
Expand Down
38 changes: 0 additions & 38 deletions AVOS/AVOSCloud/Geo/AVLocationManager.h

This file was deleted.

131 changes: 0 additions & 131 deletions AVOS/AVOSCloud/Geo/AVLocationManager.m

This file was deleted.

Loading

0 comments on commit 202f5b9

Please sign in to comment.