UPDATE: Changes needed to support the nCoV 2019 Admin API

This document outlines the changes required to support the new nCoV 2019 Admin API (available herealongside the Nubentos API.

This is an optional step, and can be useful if the Nubentos API doesn't work correctly.

To support both APIs, you can replace the contents of the lib/app/services.api.dart with the new api.dart file attached.

The main difference is that API is now an abstract class, and you need to create either a NubentosAPI or an AdminAPI instance in order to use it.

You'll also need to add a new variable to the APIKeys class, using the value from the nCoV 2019 Admin Dashboard.

class APIKeys {
  static const ncovSandboxKey = '<your-authorization-key>';
  static const adminSandboxKey = '<your-authorization-key>';
}

The only other change needed in the codebase is to pass either a NubentosAPI or an AdminAPI instance when creating the APIService class:

// use this
APIService(AdminAPI.sandbox())
// or this
APIService(NubentosAPI.sandbox())

Let me know you have any questions on this.

Download
Download
Discussion

0 comments