@@ -10,13 +10,13 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
10
10
const deviceIdentifier = device . deviceInfo . identifier ;
11
11
12
12
const observeNotificationPromises = [
13
- await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . alreadyConnected , timeout ) ,
14
- await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . readyForAttach , timeout ) ,
15
- await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . attachAvailable , timeout )
13
+ await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getAlreadyConnected ( projectId ) , timeout ) ,
14
+ await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getReadyForAttach ( projectId ) , timeout ) ,
15
+ await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getAttachAvailable ( projectId ) , timeout )
16
16
] ;
17
17
18
18
// Trigger the notifications update.
19
- await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . attachAvailabilityQuery , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
19
+ await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . getAttachAvailabilityQuery ( projectId ) , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
20
20
21
21
let receivedNotification : string ;
22
22
try {
@@ -30,7 +30,7 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
30
30
this . $errors . failWithoutHelp ( "A client is already connected." ) ;
31
31
break ;
32
32
case this . $iOSNotification . getAttachAvailable ( projectId ) :
33
- await this . executeAttachAvailable ( deviceIdentifier , timeout ) ;
33
+ await this . executeAttachAvailable ( deviceIdentifier , projectId , timeout ) ;
34
34
break ;
35
35
case this . $iOSNotification . getReadyForAttach ( projectId ) :
36
36
break ;
@@ -41,18 +41,18 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
41
41
}
42
42
}
43
43
44
- public async executeLaunchRequest ( deviceIdentifier : string , timeout : number , readyForAttachTimeout : number , shouldBreak ?: boolean ) : Promise < void > {
44
+ public async executeLaunchRequest ( deviceIdentifier : string , timeout : number , readyForAttachTimeout : number , projectId : string , shouldBreak ?: boolean ) : Promise < void > {
45
45
try {
46
- const appLaunchingPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . appLaunching , timeout ) ;
46
+ const appLaunchingPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getAppLaunching ( projectId ) , timeout ) ;
47
47
await appLaunchingPromise ;
48
48
if ( shouldBreak ) {
49
- await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . waitForDebug , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
49
+ await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . getWaitForDebug ( projectId ) , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
50
50
}
51
51
52
52
// We need to send the ObserveNotification ReadyForAttach before we post the AttachRequest.
53
- const readyForAttachPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . readyForAttach , readyForAttachTimeout ) ;
53
+ const readyForAttachPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getReadyForAttach ( projectId ) , readyForAttachTimeout ) ;
54
54
55
- await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . attachRequest , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
55
+ await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . getAttachRequest ( projectId ) , constants . IOS_POST_NOTIFICATION_COMMAND_TYPE ) ;
56
56
await readyForAttachPromise ;
57
57
} catch ( e ) {
58
58
this . $logger . trace ( "Launch request error:" ) ;
@@ -61,12 +61,12 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
61
61
}
62
62
}
63
63
64
- private async executeAttachAvailable ( deviceIdentifier : string , timeout : number ) : Promise < void > {
64
+ private async executeAttachAvailable ( deviceIdentifier : string , projectId : string , timeout : number ) : Promise < void > {
65
65
try {
66
66
// We should create this promise here because we need to send the ObserveNotification on the device
67
67
// before we send the PostNotification.
68
- const readyForAttachPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . readyForAttach , timeout ) ;
69
- await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . attachRequest ) ;
68
+ const readyForAttachPromise = await this . $iOSNotificationService . subscribeForNotification ( deviceIdentifier , this . $iOSNotification . getReadyForAttach ( projectId ) , timeout ) ;
69
+ await this . $iOSNotificationService . postNotification ( deviceIdentifier , this . $iOSNotification . getAttachRequest ( projectId ) ) ;
70
70
await readyForAttachPromise ;
71
71
} catch ( e ) {
72
72
this . $errors . failWithoutHelp ( `The application ${ projectId } timed out when performing the socket handshake.` ) ;
0 commit comments