nativescript
Version:
Command-line interface for building NativeScript projects
33 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IOSNotification = void 0;
const events_1 = require("events");
const constants_1 = require("../../common/constants");
const yok_1 = require("../../common/yok");
class IOSNotification extends events_1.EventEmitter {
getAttachRequest(appId, deviceId) {
// It could be too early to emit this event, but we rely that if you construct attach request,
// you will execute it immediately.
this.emit(constants_1.ATTACH_REQUEST_EVENT_NAME, { deviceId, appId });
return this.formatNotification(IOSNotification.ATTACH_REQUEST_NOTIFICATION_NAME, appId);
}
getReadyForAttach(appId) {
return this.formatNotification(IOSNotification.READY_FOR_ATTACH_NOTIFICATION_NAME, appId);
}
getRefreshRequest(appId) {
return this.formatNotification(IOSNotification.REFRESH_REQUEST_NOTIFICATION_NAME, appId);
}
getAppRefreshStarted(appId) {
return this.formatNotification(IOSNotification.APP_REFRESH_STARTED_NOTIFICATION_NAME, appId);
}
formatNotification(notification, appId) {
return `${appId}:NativeScript.Debug.${notification}`;
}
}
exports.IOSNotification = IOSNotification;
IOSNotification.REFRESH_REQUEST_NOTIFICATION_NAME = "RefreshRequest";
IOSNotification.APP_REFRESH_STARTED_NOTIFICATION_NAME = "AppRefreshStarted";
IOSNotification.ATTACH_REQUEST_NOTIFICATION_NAME = "AttachRequest";
IOSNotification.READY_FOR_ATTACH_NOTIFICATION_NAME = "ReadyForAttach";
yok_1.injector.register("iOSNotification", IOSNotification);
//# sourceMappingURL=notification.js.map