This repository was archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (31 loc) · 1.07 KB
/
main.cpp
File metadata and controls
35 lines (31 loc) · 1.07 KB
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
26
27
28
29
30
31
32
33
34
35
#include <AppCenter.hpp>
#include <dialogBox.hpp>
#include <iostream>
#ifndef APPCENTER_APP_SECRET
#define APPCENTER_APP_SECRET ""
#endif
#define myAppLIBRARY_EXPORT
#include <exportAPI.hpp>
// your main code
int main() {
Interop::AppCenter::trackEvent("[Native][Init]", {{"Hello", "from C++"}});
showDialogBox("C++ Powered", "Hello from C++!");
}
// the entry point of your program
// you need to export this function
extern "C" {
myAppAPI void dllEntry() { main(); }
// this will setup the callbacks needed by the C++ code
// in order to call the AppCenter.trackEvent() function
myAppAPI void setupAppCenterCallbacks(
void (*trackEventCallback)(const char *str),
void (*trackEventExtraCallback)(const char *str, const char *data)) {
Interop::AppCenter::setTrackEventCallback(trackEventCallback);
Interop::AppCenter::setTrackEventCallback(trackEventExtraCallback);
}
// this will retrieve the AppCenter app secret
myAppAPI const char* getAppCenterAppSecret() {
constexpr const char *appSecret = APPCENTER_APP_SECRET;
return appSecret;
}
}