0

I am integrating Custom Siri Shortcuts in my app, If the user execute that shortcut, I am making api call to find the results that SIRI can respond to the user.

These are the workflows

While making, api call we need to refresh the access token, that token we need to pass in the api header for authentication purpose

We rely on the OAuth framework (POD dependency) that is a part of Main app to get access token

My Question is, is it possible to get the access token from the main app or do I need to include OAuth framework as a POD dependency in Siri Extension. what is the best approach to do that?

Rama Krish
  • 373
  • 1
  • 13

1 Answers1

0

If you can pass the access token through UserDefaults then you can pass the token with help of App Groups. Like:

UserDefaults.init(suiteName: "group.com.company")!.bool(forKey: "data")

Otherwise,

You can make a separate class to request the access token and make the class to target to both Siri and main app. Like:

enter image description here

Rahul Dasgupta
  • 894
  • 6
  • 18