Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

rn: adapt to API changes in google signin

Saúl Ibarra Corretgé54a9b9199e91
diff --git a/react/features/google-api/googleApi.native.js b/react/features/google-api/googleApi.native.js
index 38a99d14fe..06b25f2f72 100644
--- a/react/features/google-api/googleApi.native.js
+++ b/react/features/google-api/googleApi.native.js
@@ -35,6 +35,15 @@ class GoogleApi {
}
}
+ /**
+ * Retrieves the current tokens.
+ *
+ * @returns {Promise}
+ */
+ getTokens(): Promise<*> {
+ return GoogleSignin.getTokens();
+ }
+
/**
* Retrieves the available YouTube streams the user can use for live
* streaming.
diff --git a/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js b/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js
index f753709d4d..ce0e2ac49b 100644
--- a/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js
+++ b/react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js
@@ -119,13 +119,22 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
* @returns {void}
*/
_onUserChanged(response) {
- if (response && response.accessToken) {
- googleApi.getYouTubeLiveStreams(response.accessToken)
- .then(broadcasts => {
- this.setState({
- broadcasts
+ if (response) {
+ googleApi.getTokens()
+ .then(tokens => {
+ googleApi.getYouTubeLiveStreams(tokens.accessToken)
+ .then(broadcasts => {
+ this.setState({
+ broadcasts
+ });
+ });
+ })
+ .catch(() => {
+ this.setState({
+ broadcasts: undefined,
+ streamKey: undefined
+ });
});
- });
} else {
this.setState({
broadcasts: undefined,