Replies: 1 comment
-
https://github.com/mobizt/FirebaseClient?tab=readme-ov-file#dependencies |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm just starting with this library but get this error
src/main.cpp:24:1: error: 'UserAuth' does not name a type; did you mean 'getAuth'?
UserAuth user_auth(API_KEY, USER_EMAIL, USER_PWD);
^~~~~~~~
getAuth
*** [.pio\build\esp-wrover-kit\src\main.cpp.o] Error 1
Here is the code:
#include <Arduino.h>
#include <Update.h>
#include "WiFiManager.h"
#include <FirebaseClient.h>
void asyncCB(AsyncResult &aResult);
void printResult(AsyncResult &aResult);
DefaultNetwork network; // initilize with boolean parameter to enable/disable network reconnection
FirebaseApp app;
#if defined(ESP32) || defined(ESP8266) || defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include <WiFiClientSecure.h>
WiFiClientSecure ssl_client;
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA) || defined(ARDUINO_PORTENTA_C33) || defined(ARDUINO_NANO_RP2040_CONNECT)
#include <WiFiSSLClient.h>
WiFiSSLClient ssl_client;
#endif
using AsyncClient = AsyncClientClass;
AsyncClient aClient(ssl_client, getNetwork(network));
UserAuth user_auth(API_KEY, USER_EMAIL, USER_PWD);
void setup() {
}
void loop() {
}
void asyncCB(AsyncResult &aResult)
{
// WARNING!
// Do not put your codes inside the callback and printResult.
printResult(aResult);
}
void printResult(AsyncResult &aResult)
{
if (aResult.isEvent())
{
Firebase.printf("Event task: %s, msg: %s, code: %d\n", aResult.uid().c_str(), aResult.appEvent().message().c_str(), aResult.appEvent().code());
}
if (aResult.isDebug())
{
Firebase.printf("Debug task: %s, msg: %s\n", aResult.uid().c_str(), aResult.debug().c_str());
}
if (aResult.isError())
{
Firebase.printf("Error task: %s, msg: %s, code: %d\n", aResult.uid().c_str(), aResult.error().message().c_str(), aResult.error().code());
}
if (aResult.available())
{
Firebase.printf("task: %s, payload: %s\n", aResult.uid().c_str(), aResult.c_str());
}
}
Beta Was this translation helpful? Give feedback.
All reactions