This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Push notifications from LM to iOS and Android devices
#1
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!

Attached Files
.gz   Libraries-push notifications.tar.gz (Size: 1014 bytes / Downloads: 68)
.ipk   Old push-cloud.ipk (Size: 892.93 KB / Downloads: 11)
------------------------------
Ctrl+F5
Reply
#2
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.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#3
(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
------------------------------
Ctrl+F5
Reply
#4
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.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#5
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)
Reply
#6
(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
------------------------------
Ctrl+F5
Reply
#7
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
Reply
#8
(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
------------------------------
Ctrl+F5
Reply
#9
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.
Reply
#10
(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
------------------------------
Ctrl+F5
Reply
#11
(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.
Reply
#12
(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
Reply
#13
(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
------------------------------
Ctrl+F5
Reply
#14
Hi,

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

Thank you @Daniel.

BR,
André Neves
Reply
#15
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!!!
Reply
#16
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..
Reply
#17
(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
Reply
#18
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.
Reply
#19
What is your script?
------------------------------
Ctrl+F5
Reply
#20
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)
Reply


Forum Jump: