Hi. I'm Miguel,
and I'm a Developer Advocate on Android TV.
And I'm here to introduce you to Fictional Subscriptions,
a new subscription product that's launching on Android TV.
The goal of Frictionless Subscriptions
is to get users to the content they want as quickly and easily as possible.
And in order to do this,
we leverage several existing developer integrations.
So first, with Google Play Billing,
you can support subscriptions, handle out-of-app purchases,
and acknowledge purchases using the latest billing library.
Additionally, real-time developer notifications
allow you to be notified of new Frictionless Subscription purchases
and let you handle service and purchase acknowledgment.
Next, the new streamlined account-making flow
enables account creation and linking.
And it's built on top of existing OAuth account linking integrations.
Finally, you'll need to use Google Sing-Ins silentSignIn API
to automatically sign the user in on Android TV.
Let's take a look at how these integrations come together
to make a frictionless experience.
So here I am on the Android TV Play store
for my favorite subscription app, Classy Taxi.
I can select the Subscribe and Install button
to start the Fictional Subscriptions flow.
So here in my purchase card,
I can review the subscription details and finalize my subscription purchase
before the app is even installed.
After finalizing my subscription,
Google contacts Classy Taxi's back end
to automatically create a new Classy Taxi account for me,
using my Google identity.
This saves me from having to type in my username
and password with my remote.
Once my account is created, the Classy Taxi app launches.
Notice I'm automatically signed in with my new account.
And I can see the newly purchased subscription
has already been registered.
Now that you have an idea of how this experience works,
let's take a deeper dive at the different integrations.
First, the new streamlined account making flow
handles account creation and linking.
And it's built on top of OAuth account linking.
To start, Google sends Classy Taxi a check request,
along with the Google ID token.
Classy Taxi checks if there's an existing matching ID
token or email.
In this case, I don't have an existing Classy Taxi account,
so Classy Taxi returns account_found false.
Next, Google will send a create request,
along with the ID token.
Classy Taxi will create an account using the user's email,
name, and profile picture.
After the account is created,
Classy Taxi will link the new Classy Taxi account
with the Google account, and return the access token.
But what if you already have an existing Classy Taxi account?
Streamlined account linking also supports this.
After Google sends the check request
and Classy Taxi finds a matching Google ID or email,
it will respond with account_found true.
Now, instead of sending a create request,
Google will send a get request that will link the existing Classy Taxi account
with the Google account and return the access token.
After streamlined account linking is completed,
Google will call the user info endpoint.
Frictionless Subscriptions utilizes
a new server-initiated approach to acknowledging purchases,
utilizing this user info endpoint.
After streamlined account linking completes,
Google calls the user info endpoint for the recently linked account.
Classy Taxi returns two fields, sub and email, for the account.
Later, after you receive real-time developer notifications
for the new subscription,
you'll call subscriptions.get to get the full purchase object.
Here you'll find external account ID
has been set to the sub value provided in your user info response.
Since you know which account the subscription belongs to,
you can now register the subscription with that account
and acknowledge the purchase with the Google Play Developer API.
And as a fallback, in case of linking errors or some raised conditions,
your Android TV app should also check for unacknowledged purchases
using query purchases in your on resume method.
And finally, with your app already granted permission to sign in with Google,
you can automatically sign the user in using Google Sign Ins silentSignIn API
on Android TV.
You'll call silentSignIn from your Google Sign In client.
If successful, it will return a Google Sign In account,
and you can use the Google ID token to sign the user in.
And that's it.
I hope you now have a better understanding of Frictionless Subscriptions,
and how it leverages all these different integrations.
Thanks for watching.