-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup flavor for StoryPad, Spooky, Community (public Firebase)
- Loading branch information
Showing
27 changed files
with
1,261 additions
and
109 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
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
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
5 changes: 5 additions & 0 deletions
5
android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt
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 @@ | ||
package com.tc.writestory | ||
|
||
import io.flutter.embedding.android.FlutterFragmentActivity | ||
|
||
class MainActivity: FlutterFragmentActivity() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"APP_NAME": "SpookyC.", | ||
"GOOGLE_CLIENT_ID": "892248434003-q94kghlq2mrmcfucabke2cpmgf77j1p5.apps.googleusercontent.com", | ||
"GOOGLE_REVERSED_CLIENT_ID": "com.googleusercontent.apps.892248434003-q94kghlq2mrmcfucabke2cpmgf77j1p5" | ||
} |
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 +1 @@ | ||
{"flutter":{"platforms":{"android":{"default":{"projectId":"juniorise-spooky-community","appId":"1:892248434003:android:07ab4b2c947355a263eda6","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"juniorise-spooky-community","appId":"1:892248434003:ios:c1c7f010daf9631363eda6","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"juniorise-spooky-community","configurations":{"android":"1:892248434003:android:07ab4b2c947355a263eda6","ios":"1:892248434003:ios:c1c7f010daf9631363eda6"}}}}}} | ||
{"flutter":{"platforms":{"android":{"default":{"projectId":"juniorise-spooky-community","appId":"1:892248434003:android:07ab4b2c947355a263eda6","fileOutput":"android/app/google-services.json"},"buildConfigurations":{"src/spooky":{"projectId":"juniorise-spooky","appId":"1:845318918007:android:8d9f8265b46011fd349b72","fileOutput":"android/app/src/spooky/google-services.json"},"src/storypad":{"projectId":"tc-write-story","appId":"1:315543702519:android:4e9cf4c1923c1dab74fcf2","fileOutput":"android/app/src/storypad/google-services.json"},"src/community":{"projectId":"juniorise-spooky-community","appId":"1:892248434003:android:5e6ee709875438aa63eda6","fileOutput":"android/app/src/community/google-services.json"}}},"ios":{"default":{"projectId":"juniorise-spooky-community","appId":"1:892248434003:ios:c1c7f010daf9631363eda6","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"},"buildConfigurations":{"Release":{"projectId":"tc-write-story","appId":"1:315543702519:ios:b341e734dc53180c74fcf2","uploadDebugSymbols":false,"fileOutput":"ios/Firebase/storypad/GoogleService-Info.plist"}}},"dart":{"lib/firebase_options.dart":{"projectId":"juniorise-spooky-community","configurations":{"android":"1:892248434003:android:07ab4b2c947355a263eda6","ios":"1:892248434003:ios:c1c7f010daf9631363eda6"}},"lib/firebase_options/spooky.dart":{"projectId":"juniorise-spooky","configurations":{"android":"1:845318918007:android:8d9f8265b46011fd349b72","ios":"1:845318918007:ios:6815c46033e54568349b72"}},"lib/firebase_options/storypad.dart":{"projectId":"tc-write-story","configurations":{"android":"1:315543702519:android:4e9cf4c1923c1dab74fcf2","ios":"1:315543702519:ios:b341e734dc53180c74fcf2"}},"lib/firebase_options/community.dart":{"projectId":"juniorise-spooky-community","configurations":{"android":"1:892248434003:android:5e6ee709875438aa63eda6","ios":"1:892248434003:ios:83be1e9203a1be7e63eda6"}}}}}} |
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,87 @@ | ||
#!/bin/bash -e | ||
|
||
function exit_if_file_not_exist() { | ||
if ! [[ -f $1 ]]; then | ||
echo "🚨 $2" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function run_command() { | ||
echo -e "\n[EXECUTING] $1\n" | ||
eval $1 | ||
} | ||
|
||
# eg. main_prod.dart | ||
function save_dart_main_file() { | ||
TEMPLATE_DATA=$(cat "lib/main.dart.template") | ||
FLAVOR=$1 | ||
DESTINATION="lib/main_$FLAVOR.dart" | ||
|
||
sed "s/#{FLAVOR}/$FLAVOR/g" <<<"$TEMPLATE_DATA" >$DESTINATION | ||
echo "[CREATED] main_flavor.dart.template -> $DESTINATION" | ||
} | ||
|
||
function ensure_generated_dart_define_exist() { | ||
touch ios/Flutter/GeneratedDartDefines.xcconfig | ||
} | ||
|
||
function configure() { | ||
FLAVOR=$1 | ||
PRODUCT=$2 | ||
PACKAGE_NAME=$3 | ||
WEB_APPLICATION_ID=$4 | ||
ACCOUNT=$5 | ||
PLATFORMS=${PLATFORMS:-'android,ios'} | ||
|
||
save_dart_main_file $FLAVOR | ||
ensure_generated_dart_define_exist | ||
|
||
run_command "flutterfire configure | ||
--project=$PRODUCT | ||
--ios-bundle-id=$PACKAGE_NAME | ||
--android-package-name=$PACKAGE_NAME | ||
--macos-bundle-id=$PACKAGE_NAME | ||
--web-app-id=$WEB_APPLICATION_ID | ||
--platforms=$PLATFORMS | ||
--ios-out="ios/Firebase/$FLAVOR/GoogleService-Info.plist" | ||
--android-out=android/app/src/$FLAVOR/google-services.json | ||
--macos-out="macos/Firebase/$FLAVOR/GoogleService-Info.plist" | ||
--out="lib/firebase_options/$FLAVOR.dart" | ||
--ios-build-config=Release-$FLAVOR | ||
--macos-build-config=Release-$FLAVOR | ||
--account=$ACCOUNT | ||
--token=$TOKEN | ||
--yes" | ||
} | ||
|
||
function main() { | ||
exit_if_file_not_exist "pubspec.yaml" "Make sure to execute scripts from project directory." | ||
|
||
case $1 in | ||
|
||
--community) | ||
configure 'community' 'juniorise-spooky-community' 'com.juniorise.spooky.community' '1:892248434003:android:07ab4b2c947355a263eda6' $2 | ||
exit 0 | ||
;; | ||
|
||
--storypad) | ||
configure 'storypad' 'tc-write-story' 'com.tc.writestory' '1:315543702519:android:4e9cf4c1923c1dab74fcf2' $2 | ||
exit 0 | ||
;; | ||
|
||
--spooky) | ||
configure 'spooky' 'juniorise-spooky' 'com.juniorise.spooky' '1:845318918007:android:8d9f8265b46011fd349b72' $2 | ||
exit 0 | ||
;; | ||
|
||
*) | ||
help | ||
exit 0 | ||
;; | ||
|
||
esac | ||
shift | ||
} | ||
|
||
main $@ |
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,34 @@ | ||
<?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>CLIENT_ID</key> | ||
<string>892248434003-q94kghlq2mrmcfucabke2cpmgf77j1p5.apps.googleusercontent.com</string> | ||
<key>REVERSED_CLIENT_ID</key> | ||
<string>com.googleusercontent.apps.315543702519-odmt90l1fdih6mtpbcoc1hkqvd8mdhle</string> | ||
<key>API_KEY</key> | ||
<string>AIzaSyAU8Q8SrWFufbf5uC7TPDVC9aDw4_aqvRw</string> | ||
<key>GCM_SENDER_ID</key> | ||
<string>892248434003</string> | ||
<key>PLIST_VERSION</key> | ||
<string>1</string> | ||
<key>BUNDLE_ID</key> | ||
<string>com.juniorise.spooky.community</string> | ||
<key>PROJECT_ID</key> | ||
<string>juniorise-spooky-community</string> | ||
<key>STORAGE_BUCKET</key> | ||
<string>juniorise-spooky-community.firebasestorage.app</string> | ||
<key>IS_ADS_ENABLED</key> | ||
<false></false> | ||
<key>IS_ANALYTICS_ENABLED</key> | ||
<false></false> | ||
<key>IS_APPINVITE_ENABLED</key> | ||
<true></true> | ||
<key>IS_GCM_ENABLED</key> | ||
<true></true> | ||
<key>IS_SIGNIN_ENABLED</key> | ||
<true></true> | ||
<key>GOOGLE_APP_ID</key> | ||
<string>1:892248434003:ios:83be1e9203a1be7e63eda6</string> | ||
</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,2 +1,4 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
|
||
#include "Generated.xcconfig" | ||
#include "GeneratedDartDefines.xcconfig" |
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,3 +1,5 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig" | ||
|
||
#include "Generated.xcconfig" | ||
#include "GeneratedDartDefines.xcconfig" |
Oops, something went wrong.