@erickv Thanks!
I success to create the virtual device.
And I want to notify message to st app, I tried it but got a 401 error.
What do I need a scope?
This is my code.
ctx.api.notifications.create({
locationId: ctx.api.config.locationId,
type: ‘ALERT’,
messages: [{‘ko-KR’:{title: “title”, body:“content”}}],
deepLink: {type: ‘installedApp’, id:“test”},
imageUrl: “https://t1.kakaocdn.net/kakaocorp/corp_thumbnail/Kakao.png”
})
RESPONSE: {
“statusCode”: 500,
“message”: “Server error: ‘Error: Request failed with status code 401: {“requestId”:“AF4C68C8-C5B1-43F7-8EED-7FEC0B38E663”,“error”:{“code”:“UnauthorizedError”,“target”:null,“message”:“Invalid scope”,“details”:}}’”
And one more question.
I have a two location in st ide.
Whenever I install a automation smartapp, always one location is selected.
It’s a first location.
Is it possible to select a location before installed a app?
The Notifications API is not public yet, but let me double-check it.
As for your last question, you cannot change the location on the fly, but installing the SmartApp at the desired location will generate a new location context for your SmartApp Instance.
As there’s no official documentation about the Notifications API, you can base your configuration on the notification.ts module from the SmartThings Core SDK.
Actually, it is very simple, check this “hello world” example to have a basic reference on how to implement it.
Note: Specifying posts as Solutions will help other to fast track them if they need.
Great! it’s good to know that it’s working on your side as well.
You mean the icon from the Installed SmartApps section, right? If so, this feature is only available for published/certified SmartApps (this applies for the SmartApp Catalog as well).
How does deepLink work for type: installedApp? When using the app’s ID it produces “Unable to view details” on the SmartThings app. I’d expect it to open the installed app?
{
"type": "AUTOMATION_INFO",
"message": "This is a handy message",
"title": "Look at me!",
"locationId": "*my-location-id*",
"imageUrl": "---",
"deepLink": {
"type": "installedApp",
"id": "*my-app-id*"
}
}
I couldn’t replicate the issue you mention. You’re not using the SDK (SmartApp or Core), right?
This feature is still under our engineering team review. Currently, no matter which deepLink type you use, the push notification is the same.
This, I would expect to take you to the app config page. But isn’t working. I was just wondering if I was providing the wrong thing for “id” and providing something else would work.
It makes sense this doesn’t work if it’s still in dev. Thank you.