Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
// HCPEvents.h
//
// Created by Nikolay Demyankov on 13.08.15.
//
#import <Foundation/Foundation.h>
#import "HCPApplicationConfig.h"
/**
* Event is dispatched when some error has happened during the update download.
*/
extern NSString *const kHCPUpdateDownloadErrorEvent;
/**
* Event is dispathed when there is nothing new to download from the server.
* Web content is up-to-date.
*/
extern NSString *const kHCPNothingToUpdateEvent;
/**
* Event is dispatched when we finished loading the update and ready for installation process.
*/
extern NSString *const kHCPUpdateIsReadyForInstallationEvent;
/**
* Event is dispatched when installation is about to begin
*/
extern NSString *const kHCPBeforeInstallEvent;
/**
* Event is dispatched we failed to install the update.
*/
extern NSString *const kHCPUpdateInstallationErrorEvent;
/**
* Event is dispatched when update is successfully installed.
*/
extern NSString *const kHCPUpdateIsInstalledEvent;
/**
* Event is dispatched when there is nothing to install.
*/
extern NSString *const kHCPNothingToInstallEvent;
/**
* Event is dispatched right before plugin will start installing application assets on the external storage.
*/
extern NSString *const kHCPBeforeBundleAssetsInstalledOnExternalStorageEvent;
/**
* Event is dispatched when we successfully installed web content from bundle onto the external storage.
*/
extern NSString *const kHCPBundleAssetsInstalledOnExternalStorageEvent;
/**
* Event is dispatched when error occured during the installation of the web content from the bundle.
*/
extern NSString *const kHCPBundleAssetsInstallationErrorEvent;
/**
* Key for error object in the user info dictionary that is attached to the event.
*/
extern NSString *const kHCPEventUserInfoErrorKey;
/**
* Key for the worker id object in the user info dictionary that is attached to the event.
*/
extern NSString *const kHCPEventUserInfoTaskIdKey;
/**
* Key for the applpication config object in the user info dictionary that is attached to the event.
*/
extern NSString *const kHCPEventUserInfoApplicationConfigKey;
/**
* Helper class tor create plugin specific notifications about work process (download or installation).
*/
@interface HCPEvents : NSObject
/**
* Create instance of the NSNotification.
* Object is then dispatched through the NSNotificationCenter.
*
* @param name namve of the event
* @param appConfig application config that is attached to the event
* @param taskId id of the worker which generated the event
* @param error error that is attached to the event
*
* @return instance of the NSNotification
*/
+ (NSNotification *)notificationWithName:(NSString *)name applicationConfig:(HCPApplicationConfig *)appConfig taskId:(NSString *)taskId error:(NSError *)error;
/**
* Create instance of the NSNotification.
* Object is then dispatched through the NSNotificationCenter.
*
* @param name namve of the event
* @param appConfig applicationn config that is attached to the event
* @param taskId id of the worker which generated the event
*
* @return instance of the NSNotification
*/
+ (NSNotification *)notificationWithName:(NSString *)name applicationConfig:(HCPApplicationConfig *)appConfig taskId:(NSString *)taskId;
@end