forked from pooranjoyb/cpp-sdk-appwrite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateFcmProvider.cpp
More file actions
25 lines (25 loc) · 833 Bytes
/
Copy pathcreateFcmProvider.cpp
File metadata and controls
25 lines (25 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "Appwrite.hpp"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sstream>
int main() {
std::string projectId = "68853010003a3f4fc106";
std::string apiKey = "";
std::string providerId = "68a22c7b00325882e4e5";
std::string name = "";
std::ifstream file("");
std::stringstream buffer;
buffer << file.rdbuf();
std::string service_account_json = buffer.str();
bool enabled = true;
try {
Messaging messaging(projectId, apiKey);
std::string response = messaging.createFcmProvider(
providerId, name, service_account_json, enabled);
std::cout << "FCM Provider Created!\nResponse: " << response << std::endl;
} catch (const AppwriteException &ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
}
return 0;
}