Развертывание на AWS без виртуальной машины при попытке извлечь что-либо в Firestore на нелокальном сервере {Ошибка: не удается найти модуль 'grpc'

В быстром файле вашей пользовательской ячейки напишите протокол, который будет соответствовать вашему viewContoller,

// your custom cell's swift file

protocol CustomCellDelegate {
    func showActionSheet()
}

class CustomTableViewCell : UITableViewCell {
    var delegate: CustomCellDelegate?

    // This is the method you need to call when button is tapped.
    @IBAction func buttonTapped() {

        // When the button is pressed, buttonTapped method will send message to cell's delegate to call showActionSheet method.
        if let delegate = self.delegate {
            delegate.showActionSheet()
        }
    }
}

// Your tableViewController
// it should conform the protocol CustomCellDelegate

class MyTableViewController : UITableViewController, CustomCellDelegate {

    // other code

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        let cell = tableView.dequeueReusableCellWithIdentifier("CustomCellReuseIdentifier", forIndexPath: indexPath)

        // configure cell

        cell.delegate = self        

        return cell
    }

    // implement delegate method
    func showActionSheet() {

        // show action sheet

    }
}

Убедитесь, что ваш контроллер просмотра соответствует протоколу CustomCellDelegate и реализует метод showActionSheet ().

Назначьте свой viewContoller как делегат пользовательской ячейки при создании ваших ячеек в методе dataSource cellForRowAtIndexPath.

Вы можете представить свой новый контроллер представлений из метода showActionSheet в viewController.

0
задан Zack Shapiro 16 January 2019 в 14:14
поделиться

1 ответ

Я смог найти ответ на этот вопрос после поиска в firebase-admin-node выпусках GitHub :

Я добавил файл .npmrc в корень моего проекта и добавил unsafe-perm=true как единственная строка в файле. Развернули и все работало нормально.

Основная проблема была связана с разрешениями пользователей на установку gprc, что подробно описано в ссылке выше.

0
ответ дан Zack Shapiro 16 January 2019 в 14:14
поделиться
Другие вопросы по тегам:

Похожие вопросы: