Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion GoogleSignIn.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ The Google Sign-In SDK allows users to sign in with their Google account from th
s.dependency 'AppAuth', '~> 1.4'
s.dependency 'GTMAppAuth', '~> 1.0'
s.dependency 'GTMSessionFetcher/Core', '~> 1.1'
s.resources = 'GoogleSignIn/Resources/GoogleSignIn.bundle'
s.resource_bundle = {
'GoogleSignIn' => ['GoogleSignIn/Sources/{Resources,Strings}/*']
}
s.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'GID_SDK_VERSION=' + s.version.to_s,
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'
Expand Down
24 changes: 0 additions & 24 deletions GoogleSignIn/Resources/GoogleSignIn.bundle/Info.plist

This file was deleted.

19 changes: 15 additions & 4 deletions GoogleSignIn/Sources/NSBundle+GID3PAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,24 @@

NS_ASSUME_NONNULL_BEGIN

#if SWIFT_PACKAGE
NSString *const GoogleSignInBundleName = @"GoogleSignIn_GoogleSignIn";
#else
NSString *const GoogleSignInBundleName = @"GoogleSignIn";
#endif

@implementation NSBundle (GID3PAdditions)

+ (nullable NSBundle *)gid_frameworkBundle {
NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath];
NSString* frameworkBundlePath = [mainBundlePath
stringByAppendingPathComponent:@"GoogleSignIn.bundle"];
return [NSBundle bundleWithPath:frameworkBundlePath];
// Look for the resource bundle in the main bundle.
NSString *path = [[NSBundle mainBundle] pathForResource:GoogleSignInBundleName
ofType:@"bundle"];
if (!path) {
// If we can't find the resource bundle in the main bundle, use the framework bundle instead.
NSString *path = [[NSBundle mainBundle] pathForResource:GoogleSignInBundleName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you test from a Podfile with and without use_frameworks! or --use-libraries option to pod lib lint

ofType:@"framework"];
}
return [NSBundle bundleWithPath:path];
}

+ (void)gid_registerFonts {
Expand Down
5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let googleSignInVersion = "6.0.0"

let package = Package(
name: "GoogleSignIn",
defaultLocalization: "en",
platforms: [.iOS(.v9)],
products: [
.library(
Expand Down Expand Up @@ -59,6 +60,10 @@ let package = Package(
.product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
],
path: "GoogleSignIn/Sources",
resources: [
.process("Resources"),
.process("Strings"),
],
publicHeadersPath: "Public",
cSettings: [
.headerSearchPath("../../"),
Expand Down