Logic Machine Forum
Push notifications from LM to iOS and Android devices - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Push notifications from LM to iOS and Android devices (/showthread.php?tid=1083)

Pages: 1 2 3


Push notifications from LM to iOS and Android devices - Daniel - 08.11.2017

New push notification app was released and it fully replace old one. New app is called simply 'Push notifications' and old 'Cloud' is taken off the store. New app is using new cloud, to use it you must register in https://remote.logicmachine.net/user and use LM Cloud app to synchronize.
How to do it you see here:


The rest is nearly the same as in old app. Old functions are backward compatibly only the call to library must be changed.

Change this
Code:
pusher = dofile("/home/apps/store/data/cloud/lua/pusher.lua")

to this

Code:
pusher = require('applibs.pusher')


To simplify work we created new functions which can be used to work with new app. In new app each device can have custom name and we can use it instead of the ID. The ID is still working but it is much more convenient to use just custom name.

Fallowing functions are possible:

Send to individual device by ID or Name

Code:
pusher = require('applibs.pusher')
status, errors = pusher.send('custom name or ID', 'Test Message')
log(status, errors)


Send to all Android devices:

Code:
pusher = require('applibs.pusher')
status, errors = pusher.send_android('Test Message')
log(status, errors)

Send to all iOS devices

Code:
pusher = require('applibs.pusher')
status, errors = pusher.send_ios('Test Message')
log(status, errors)



Send to all devices

Code:
pusher = require('applibs.pusher')
status, errors = pusher.send_all('Test Message')
log(status, errors)


Below is the description for the old 'cloud' app. If for some reason anybody needs it I'm attaching it below.







Here are the used scripts.



Script 1 for both iOS and Android



Code:
pusher = dofile("/home/apps/store/data/cloud/lua/pusher.lua")

status, errors = pusher.push_notification('08a7a67cc15d5325c0bbaffbd1106c0e5a914b8ea6e850f4210a4a2cd260c835', 'Test Message')
log(status, errors)


Script 2 for iOS - will send to all iOS devices



Code:
pusher = dofile("/home/apps/store/data/cloud/lua/pusher.lua")

local ids= {}
for _, d in ipairs(pusher.get_ios_devices()) do
table.insert(ids, d.id)
end
local status,errors = pusher.push_notification(ids, 'Your house is on FIRE!')
log(status,errors)




Script 2 for Android devices - will send to all android devices





Code:
pusher = dofile("/home/apps/store/data/cloud/lua/pusher.lua")


local ids = {}
for _, d in ipairs(pusher.get_android_devices()) do
table.insert(ids, d.id)
end

local status, errors = pusher.push_notification(ids, 'Your house is on FIRE!')
log(status, errors)




And library for FB editor in attachment



Have fun!


RE: Push notifications from LM to iOS and Android devices - Thomas - 09.11.2017

Hi
The client looks promising. I've noticed two tabs. For local connection and for remote (via cloud) connection. The local one shows user-visu but unfortunately the remote shows mosaic. Mosaic is useless because of lack of security. Are you planning user and touch visualisations for remote too? It would be great.
Thank you.


RE: Push notifications from LM to iOS and Android devices - Daniel - 09.11.2017

(09.11.2017, 11:42)Thomas Wrote: Hi
The client looks promising. I've noticed two tabs. For local connection and for remote (via cloud) connection. The local one shows user-visu but unfortunately the remote shows mosaic. Mosaic is useless because of lack of security. Are you planning user and touch visualisations for remote too? It would be great.
Thank you.

Hi
Look here to see more
https://forum.logicmachine.net/showthread.php?tid=1082

Mosaic use the same authentication mechanism what normal visu but it miss option to gave specific access to selected rooms per user.

We started a process of complete rewrite of current custom visu. Once this will be done we will be able to put it on cloud too.
We also plan new user access app where you will be able to gave user access not only to visu but also to particular apps.

This will take some time...

