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 whether you accept or reject these cookies being set.

Push notifications from LM to iOS and Android devices
#1
Hi

As promised here is tutorial for push notifications from Logic Machine to iOS and Android devices.
No need to talk much just watch the video.



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: 34)
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, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151
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
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, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151
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
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
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
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
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


Forum Jump: