TeslaBuds / AuthAppForTesla

54 stars 13 forks source link

Adding Apple universal link support #22

Closed one4many closed 2 years ago

one4many commented 2 years ago

Added universal links support, so the app can be called from other apps, create a token and feed that token back to the original (calling) app. This is the implementation for the app Autarkie Manager (www.otrky.com) which is able to monitor Tesla Powerwall solar installations.

In order to make the universal links work you need to add a file to your web server (www.watchfortesla.com ?) with following path/filename: /.well-known/apple-app-site-association It is important, that the file gets served by the web server with content-type: application/json Contents of the file (Please double check if the appID is corrent):

{ "applinks": { "details": [{ "appIDs": ["R8S8D227CC.dk.kimhansen.AuthAppForTesla"], "components": [ { "/": "/request-refresh-token", "?": {"app_id": "?", "app_data": ""}, "comment": "external app refresh token request" } ] }] } }

Please make sure that you add the associated domain (www.watchfortesla.com) to your xcode project, more info can we found here at apple docs.

This implementation pulls the fileExternalApplicationList.json from gitub on App start in order to support more apps in the future w/o the need of recompiling this app.

Kemmey commented 2 years ago

Hey - just a heads up - I'll look into this asap - just have a crazy busy week with work and two small kids!

one4many commented 2 years ago

No worries. Same here ;)