Hi,
I need to integrate oneSignal into my old QtWidget based application and I could use some help.
I have added qml and quick to Qt modules and v-play to CONFIG.
I have also added this to my main.cpp
VPApplication vplay; // 2 - create VPApplication instance
QQmlApplicationEngine engine;
vplay.initialize(&engine); // 3 - initialize Felgo
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
in main.qml there is:
App {
licenseKey: "MYKEYYYY"
visible: false
id: main_app
OneSignal {
id: onesignal
logLevel: OneSignal.LogLevelVerbose
appId: "MY_APP_ID"
googleProjectNumber: "MY_GOOGLE_PROJECT_ID"
onNotificationReceived: {
console.debug("Received notification:", message, JSON.stringify(additionalData), isActive)
// Possible actions:
// - Read message from data payload and display a user dialog
// - Navigate to a specific screen
// - ...
}
onTagsReceived: {
var tagStr = ""
for(var tag in tags)
tagStr += tag + " = " +tags[tag]
if(tagStr != "")
tagStr = "Current tags: "+tagStr
else
tagStr = "Current tags: no tags set"
listModel.setProperty(5, "name", tagStr)
}
onUserIdChanged: {
console.debug("Got OneSignal user id:", userId)
}
}
}
It works and I can receive notifications, but apparently this is not the way to go because my QtWidget based application now has some issues with main window, resolution is not set correctly or there is alway white strip at the bottom of the application.
Could you point me to some solution.
Best Regards
Marek