[go: nahoru, domu]

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

in_app_purchases codelab: Dart Server implementation #1493

Merged
merged 38 commits into from
Apr 18, 2023

Conversation

miquelbeltran
Copy link
Member

PR with all the changes for the In-App Purchases codelab.

This completely removes the firebase-backend and adds the dart-backend.

The copy of the codelab document has been updated to reflect all the changes, and this PR shouldn't be merged until the document has been reviewed.

I will open it as draft to see if there are any CI issues, and go back and check the whole codelab one more time step by step to see if I missed something.

Pre-launch Checklist

  • I read the Effective Dart: Style recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///). <- Check codelab document
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

@miquelbeltran miquelbeltran changed the title Mb in app payments codelab in_app_purchases codelab: Dart Server implementation Mar 20, 2023
@domesticmouse
Copy link
Contributor

I'm seeing the following issue in CI:

== Testing
Analyzing app...

  error - lib/logic/firebase_notifier.dart:10:8 - Target of URI doesn't exist: '../firebase_options.dart'. Try creating the file referenced by the URI, or try using a URI for a file that does exist. - uri_does_not_exist
  error - lib/logic/firebase_notifier.dart:37:18 - The argument type 'dynamic' can't be assigned to the parameter type 'FirebaseOptions?'. - argument_type_not_assignable
  error - lib/logic/firebase_notifier.dart:37:18 - Undefined name 'DefaultFirebaseOptions'. Try correcting the name to one that is defined, or defining the name. - undefined_identifier

My concern here is that it is only showing on stable. I'm guessing this isn't enabled for beta, can you look at see what changes are required to enable beta on CI and make it go green? We may need to have a separate PR that stashes the required beta changes for when stable version increments.

@miquelbeltran
Copy link
Member Author

Stable is fine now, Beta fails because there's a Column that in Beta could be const, but that's not possible on Stable. So Beta fails. Should I disable Beta CI for this project again? @domesticmouse

@domesticmouse
Copy link
Contributor

Stable is fine now, Beta fails because there's a Column that in Beta could be const, but that's not possible on Stable. So Beta fails. Should I disable Beta CI for this project again? @domesticmouse

Yup, comment out the beta CI and add a todo line that hints at the required fix. Thanks!

@miquelbeltran miquelbeltran marked this pull request as ready for review March 27, 2023 15:15
@domesticmouse domesticmouse self-assigned this Mar 27, 2023
@miquelbeltran
Copy link
Member Author

@domesticmouse let me know how you want to go on merging this. The codelab document is also ready.

I am not sure if you need for someone else to review it before publishing.

@domesticmouse
Copy link
Contributor

@domesticmouse let me know how you want to go on merging this. The codelab document is also ready.

I am not sure if you need for someone else to review it before publishing.

I'm waiting on a review from @RedBrogdon for the codelab text. When that is ready to land, I'll do both at the same time

@domesticmouse
Copy link
Contributor

Setting expectations: this is on hold for a couple of weeks while Andrew and I sort out a few things. =)

@domesticmouse
Copy link
Contributor

@miquelbeltran I did bad, and I landed some conflicts. Can you clean up the conflicts so I can land this? Thanks!

@domesticmouse
Copy link
Contributor

PTAL @miquelbeltran =)

@miquelbeltran
Copy link
Member Author

fixed the merge issues

@domesticmouse domesticmouse merged commit 93d70c2 into flutter:main Apr 18, 2023
8 checks passed
@miquelbeltran miquelbeltran deleted the mb-in-app-payments-codelab branch April 19, 2023 04:54
@FuadEfendi
Copy link

Hello,

I was in the middle of studying/changing firebase-backend, and it is completely removed now; documentation changed; and it is replaced by dart-backend. Any reasons for that? I could use Firebase functions; but now I need to think where to host dart-backend? Thanks

@domesticmouse
Copy link
Contributor

Hello,

I was in the middle of studying/changing firebase-backend, and it is completely removed now; documentation changed; and it is replaced by dart-backend. Any reasons for that? I could use Firebase functions; but now I need to think where to host dart-backend? Thanks

Keeping the node based server up to date with the changes in the node community required more node knowledge than I have.

@FuadEfendi
Copy link
FuadEfendi commented Jul 3, 2023

Keeping the node based server up to date with the changes in the node community required more node knowledge than I have.

Thanks, same with me ;) using Dart and TypeScript together made learning path difficult...

It seems I can use Firebase Hosting for dart-backend? https://firebase.google.com/docs/hosting/frameworks/flutter

@miquelbeltran
Copy link
Member Author

It seems I can use Firebase Hosting for dart-backend? https://firebase.google.com/docs/hosting/frameworks/flutter

That looks to me a way to host Flutter Web apps rather than a Dart backend based of Shelf.

https://dart.dev/server/google-cloud Google Cloud Run seems the right tool for the job, although I haven't got time to play with it.

@FuadEfendi
Copy link
FuadEfendi commented Jul 4, 2023

Hi @miquelbeltran

Documentation is already outdated; screenshots, both Google, and Apple; for example, need to create collection "purchases" in Firestore, otherwise it will throw NullPointerException, and few other things, not documented at all.

Where should I report it?

After fixing almost all issues, including enabling Pub-Sub in Google, I have this:

➜  dart-backend git:(master_archived) ✗ dart ./bin/server.dart
Serving at http://0.0.0.0:8080
Polling Google Play messages
Polling App Store
Unhandled exception:
DetailedApiRequestError(status: 404, message: Resource not found (resource=play_billing-sub).)
#0      validateResponse (package:_discoveryapis_commons/src/api_requester.dart:306:9)
<asynchronous suspension>
#1      ApiRequester.request (package:_discoveryapis_commons/src/api_requester.dart:72:16)
<asynchronous suspension>
#2      ProjectsSubscriptionsResource.pull (package:googleapis/pubsub/v1.dart:1608:23)
<asynchronous suspension>
#3      GooglePlayPurchaseHandler._pullMessageFromPubSub (package:firebase_backend_dart/google_play_purchase_handler.dart:170:26)
<asynchronous suspension>

Maybe I need to wait? "pub-sub" was enabled few minutes ago. Thanks,

@FuadEfendi
Copy link

I found section in docs, "Google Play setup", I need to create topic; https://codelabs.developers.google.com/codelabs/flutter-in-app-purchases#10

Sorry for polluting this pull request; I don't know where to report such issues. Documentation is incomplete.

@miquelbeltran
Copy link
Member Author
miquelbeltran commented Jul 6, 2023

There is a "report mistake" in the bottom left corner of the codelab website. I'd ask please that you create a ticket for each issue you find, so we can focus on each issue separately. Please be specific which each report, e.g. if a screenshot needs updating, please indicate exactly which one and why it is outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants