-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to create entitlements file
- Loading branch information
Showing
7 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
.DS_Store | ||
xcuserdata | ||
**/Storefront.xcconfig | ||
|
||
*.entitlements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.developer.associated-domains</key> | ||
<array> | ||
<string>webcredentials:{STOREFRONT_DOMAIN}</string> | ||
<string>applinks:{STOREFRONT_DOMAIN}</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
STOREFRONT_DOMAIN = <yourdomainhere.myshopify.com> | ||
STOREFRONT_ACCESS_TOKEN = <storefront access token> | ||
// --- Storefront | ||
// --- Find your Storefront API access token under: | ||
// ----- https://admin.shopify.com/store/{STOREFRONT}/settings/apps/development/{APP_ID}/api_credentials | ||
|
||
STOREFRONT_DOMAIN = <INSERT_STOREFRONT_DOMAIN> | ||
STOREFRONT_ACCESS_TOKEN = <INSERT_STOREFRONT_ACCESS_TOKEN> | ||
|
||
// --- Buyer preference data | ||
EMAIL = [email protected] | ||
|
||
FIRST_NAME = Test | ||
LAST_NAME = Test | ||
|
||
ADDRESS_1 = The Cloak & Dagger | ||
ADDRESS_2 = 1st Street Southeast | ||
CITY = Calgary | ||
COUNTRY = CA | ||
FIRST_NAME = Test | ||
LAST_NAME = McTest | ||
PROVINCE = AB | ||
ZIP = T1X 0L3 | ||
EMAIL = [email protected] | ||
PHONE = +155565708743 |
23 changes: 23 additions & 0 deletions
23
Samples/MobileBuyIntegration/scripts/generate_entitlements.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CONFIG_FILE="Storefront.xcconfig" | ||
STOREFRONT_DOMAIN=$(grep '^STOREFRONT_DOMAIN' "$CONFIG_FILE" | cut -d '=' -f2 | tr -d ' ') | ||
|
||
TEMPLATE_FILE="MobileBuyIntegration/MobileBuyIntegration.entitlements.template" | ||
OUTPUT_FILE="MobileBuyIntegration/MobileBuyIntegration.entitlements" | ||
|
||
if [ -z "$STOREFRONT_DOMAIN" ]; then | ||
echo "Error: STOREFRONT_DOMAIN is not set in Storefront.xcconfig" | ||
exit 1 | ||
fi | ||
|
||
if [ -e "$OUTPUT_FILE" ]; then | ||
echo "Warning: $OUTPUT_FILE already exists." | ||
exit 0 | ||
fi | ||
|
||
sed "s/{STOREFRONT_DOMAIN}/$STOREFRONT_DOMAIN?mode=developer/g" "$TEMPLATE_FILE" > "$OUTPUT_FILE" | ||
|
||
echo "Success: Entitlements file generated at $OUTPUT_FILE with domain $STOREFRONT_DOMAIN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
(cd samples/MobileBuyIntegration && ./scripts/generate_entitlements.sh) |