I have a expo android app and react web app. Both the app uses phone authentication from firebase. When creating a new user, stripe extension creates a new user in stripe simultaneously. The issue is my customer logs primarily in android app and not in web app. Now I need to create a subscription for new user with a trial period. After the trail period I can ask my customer to pay the subscription from web app. How can I create new subscription with trial period from firebase function when a new user is created? Or is it possible to create subscription automatically for all new users with a particular subscription product and trial period without payment information?
Here is how to create Subscription with trial period. No payment method is required for the customer, but until the trail ends you will need to collect their payment info. Stripe has a Doc explains this scenario.
Related
i starting creating new function from telegram web app. I trying create web app shop, about to create web app interaction it success. but how to forward data from telegram to web app?
example: a buyer click my product in my telegram bot and add to cart, so when that buyer click web app to modified product and shipping address, how can this bot forward that current cart data also telegram id to my web app server? trying find this documentation in telegram documentation bot api but not found maybe i missed it.
My app supports only login via Email/Password, Google, and Facebook using Firebase Authentication.
Inside the Authentication -> Settings tab, Firebase said to me "Upgrade to Firebase Auth with Identity platform to access this feature."
I upgraded successfully because I want to disable create a new account on the client side and disable delete account. These features are only what I want.
If you interested to know why I want to disable creating a new account on the client side? Please check my question here to know why.
Today I opened Firebase Pricing and I found there are changes in Firebase Authentication, Firebase added 2 new rows in the last as you can see.
I was not charged in Phone verifications because I don't use this provider. I only charged for Firebase Realtime Database and Firebase Storage.
Here are my questions:
Identity Platform Pricing Monthly active users (excluding SAML/OIDC) => If there were 83,000 daily active users (83,000 * 30 = 2,490,000), At the end of the month how much I'll be charged approximately?
Monthly active users - SAML/OIDC => As I said above my app supports only login via Email/Password, Google, and Facebook, Does that mean I'll not be charged about SAML and OIDC?
I hope everything is clear. Thank you.
If you have 83K monthly active users then you won't be charged for 50K users as it falls in the free tier. But you'll be charged for the next 33K users as per the pricing mentioned in Google Cloud Documentation:
From the documentation,
Any account that has signed in within a given month is considered an active user. Inactive users are stored at no cost.
For the given example, you bill would be:
0.0055*33000 = $181.5 / month
my app supports only login via Email/Password, Google, and Facebook, Does that mean I'll not be charged about SAML and OIDC?
Yes, if you are not using SAML/OIDC (Tier 2 providers) then you'll be charged based on Tier 1 pricing mentioned above only.
If you use any Tier 2 provider then you only have up to 50 free MAU and $0.015 / MAU / month thereafter.
I am developing Xamarin.Forms application which will be used for Android and iOS. It will have access to full functionality with a paid subscription (monthly or yearly). We plan to use in-app billing for implementing subscription on both stores.
There is a situation if a user buys the subscription in Android app and then wants to use iOS app or vice versa. In this situation, the user should be able to use the other platform app, because the user already purchased the subscription. We are planning to fix this issue by a back-end REST API. When the user purchase the app in android or iOS, we save the subscription details to our back-end. So once the user purchased the subscription in any platform, the user can use the app on other platform and multiple devices.
But if the user cancels the subscription from outside the app like apple or play store, how we can update the status on our back end? Because at this time the action happening on outside the app, so we can't update the status on back-end.
For example, If the user subscribed the app from play store and also using the iOS version. Then the user cancelling the subscription on play store. After that the user is not using the android app. At the same time the status is true on back end. So the user can use the iOS version without a subscription. How we can handle this type of situations?
We research a lot and find out we can call app store and play store via their APIs which will return the entire subscription details. So we will call it from the back end as a cron job and update the latest status once in a day. So if the user cancels the subscription from outside the app, that status will update on the back-end via cron job. Is this possible? Any other better solution for this kind of issues?
I'm integrating Stripe with firebase and firestore using the Run Subscription Payments with Stripe extension. When a user subscribes to the service I need to be able to decode the JWT and see if they are subscribed or not through a custom claim.
The logs on the function show that it is invalidating the custom claim. I'm unsure why this is happening.
From the logs you've provided, it looks like you have multiple subscriptions (sub_KBpVfFzNclrhaG and sub_KBpV10rxE6jkkH) that are both tied to the same user/customer. Subscription sub_KBpVfFzNclrhaG has a status of active or trialing, and so the custom claim was correctly added. However, subscription sub_KBpV10rxE6jkkH was created shortly afterwards (I assume with a status that wasn't active or trialing) which updated the user's custom claim again to null. You can confirm that this is happening by checking the statuses of both Subscriptions in your dashboard.
You need to make sure you have only one active/trialing Subscription per-customer, which would be something you check in your app logic. There's an example of how to check for active/trialing subscriptions for a customer here (https://github.com/stripe-samples/firebase-subscription-payments/blob/4cf116c163ba69f0f46bcc782e4162e0edf452a4/public/javascript/app.js#L121)
I'm building a flutter app that will allow users to subscribe. I'm using this plugin: in_app_purchase 0.5.2
So, my question is: I have to log my users in, and I do this using firebase Auth. But, how can I check which user is logged to deliver them the right purchase? I mean, using the firebase Auth, where or must I check if the current user has purchased something?
You can use a database like firestore to store all the purchase information.
Ex:
Users/Auth-id
then retrieve it whenever needed. you can also get the previous purchases with the API
Ex:
final QueryPurchaseDetailsResponse response = await InAppPurchaseConnection.instance.queryPastPurchases(); //returns previous purchases
Note that the App Store does not have any APIs for querying consumable products, and Google Play considers consumable products to no longer be owned once they're marked as consumed and fails to return them here. For restoring these across devices you'll need to persist them on your own server and query that as well.