MapsIndoors iOS SDK V3
Loading...
Searching...
No Matches
MPLiveDataManager.h
Go to the documentation of this file.
1//
2// MPLiveService.h
3// MapsIndoorsSDK
4//
5// Created by Daniel Nielsen on 16/06/2020.
6// Copyright © 2020 MapsPeople A/S. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
24
25@class MPLiveUpdate;
27@class MPLiveDataInfo;
28
30@protocol MPLiveDataManagerDelegate <NSObject>
31
32@optional
35- (void) didReceiveLiveUpdate:(MPLiveUpdate*)liveUpdate;
36
37@optional
40- (void) didUpdateState:(MPLiveDataManagerState)state;
41
42@optional
45- (void) didSubscribe:(MPLiveTopicCriteria*)topic;
46
47@optional
50- (void) didUnsubscribe:(MPLiveTopicCriteria*)topic;
51
52@optional
56- (void) onSubscriptionError:(NSError*)error topic:(MPLiveTopicCriteria*)topic;
57
58@optional
62- (void) onUnsubscriptionError:(NSError*)error topic:(MPLiveTopicCriteria*)topic;
63
64@optional
67- (void) onError:(NSError*)error;
68
69@optional
72- (void) didReceiveLiveDataInfo:(MPLiveDataInfo*)info;
73
74@end
75
77@interface MPLiveDataManager : NSObject
79@property (nonatomic, weak) id<MPLiveDataManagerDelegate> delegate;
81@property (nonatomic, readonly) MPLiveDataManagerState state;
83@property (nonatomic, strong, readonly) NSArray<MPLiveTopicCriteria*>* subscriptions;
84
85+ (instancetype)new NS_UNAVAILABLE;
86- (instancetype)init NS_UNAVAILABLE;
91- (void) subscribe:(MPLiveTopicCriteria*)topic;
94- (void) unsubscribe:(MPLiveTopicCriteria*)topic;
96- (void) unsubscribeAll;
98- (void) updateLiveDataInfo;
99@end
100
101NS_ASSUME_NONNULL_END
MPLiveDataManagerState
Enumeration of MPLiveDataManager states.
Definition MPLiveDataManager.h:14
@ MPLiveDataManagerStateConnecting
The Connecting state reflects the process of creating a valid connection with the Live Update remote ...
Definition MPLiveDataManager.h:18
@ MPLiveDataManagerStateClosed
The Closed state is the initial state before any subscriptions has been made in the Live Data Manager...
Definition MPLiveDataManager.h:16
@ MPLiveDataManagerStateConnected
The Connected state relfects the state of being connected to the Live Update remote services.
Definition MPLiveDataManager.h:20
@ MPLiveDataManagerStateDisconnecting
The Disconnecting state reflects the process of disconnecting the Live Update remote services.
Definition MPLiveDataManager.h:22
Live Data information model. Holds the currently active domain types for a dataset.
Definition MPLiveDataInfo.h:15
The Live Data Manager class is the central class for managing Live Update subscriptions.
Definition MPLiveDataManager.h:78
MPLiveDataManagerState state
Get the state of the Live Data Manager.
Definition MPLiveDataManager.h:81
void unsubscribeAll()
Unsubscribe all Live Updates. When the last Topic Criteria is successfully unsubscribed the Live Data...
instancetype NS_UNAVAILABLE()
id< MPLiveDataManagerDelegate > delegate
Set or get the Live Data Manager Delegate. The delegate recieves all Live Updates,...
Definition MPLiveDataManager.h:79
NSArray< MPLiveTopicCriteria * > * subscriptions
Get the currently active and successful subscriptions.
Definition MPLiveDataManager.h:83
void updateLiveDataInfo()
Update Live Data information, including list of active Domain Types for the current dataset.
MPLiveDataManager * sharedInstance()
Get (or create and get) the shared instance of the Live Data Manager.
Definition MPLiveTopicCriteria.h:17
Model for a Live Update. Used in MPLiveDataManagerDelegate and MPLocation::getLiveUpdate().
Definition MPLiveUpdate.h:17