Skip to content
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

App Extensions unsupported? #87

Open
mmcguill opened this issue Sep 11, 2019 · 7 comments
Open

App Extensions unsupported? #87

mmcguill opened this issue Sep 11, 2019 · 7 comments

Comments

@mmcguill
Copy link

mmcguill commented Sep 11, 2019

Hi there, I just updated my pods and it appears things are now broken for my App Extension.

I believe I link to this library via:

pod 'GoogleSignIn'

My app allows people to store their password databases on Google Drive and I provide an App Extension (Credential AutoFill) to allow them to select their passwords inline from within say Safari.

It looks like the library you use AppAuth is not built/designed for use in App Extensions.

This seems to be a change with GoogleSignIn 5.0.0?

Are there any plans to support App Extensions or at least not break when built as an App Extension as before.

Will revert to 4.4.0 for now.

Thanks!
-Mark

@StevenEWright
Copy link

Mark, could you provide any details about what is failing? Also, have you considered filing a bug/feature request with AppAuth?

@mmcguill
Copy link
Author

Hi @StevenEWright

Sure, yes, thought you guys might have been aware of the issue or that it was a conscious decision to not support App Extensions, which is why I didn't include extra detail.

I was looking at this which made me think that:

#76

The issues are the standard run of the mill issues that occur in App Extensions, screenshot below.

image

Build Output Errors:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:111:54: note: 'sharedApplication' has been explicitly marked unavailable here
/Users/mark/dev/strongbox/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOSCustomBrowser.m:142:23: error: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
[[UIApplication sharedApplication] openURL:_appStoreURL];
^
In module 'UIKit' imported from /Users/mark/dev/strongbox/Pods/Target Support Files/AppAuth/AppAuth-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:111:54: note: property 'sharedApplication' is declared unavailable here
@Property(class, nonatomic, readonly) UIApplication *sharedApplication NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.");
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:111:54: note: 'sharedApplication' has been explicitly marked unavailable here
/Users/mark/dev/strongbox/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOSCustomBrowser.m:142:42: error: 'openURL:' is unavailable: not available on iOS (App Extension)
[[UIApplication sharedApplication] openURL:_appStoreURL];

@StevenEWright
Copy link

@mmcguill Ah, yes, now I vaguely remember. IIRC, AppAuth does have support for extensions but probably the maintainers of GTMAppAuth will need to make pod subspecs to support this, and maybe more? Thanks for the additional info!

@SteveDCronin
Copy link

SteveDCronin commented Oct 1, 2019

I have the same question regarding app extensions (an iOS .appex) but from a different failure point.

When I run the following code inside the hosting iOS app it works as expected.
When I run the same code inside of one of my .appex it fails (the returned value is nil)
Please advise as to whether this is due to inherent limitation of .appex (no keychain access??) or if this might be a bug and the method will be improved in the future.

BTW: This result is obtained even if Keychain Sharing capability has been turned ON for both the host app and the embedded apex. NOTE: still works properly in app itself and returns nil in the .appex.

if (googleAuthorization==nil) { googleAuthorization=[GTMAppAuthFetcherAuthorization authorizationFromKeychainForName:kGTMAppAuthKeychainItemName]; } return googleAuthorization;

@SteveDCronin
Copy link

Hoping for some guidance! I have an iOS app that implements GMTAppAuth just fine. Upon signIn I serialize by using the 'saveAuthorization:toKeychainForName:'... As needed I can then use 'authorizationFromKeychainForName:'. Inside the host .app this all works as expected. I also would like to use this within an embedded .appex. However when I attempt to use 'authorizationFromKeychainForName:' this returns nil. Is this because the .appex cannot retrieve that which was stored by the .app? Is this a limitation of the implementation that StevenEWright seems to be alluding to? Any clarifying thoughts appreciated!

@NSRover
Copy link

NSRover commented Sep 8, 2020

@mmcguill @StevenEWright I can't tell if you guys resolved this issue or not. Can GoogleSignIn be used from an iOS App Extension?

@mmcguill
Copy link
Author

mmcguill commented Sep 9, 2020

I'm afraid I didn't resolve in the end, and have moved to a different strategy for my app which doesn't involve using this library in my App Extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@mmcguill @StevenEWright @SteveDCronin @NSRover and others