NativeScript notified by PHP

plugins

#1

What’s the best solution for PHP send a notification to NativeScript, without need a continuously refreshing?

Nic Raboy reported me to use for use Firedatabase (PHP => Firedatabase => NativeScript), but there’s no internet connection. I would enjoy a direct solution.

Thx


#2

What you mean by continuously refreshing ? Or you want to send notification directly by PHP ? and not via firebase ?


#3

Continuosly refreshing:

while ( 1 ) {
http.request({ url: “https://httpbin.org/get”, method: “GET” }).then(function (response) {
// …
});
}


#4

@evnds

That code would just block the UI thread


#5

I tried create a tcpServer and send a tcp socket from PHP to NativeScript using this pugin:

but, its only works with TypeScript (i’m verry noob in this language) and there’s a bug on plugin that stop work.


#6

Yes, I think you understood what I wanted to do.


#7

You can use PHP Socketio on your PHP server,

And use Socketio client on nativescript side


#8

Thank you very much!! I’ll test your solution, I’ll give you a quick feedback.


#9

A BIG thanks for this contrib. This solve my problem, PHP send to SocketIO (nodejs) notfy that redirect to nativescript!