MRFriend Class Reference

Inherits from NSObject
Conforms to MRAnnotation
Declared in MRFriend.h

Overview

Model object representing a user

+ getFriendWithKey:session:completion:

User’s key

+ (NSOperation *)getFriendWithKey:(MREditorKey *)key session:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( MRFriend *_Nullable friend_ , NSError *_Nullable error ))completion

Parameters

key

User’s key

session

Session to authenticate with

completion

Block to be called upon completion with an MRFriend or an error

Declared In

MRFriend.h

+ getAllFriendsWithSession:completion:

Session to authenticate with

+ (NSOperation *)getAllFriendsWithSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( NSArray<MRFriend*> *_Nullable friends , NSError *_Nullable error ))completion

Parameters

session

Session to authenticate with

completion

Block to be called upon completion with an array of MRFriend or an error

Declared In

MRFriend.h

+ removeFriendWithKey:session:completion:

The key of the user to unfriend

+ (NSOperation *)removeFriendWithKey:(MREditorKey *)friend_ session:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( NSError *_Nullable error ))completion

Parameters

friend_

The key of the user to unfriend

session

Session to authenticate with

completion

Block to be called upon completion with an array of MRFriend or an error

Declared In

MRFriend.h

– updateName:withSession:completion:

Name to set on object

- (NSOperation *)updateName:(NSString *)name withSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( MRFriend *_Nullable friend_ , NSError *_Nullable error ))completion

Parameters

name

Name to set on object

session

Session to authenticate with

completion

Block to be called upon completion with an updated MRFriend or an error

Declared In

MRFriend.h

– updateLocationAndFriends:withSession:completion:

Location to set on object

- (NSOperation *)updateLocationAndFriends:(nullable MRLocation *)location withSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( NSError *_Nullable error ))completion

Parameters

location

Location to set on object

session

Session to authenticate with

completion

Block to be called upon completion or an error

Declared In

MRFriend.h

– updateLocation:withSession:completion:

Location to set on object

- (NSOperation *)updateLocation:(MRLocation *)location withSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( MRFriend *_Nullable friend_ , NSError *_Nullable error ))completion

Parameters

location

Location to set on object

session

Session to authenticate with

completion

Block to be called upon completion with an updated MRFriend or an error

Declared In

MRFriend.h

– updateLocation:mapOffset:withSession:completion:

Identifier of the Meridian map containing this location

- (NSOperation *)updateLocation:(MREditorKey *)mapKey mapOffset:(CGPoint)offset withSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( MRFriend *_Nullable friend_ , NSError *_Nullable error ))completion

Parameters

mapKey

Identifier of the Meridian map containing this location

offset

coordinate offset of this location, as related to the Meridian map represented by the mapKey property.

session

Session to authenticate with

completion

Block to be called upon completion with an updated MRFriend or an error

Declared In

MRFriend.h

– disableSharingWithSession:completion:

Session to authenticate with

- (NSOperation *)disableSharingWithSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( MRFriend *_Nullable friend_ , NSError *_Nullable error ))completion

Parameters

session

Session to authenticate with

completion

Block to be called upon completion with an updated MRFriend or an error

Declared In

MRFriend.h

– uploadImage:withSession:completion:

Profile image to set on object

- (NSOperation *)uploadImage:(UIImage *)image withSession:(MRSharingSession *)session completion:(void ( ^ _Nullable ) ( NSURL *_Nullable imageURL , NSError *_Nullable error ))completion

Parameters

image

Profile image to set on object

session

Session to authenticate with

completion

Block to be called upon completion with a profile image URL or an error

Declared In

MRFriend.h

  key

The friend’s identifier.

@property (nonatomic, strong, nullable) MREditorKey *key

Declared In

MRFriend.h

  imageURL

URL to the friend’s profile image.

@property (nonatomic, strong, nullable) NSURL *imageURL

Declared In

MRFriend.h

  location

The friend’s last known location.

@property (nonatomic, strong, nullable) MRLocation *location

Declared In

MRFriend.h

  travelTime

Travel time from the authenticated user to friend in seconds. Value is nil if no friend location or no user location.

@property (nonatomic, strong, nullable) NSNumber *travelTime

Declared In

MRFriend.h

  travelDistance

Travel time from the authenticated user to friend in meters. Value is nil if no friend location or no user location.

@property (nonatomic, strong, nullable) NSNumber *travelDistance

Declared In

MRFriend.h

  sharing

Whether the user is sharing their location.

@property (nonatomic, assign) BOOL sharing

Declared In

MRFriend.h