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

chore: add google and microsoft scheme #172

Merged
Merged
Changes from 1 commit
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
16 changes: 13 additions & 3 deletions config_script/process_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def write_to_plist_file(self, plist, file_path):
file_name = os.path.basename(file_path)
with open(file_path, 'wb') as plist_file:
plistlib.dump(plist, plist_file)
print(f"File {file_name} has been written to {file_path}")
print(f"File {file_name} has been written to:")
print(f"{file_path}")

def print_info_plist_contents(self, plist_path):
if not plist_path:
Expand Down Expand Up @@ -136,7 +137,13 @@ def add_url_scheme(self, scheme, plist):
if not found:
existing.append(body)
plist['CFBundleURLTypes'] = existing


def add_application_query_schemes(self, schemes, plist):
existing = plist.get('LSApplicationQueriesSchemes', [])
for scheme in schemes:
if scheme not in existing:
existing.append(scheme)
plist['LSApplicationQueriesSchemes'] = existing
return plist

def add_firebase_config(self, config, firebase_info_plist_path):
Expand Down Expand Up @@ -179,8 +186,10 @@ def add_facebook_config(self, config, plist):
def add_google_config(self, config, plist):
google = config.get('GOOGLE', {})
key = google.get('GOOGLE_PLUS_KEY')
client_id = google.get('CLIENT_ID')

if key:
if key and client_id:
plist["GIDClientID"] = client_id
scheme = ['.'.join(reversed(key.split('.')))]
self.add_url_scheme(scheme, plist)

Expand All @@ -192,6 +201,7 @@ def add_microsoft_config(self, config, plist):
bundle_identifier = self.plist_manager.get_bundle_identifier()
scheme = ["msauth." + bundle_identifier]
self.add_url_scheme(scheme, plist)
self.add_application_query_schemes(["msauthv2", "msauthv3"], plist)

def update_info_plist(self, plist_data, plist_path):
if not plist_path:
Expand Down
Loading