I'm much in the same boat as Remy. At 1st I did the whole OAuth dance to get a token, but then realised that the token and "Cloud API" doesn't really let you do anything useful, but that's a whole different topic.
This is to do with PUSH, I have a private app that uses PUSH, and I take the url (as described by A lex) and sure enough my external server can ping notifications to the app just fine.
However, it doesn't seem possible to then make the app public so other people can use it.
Example, I have a latest breaking newsflash app (theoretically), that I want people to be able to install. Then I want my server to be able to PUSH the notifications to all of the apps. Is the PUSH url (and token) specific to just _my_ install of the app, or for _everyone_ who's installed it?
I've seen people seemingly working around this by giving people instructions to create a new notification app, type in the title, pick an icon and so on themselves, basically a page of instructions on how to set-up an app. This seems less than ideal.
In an ideal world, the user would install the app, and we could PUSH to all instances of them. Or, if it's specific notifications use OAuth to actually be able to send notifications to the user's device.
This seems like a strangely unconnected unsmart smart connected device.
Are there any answers to these questions? I have the same issue. I'd like to have a LaMetric public app for anyone to use. Users would then authenticate with OAuth in our web app and select a LaMetric device (or account in case there can only be one LaMetric device per account which I'm not sure about). Our web server will then push notifications to this specific device. Is this possible? I believe it should be since this is the exact same scenario as the IFTTT integration.
We already implemented the OAuth 2 flow and can get the access token. We also have the push URL of our Indicator app (the one that we want to make public at some point). My question is, how shall we structure our POST requests to the push URL of our Indicator app. The docs and LaMetric dev portal sample shows we should use the push URL and pass the app Access token in the "X-Access-Token" header. What's not clear to us is how to identify the device we're pushing notifications into. We could pass the "Authorization" header with "Bearer USER_ACCESS_TOKEN_FROM_OAUTH2". Is this the right approach and is the notification going to be sent only to the user's device? Also, this does not seem complete since with the user access token, we're identifying the user but not the LaMetric device. Please help.
I wrote a blog post about how to send push notifications with PHP a while ago: https://blog.aruehe.io/lametric-firmware-1-6-0-and-local-push/
To push messages to the LaMetric from outside your network you can always use the Push URL (https://developer.lametric.com/api/v1....) instead the local push url from the app page on developer.lametric.com. Before local pushing was possible you always had to use the LaMetric servers to push messages to the device.
I added the ... on purpose. There's a custom URL for your app on developer.lametric.com and it starts with https://developer.lametric.com/v1/
Oh, okay, I know the API. And it doesn't quite work for what I'm trying to do.
That's basically the PUSH method on a indicator app, but there's two key problems with using push on an indicator:
1. The notification will only show if the data changes, so if you're giving a notification for a Stripe sale where the amount is the same upon each sale, you'll only get a single notification
2. You have an indicator app in your cycled apps, so ideally it would be hidden, at which point, notifications don't come through (though I've not tried with "critical" notifications, IIRC, warnings don't come through when it's hidden).
So it doesn't really fly.
The only work around I've found is to put my LaMetric on the open web…which frankly worries me a bit.
But it loops me back to wondering: what's the point in the oauth2 system if it only exposes an internal IP. Surely this system should be used to connect an external service to a LaMetric via the lameric.com website somehow…
I didn't know, but I just noticed, that notification apps only work in local networks.