@@ -12,24 +12,23 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
1212 await this . executeRequest ( mainRequestName , readyRequestName , appId , deviceId , timeout ) ;
1313 }
1414
15- public async executeRefreshRequest ( device : Mobile . IiOSDevice , appId : string ) : Promise < boolean > {
15+ public async executeRefreshRequest ( device : Mobile . IiOSDevice , timeout : number , appId : string ) : Promise < boolean > {
1616 const deviceId = device . deviceInfo . identifier ;
1717 const mainRequestName = this . $iOSNotification . getRefreshRequest ( appId ) ;
18- const readyRequestName = this . $iOSNotification . getAppRefreshStarted ( appId ) ;
19- const timeout = 5 ;
18+ const refreshRequestStartedName = this . $iOSNotification . getAppRefreshStarted ( appId ) ;
2019
21- const result = await this . executeRequest ( mainRequestName , readyRequestName , appId , deviceId , timeout ) ;
20+ const result = await this . executeRequest ( mainRequestName , refreshRequestStartedName , appId , deviceId , timeout ) ;
2221
2322 return result ;
2423 }
2524
26- private async executeRequest ( mainRequestName : string , readyRequestName : string , appId : string , deviceId : string , timeout : number ) : Promise < boolean > {
25+ private async executeRequest ( mainRequestName : string , successfulyExecutedNotificationName : string , appId : string , deviceId : string , timeout : number ) : Promise < boolean > {
2726 let isSuccessful = false ;
2827
2928 try {
3029 // We should create this promise here because we need to send the ObserveNotification on the device
3130 // before we send the PostNotification.
32- const socket = await this . $iOSNotificationService . postNotification ( deviceId , readyRequestName , constants . IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE ) ;
31+ const socket = await this . $iOSNotificationService . postNotification ( deviceId , successfulyExecutedNotificationName , constants . IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE ) ;
3332 const notificationPromise = this . $iOSNotificationService . awaitNotification ( deviceId , + socket , timeout ) ;
3433 await this . $iOSNotificationService . postNotification ( deviceId , mainRequestName ) ;
3534 await notificationPromise ;
0 commit comments