-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AWSMobileClient to be extension API compatible #1522
Comments
This would be great to have for us too! |
Anyone ? |
Will this move forward, anyone? |
An example of a similar issue to this being fixed in another library: |
Adding context from @james-ff in #2958 (comment)
|
The AWS SDK for iOS currently only supports iOS applications. Adding support for app extensions will require significant changes to the code. We have this in our backlog but we do not have an ETA or any additional information. We will update this issue as soon as we have more updates. |
any update or workaround to get authentication tokens in app extension? |
The AWS SDK for iOS doesn't support app extensions. We recommend using Amplify Swift for this -- for more information, please visit https://docs.amplify.aws/swift/ Thanks! |
Which AWS Services is the feature request for?
AWSMobileClient
Is your feature request related to a problem? Please describe.
I'm trying to use the AWS SDK using CocoaPods. My application is structured as follows:
I'm building and linking the CocoaPods dependencies as static frameworks (using the
cocoapods-static-swift-framework
plugin). What I want to do is merge shared frameworks together into myCore
framework and share theCore
framework with all of my other frameworks and application. BecauseCore
is used by extensions, it needs to enforce that all code uses extension-compatible APIs. I'm doing this to try to reduce the number of dynamic frameworks that I'm linking against in order to optimize the launch time of my app and extensions, per Apple's guidance.The problem that I am running into is that
AWSMobileClient
is not compatible with extensions because of thegetViewController
function inAWSMobileClientExtensions.swift
:The
UIApplication.shared
field is not extension compatible since there will not be aUIApplication
instance in the extension.The problem is that I can include all of the other AWS frameworks into my
Core
framework, but I can't addAWSMobileClient
to my main application or another framework because it will fail to find and include header files forAWSCore
andAWSAuthCore
at build time, based on how CocoaPods builds its frameworks.Describe the solution you'd like
I would like to see if there's a way to remove the dependency on
UIApplication.shared
inAWSMobileClient
and make theAWSMobileClient
extension-compatible by setting theAllow app extension API only
flag in order to allow combiningAWSMobileClient
into a shared dynamic framework along with the other AWS frameworks. There does not appear to be any other blocker except for this one function.The comment
// This should never get called based on the design
could be interpreted that this code is not expected to be executed, so can it be removed? Or can it be changed to allow theAWSMobileClient
creator to pass a view controller to the initializer? Or add a delegate toAWSMobileClient
and have theAWSMobileClient.getViewController
call that delegate?I'm happy to make the change and submit a PR if there's general support for a particular solution.
The text was updated successfully, but these errors were encountered: