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

Add placeholder GoogleService-Info.plist to Vertex AI sample #12724

Merged
merged 2 commits into from
Apr 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.google.generativeai.GenerativeAISample;
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.VertexAISample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -517,7 +517,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.google.generativeai.GenerativeAISample;
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.VertexAISample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import SwiftUI
struct GenerativeAISampleApp: App {
init() {
FirebaseApp.configure()

if let firebaseApp = FirebaseApp.app(), firebaseApp.options.projectID == "mockproject-1234" {
guard let bundleID = Bundle.main.bundleIdentifier else { fatalError() }
fatalError("You must create and/or download a valid `GoogleService-Info.plist` file for"
+ " \(bundleID) from https://console.firebase.google.com to run this sample. Replace the"
+ " existing `GoogleService-Info.plist` file in the `FirebaseVertexAI/Sample` directory"
+ " with this new file.")
}
Comment on lines +23 to +29
Copy link
Member

Choose a reason for hiding this comment

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

great idea!

}

var body: some Scene {
Expand Down
40 changes: 40 additions & 0 deletions FirebaseVertexAI/Sample/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>API_KEY</key>
<string>AIzaSyAzlj4APqi5S58nFtE52Da0fYBOHA2MhaY</string>
<key>BUNDLE_ID</key>
<string>com.google.firebase.VertexAISample</string>
<key>CLIENT_ID</key>
<string>123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com</string>
<key>DATABASE_URL</key>
<string>https://mockproject-1234.firebaseio.com</string>
<key>GCM_SENDER_ID</key>
<string>123456789000</string>
<key>GOOGLE_APP_ID</key>
<string>1:123456789000:ios:f1bf012572b04063</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<true/>
<key>IS_APPINVITE_ENABLED</key>
<true/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>PLIST_VERSION</key>
<string>1</string>
<key>PROJECT_ID</key>
<string>mockproject-1234</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.123456789000-hjugbg6ud799v4c49dim8ce2usclthar</string>
<key>STORAGE_BUCKET</key>
<string>mockproject-1234.appspot.com</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions FirebaseVertexAI/Sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Vertex AI for Firebase Sample App

You can try out the SDK quickly, see a complete implementation of various use
cases, or use the sample app if you don't have your own Apple platforms app. To
use the sample app, you'll need to perform the following steps:
1. Download
[vertexai-preview-0.1.0.zip](https://github.com/firebase/firebase-ios-sdk/archive/refs/heads/vertexai-preview-0.1.0.zip)
for the latest release of the SDK
1. Extract the zip and open `GenerativeAISample.xcodeproj` in the
`FirebaseVertexAI/Sample` directory
1. [Register the sample app](https://firebase.google.com/docs/ios/setup#register-app)
in your Firebase project
- The default bundle ID is `com.google.firebase.VertexAISample`
1. [Download the `GoogleService-Info.plist`](https://firebase.google.com/docs/ios/setup#add-config-file)
to the `FirebaseVertexAI/Sample` directory, overwriting the placeholder file
with the same name
Loading