Skip to content

Commit a5ac891

Browse files
README.md updated for 2025
1 parent 0963531 commit a5ac891

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

README.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- [Firebase Hosting](#firebase-hosting)
1010
- [Firebase Functions](#firebase-functions)
1111
- [Firebase Cloud Firestore](#firebase-cloud-firestore)
12-
- [Request an origin trial token](#request-an-origin-trial-token)
1312
- [First deploy](#first-deploy)
1413
- [Google Play Console setup](#google-play-console-setup)
1514
- [General setup](#general-setup)
@@ -75,7 +74,7 @@ $ npm start
7574

7675
![Create Firebase project name. Below, the full project ID is outlined.](images/image2.png 'image_tooltip')
7776

78-
4. The next page is regarding activating Google Analytics for your Firebase project. Turn this option off as this is just a test application and we don’t need analytics activated.
77+
4. The next page is regarding activating Google Analytics for your Firebase project. It is recommended to turn Analytics on, as that will help us link the Play Store app to Firebase.
7978
5. Firebase will then set up all the required resources for your project. When it’s done, you will see a “Your new project is ready” message with a continue option. Go ahead and click “Continue”.
8079

8180
## Firebase Authentication
@@ -167,8 +166,8 @@ This sample uses [Firebase Cloud Firestore](https://firebase.google.com/docs/fir
167166

168167
![Cloud Firestore in Firebase console.](images/image9.png 'image_tooltip')
169168

170-
2. In the first step, choose “production mode” to keep the data private and click Next. The Admin SDK in the sample functions code handles the communications with the database.
171-
3. In the second step, choose a Cloud Firestore location. Pick something close to your location where your functions are deployed. Then click Enable.
169+
2. In the first step, choose “production mode” to keep the data private and keep the database ID as '(default)' (otherwise Functions won't be able to find your database) and click Next. The Admin SDK in the sample functions code handles the communications with the database.
170+
3. In the second step, choose a Cloud Firestore location. It is recommended to use 'us-central1', since that is where Functions get deployed by default, and moving things around is a little tricky. Then click Enable.
172171

173172
There are three key collections of data as shown below (Note that the document id was omitted from the tables as it is auto-generated). The sample’s backend code automatically populates these tables with Firebase Functions. If you’d like to generate your own SKUs via the Google Play Console, make sure to add them to the SKUs collection in Firestore.
174173

@@ -321,17 +320,6 @@ There are three key collections of data as shown below (Note that the document i
321320

322321
<br/>
323322

324-
# Request an origin trial token
325-
326-
On [line 23 of index.html](https://github.com/chromeos/pwa-play-billing/blob/main/src/index.html#L23), you will see an option to insert an origin trial token. Visit [this link](https://developer.chrome.com/origintrials/#/view_trial/-5451607348931985407) to request an origin trial token for the Digital Goods API. Once you have your origin trial token, you can go and insert it on line 23 in the content attribute which currently holds the value `$ORIGIN_TRIAL_TOKEN`.
327-
328-
```
329-
<!-- Origin Trial -->
330-
<meta http-equiv="origin-trial" content="$ORIGIN_TRIAL_TOKEN" />
331-
```
332-
333-
To learn more about setting up origin trials, please see [this guide](http://googlechrome.github.io/OriginTrials/developer-guide.html).
334-
335323
# First deploy
336324

337325
After setting up Firebase, you can deploy just the hosting content first:
@@ -560,13 +548,7 @@ Like in our sample, it is highly recommended that you verify purchases and token
560548

561549
## Link API Project to your Play Console
562550

563-
To [link your Google Cloud project in the Play Console](https://developers.google.com/android-publisher/getting_started#using_an_existing_api_project), go to the “API access” section in the left-hand navigation general user menu (not the app menu). This is under “Settings” > “Developer account” > “API access”.
564-
565-
![In Play Console, API access page.](images/image17.png 'image_tooltip')
566-
567-
You can either “Link an existing project” or “Create a new project”. If you don’t see your existing project in the drop-down menu, first verify that the email you’ve used for your developer Play Console account is listed as an “Owner” in the [API Console](https://console.developers.google.com/iam-admin/) and that it has the Google Play Android Developer API enabled in the [API Library](https://console.developers.google.com/apis/library) (it may take up to a couple hours after you’ve done these for your project to be listed in the Play Console).
568-
569-
If you create a new project, the API will automatically be enabled and linked for you. You can always unlink and link a new Google Cloud project at any time.
551+
To [link your Google Cloud project in the Play Console](https://developers.google.com/android-publisher/getting_started#using_an_existing_api_project), go to Firebase Project Overview and click "Add app". Input your TWAs package name and SHA-1 of the signing key (you found it in the Update Digital Asset Links step). No go to Project Settings -> Integrations, and you should see a Link button in the Google Play card. Enable Analytics integration to get access to information about purchases and subscriptions.
570552

571553
## Setup a service account
572554

images/image17.png

-160 KB
Binary file not shown.

src/index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
<meta charset="utf-8" />
2020
<title>Web Play Billing Sample Application</title>
2121

22-
<!-- Origin Trial -->
23-
<meta http-equiv="origin-trial" content="$ORIGIN_TRIAL_TOKEN" />
24-
2522
<!-- Make the website responsive via a viewport tag -->
2623
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2724

0 commit comments

Comments
 (0)