Homey Community Forum

IOS Swift "Hello World"


#1

Hi. Is there anyone out there who has made an IOS app in swift that can connect to Homey. I’m looking for a “Hello world” code where I see how to connect to homey and preferably code where I see how to trigger a flow. Have asked Support but they point to homey API, unfortunately I am not so good in Swift so that I can directly from the API do this. So … If someone has code they want to share, I would be happy. Merry Christmas and a Happy New Year. // Micke


#2

Hey Micke are you referring to the 1.5.3 version or the new beta version 2.0


#3

Ah. I would prefer (v2). Thats my guess. Is it nog different between this two?

//Micke


#4

Some one? Ex. for IOS, hello world or simuar
I need to have something to start with please


#5

Hi Mikael,

I have the same issue and I am quit knowledgable in Swift. However the API manual is not bringing me any further either. That is for the V2 with OAuth. Before it worked with a bearer token

So I support your call for a hello world example on Homey V2


#6

In the developer site I have this page from Athom. Can anybody help me to what I should change the localhost part?


#7

Don’t know the specifics but this means you can develop an app on your local machine which is running a server on port 80. If that works, you can ask Athom for different keys.

The supplied client-id and secret are the same for all btw, so one could distribute a html-page which uses oAuth2 to login to Homey.

Don’t know about Swift though…


#8

@bvdbos Thanks for your reply. I do not understand completely. You mean by local machine my laptop or tablet ?
My understanding is that we need now to use the Oauth2 protocol (from V2 as the bearertoken has been abanded) and this requires the clientId and secret. Communication should happen between Homey (or Homey cloud) with this parameters. Or am I missing the point?


#9

Indeed, you could use the athom-cli as an example…


#10

@bvdbos thanks for the tip, I will follow up on that