BR


RE: Push notifications from LM to iOS and Android devices - Thomas - 09.11.2017

Mosaic use the same authentication mechanism what normal visu but it miss option to gave specific access to selected rooms per user.
- Exactly. This is the problem.

We started a process of complete rewrite of current custom visu. Once this will be done we will be able to put it on cloud too.
- Super

We also plan new user access app where you will be able to gave user access not only to visu but also to particular apps.
- I don't understand why? What's the use case of this kind of restriction?
- Why don't you simply add access rights to group objects (and tags)? It would be absolutely clear and universal solution across different visualisations, applications etc. It's just one additional column with 'role' in the object table. And check before reading/writing from visu.


RE: Push notifications from LM to iOS and Android devices - gjniewenhuijse - 10.11.2017

Is it possible to :
Lm 1 -> push message to mobile device a on cloud user1
Lm 2 -> push message to mobile device b on cloud user2
Lm 3 -> push message to mobile device a (cloud user1) and b (cloud user2)


RE: Push notifications from LM to iOS and Android devices - Daniel - 10.11.2017

(10.11.2017, 13:05)gjniewenhuijse Wrote: Is it possible to :
Lm 1 -> push message to mobile device a on cloud user1
Lm 2 -> push message to mobile device b on cloud user2
Lm 3 -> push message to mobile device a (cloud user1) and  b (cloud user2)

Hi
If you watch the video you will see in option 2 (first script) you can send message to a particular device.  If user1 and 2 will add his device then you can send them dedicated messages. Individually or together. 

BR


RE: Push notifications from LM to iOS and Android devices - andrepneves@gmail.com - 23.11.2017

Hi!

The push notifications work great on Iphone.
I'm not able to see Android devices on the Mobile Devices even though they are connected to the LM.

Is it possible to send push notifications to one specific android device like on iOS devices?

BR,
André Neves


RE: Push notifications from LM to iOS and Android devices - Daniel - 23.11.2017

(23.11.2017, 18:05)andrepneves@gmail.com Wrote: Hi!

The push notifications work great on Iphone.
I'm not able to see Android devices on the Mobile Devices even though they are connected to the LM.

Is it possible to send push notifications to one specific android device like on iOS devices?

BR,
André Neves
Hi
Yes you can,  exactly the same as iOS. You must see your android device on the cloud app list. If it is not there try deleting LM from android app and add it again. Make sure notification is enabled.
BR


RE: Push notifications from LM to iOS and Android devices - baggins - 24.11.2017

Hi,

With some types of push notifications it is possible to launch an app on the phone. Is there any chance that this might be implemented with the LM push notifications?

BR.


RE: Push notifications from LM to iOS and Android devices - Daniel - 24.11.2017

(24.11.2017, 10:18)baggins Wrote: Hi,

With some types of push notifications it is possible to launch an app on the phone. Is there any chance that this might be implemented with the LM push notifications?

BR.

Hi
Is this possible? If you click on the notification then it will open LM app.  Do you want to do it without selection and force app to open?

BR


RE: Push notifications from LM to iOS and Android devices - baggins - 24.11.2017

(24.11.2017, 10:30)Daniel. Wrote:
(24.11.2017, 10:18)baggins Wrote: Hi,

With some types of push notifications it is possible to launch an app on the phone. Is there any chance that this might be implemented with the LM push notifications?

BR.

Hi
Is this possible? If you click on the notification then it will open LM app.  Do you want to do it without selection and force app to open?

BR

What I mean is that the push notification opens another app on the phone.

Example: when the Linphone app goes to the background, incoming calls would not be taken, so when a call comes in on the server it first sends a push notification to wake up the app.


RE: Push notifications from LM to iOS and Android devices - andrepneves@gmail.com - 24.11.2017

(23.11.2017, 18:38)Daniel. Wrote:
(23.11.2017, 18:05)andrepneves@gmail.com Wrote: Hi!

