|
9 | 9 | - [Firebase Hosting](#firebase-hosting) |
10 | 10 | - [Firebase Functions](#firebase-functions) |
11 | 11 | - [Firebase Cloud Firestore](#firebase-cloud-firestore) |
12 | | -- [Request an origin trial token](#request-an-origin-trial-token) |
13 | 12 | - [First deploy](#first-deploy) |
14 | 13 | - [Google Play Console setup](#google-play-console-setup) |
15 | 14 | - [General setup](#general-setup) |
@@ -75,7 +74,7 @@ $ npm start |
75 | 74 |
|
76 | 75 |  |
77 | 76 |
|
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. |
79 | 78 | 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”. |
80 | 79 |
|
81 | 80 | ## Firebase Authentication |
@@ -167,8 +166,8 @@ This sample uses [Firebase Cloud Firestore](https://firebase.google.com/docs/fir |
167 | 166 |
|
168 | 167 |  |
169 | 168 |
|
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. |
172 | 171 |
|
173 | 172 | 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. |
174 | 173 |
|
@@ -321,17 +320,6 @@ There are three key collections of data as shown below (Note that the document i |
321 | 320 |
|
322 | 321 | <br/> |
323 | 322 |
|
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 | | - |
335 | 323 | # First deploy |
336 | 324 |
|
337 | 325 | 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 |
560 | 548 |
|
561 | 549 | ## Link API Project to your Play Console |
562 | 550 |
|
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 | | - |
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. |
570 | 552 |
|
571 | 553 | ## Setup a service account |
572 | 554 |
|
|
0 commit comments