- I'm going to copy the message in just as it has been given to me in German, and then I give a translation
- “dann bitte nochmal im forum fragen ob sie uns die PHONE App aus der Inovaphone AppPlattform als vorlage geben können... als parallel thread zu der Profil app”
- And here the translation
- “then please ask again in the forum whether they can give us the PHONE app from the Inovaphone app platform as a template ... as a parallel thread to the profile app”
- We then also need, somehow, access to the profile app as stipulated in another form post by me that hasn’t been assigned yet that lives@ http://forum.innovaphone.com/moodle2/mod/forum/discuss.php?d=25458
char sb[1000];char b[100];char * tmp = b;class json_io send(sb);word base = send.add_object(0xffff, nullptr);send.add_string(base, "mt", "MonitorCountResult");if (this->currentSrc) send.add_string(base, "src", session->currentSrc);send.add_ulong64(base, "count", this->instance->count, tmp);this->SendResponse(send, sb);this->instance->StartUpdate(new NewApp1BadgeCountUpdate(this->instance, sip, 0, 0, nullptr));
Hi Daniel,
This is really embarrassing for me, but I just can’t get my app to meaningfully send an arbitrary JSON message through the default connection (like you suggested). My problem is 2 fold and then I will tell you how I set it up:
-
If I get it to send an arbitrary message, the app restarts the whole time and all variables are being deleted and the dom is completely populated over again,
-
If I get it that the app doesn’t restart again and again, the JSON message doesn’t come through, although it has been sent, but nothing comes back. Both these points might not be related at all, and is rather what I suspect.
So this is how I set it up:
-
In my JS file I put the SDK templet websocket connection back like follow:
var app = new innovaphone.appwebsocket.Connection(start.url, start.name);
app.checkBuild = true;
app.Xonconnected= app_connected;
function app_connected(domain, user, dn, appdomain) {
var src = new app.Src(update);
src.send({ mt: signal });
signal = "";
function update(msg) {
if (msg.mt != "") {
updateDoorTeam(msg.mt);
}
}
}
-
In the myapp.cpp I extended the if… if else… else that my message will be caught by the else, since then I can use only the msg.mt to say everything I want. It looks like the following, which I know is sending more back than what I need.
if (currentSrc) free(currentSrc);
currentSrc = src ? _strdup(src) : nullptr;
if (!strcmp(mt, "MonitorCount")) {....
….
else {
char sb[1000];
char b[100];
char* tmp = b;
class json_io send(sb);
word base = send.add_object(0xffff, nullptr);
send.add_string(base, "mt", mt);
if (this->currentSrc) send.add_string(base, "src", this->currentSrc);
send.add_ulong64(base, "count", this->instance->count, tmp);
this->SendResponse(send, sb);
AppWebsocketMessageComplete();
}
I also send you a copy of my JS file that works without any problems, until I try to do something of the above.
Then you won’t believe it, but I also followed the Database tutorial to the T (exactly the same), with a new app, and I can’t get that working. However, that can wait for another day, except if I can get that working even
Thanks in advance,
Yours,
Hannes

Good morning Daniel,
Thanks for your answer, but something more is wrong. What I did is I made a complete new installation of everything (pbx, app platform, Visual Studio and SDK). Then I created only a NewApp1 with absolutely nothing but only what the SDK compiled, and then launched this app which is 100% only template. This app crashes the whole time as well, just as in my app with the websocket
var app = new innovaphone.appwebsocket.Connection(start.url, start.name);
app.checkBuild = true;
app.Xonconnected= app_connected;
Here is a screenshot of my instance in a browser and the console showing the restart the whole time:
I guess if it doesn't work in a clean brand new template, I should not be surprised if it doesn't work in my own app.
I would highly appreciate your help, since this app is long overdue.
Hannes


Daniel