The push notifications work great on Iphone.
I'm not able to see Android devices on the Mobile Devices even though they are connected to the LM.

Is it possible to send push notifications to one specific android device like on iOS devices?

BR,
André Neves
Hi
Yes you can,  exactly the same as iOS. You must see your android device on the cloud app list. If it is not there try deleting LM from android app and add it again. Make sure notification is enabled.
BR

Hi,

I've tried deleting LM from the app, reinstalling the app and still no change. The android device doesn't show on the list but it work with mosaic and even with voice commands.

BR


RE: Push notifications from LM to iOS and Android devices - Daniel - 27.11.2017

(24.11.2017, 17:57)andrepneves@gmail.com Wrote:
(23.11.2017, 18:38)Daniel. Wrote:
(23.11.2017, 18:05)andrepneves@gmail.com Wrote: Hi!

The push notifications work great on Iphone.
I'm not able to see Android devices on the Mobile Devices even though they are connected to the LM.

Is it possible to send push notifications to one specific android device like on iOS devices?

BR,
André Neves
Hi
Yes you can,  exactly the same as iOS. You must see your android device on the cloud app list. If it is not there try deleting LM from android app and add it again. Make sure notification is enabled.
BR

Hi,

I've tried deleting LM from the app, reinstalling the app and still no change. The android device doesn't show on the list but it work with mosaic and even with voice commands.

BR

Hi
Are you able to gave me remote access?  I need to find reason for it as for me it just works, Tested on Android 6.0, 7.0, 7.1
Contact me on PM.
BR


RE: Push notifications from LM to iOS and Android devices - andrepneves@gmail.com - 27.11.2017

Hi,

Problem solved. My cloud application wasn't updated. Now it works with Android 5.0.2.

Thank you @Daniel.

BR,
André Neves


RE: Push notifications from LM to iOS and Android devices - alexgleyzer - 29.01.2022

Dear friends,
Where do I find applibs.pusher?
Will pusher work normally with Wiser? As I understand, Wiser is not keeping cloud connection even application is open. Will Logic Machine application deliver push notifications from Wiser?
Thank you!!!


RE: Push notifications from LM to iOS and Android devices - Erwin van der Zwart - 29.01.2022

For now you need to use pushover.net (needed scripts are on this forum) with Wiser, we are working on a fully new mobile app including Push notifications but is scheduled for around march/april if there are no delays..


RE: Push notifications from LM to iOS and Android devices - alexgleyzer - 29.01.2022

(29.01.2022, 13:59)Erwin van der Zwart Wrote: For now you need to use pushover.net (needed scripts are on this forum) with Wiser, we are working on a fully new mobile app including Push notifications but is scheduled for around march/april if there are no delays..

Thank you for a prompt answer, pushover.net I connected already, it is nice. Waiting for a future push notifications integration.
By the way, what about voice notifications? 
Regards, Alex


RE: Push notifications from LM to iOS and Android devices - Shimaa - 10.02.2022

Hello, Can you help me please, I'm using android, following the same steps in your video, and
notifications are sent only when pressing "send push message"
otherwise, no notifications appear, What should I do?
Thanks for your time.


RE: Push notifications from LM to iOS and Android devices - Daniel - 10.02.2022

What is your script?


RE: Push notifications from LM to iOS and Android devices - Shimaa - 10.02.2022

Also, yesterday when I login in remotely from 2 mobile phones (using the same mail address), then pressed synchronize cloud, not all connected devices appeared, only one of them appeared today!

(10.02.2022, 12:55)Shimaa Wrote: Hello, Can you help me please, I'm using android, following the same steps in your video, and 
notifications are sent only when pressing "send push message"
otherwise, no notifications appear, What should I do?
Thanks for your time.

pusher = dofile("/home/apps/store/data/cloud/lua/pusher.lua")

status, errors = pusher.push_notification('device ID', 'Entrance is ON')
log(status, errors)