У меня есть обучающее приложение Ionic 4, вставленное с github.com/ionicthemes/ionic-google-login. У меня есть следующий код, который вызывается:
this.googlePlus.login({
'scopes': '', // optional - space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
'webClientId': environment.googleWebClientId, // optional - clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
'offline': true, // Optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
}).then(user => {
console.log('+++ user is:', user);
}, err => {
console.log("+++ google login error:", err);
})
И ни успех, ни сообщения об ошибках не печатаются. Я жду ответа от Google.
Я сделал это: keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v
и добавил отпечаток sha1 на console.developers.google.com. Имя пакета совпадает (com.tgm_ionic), и я выбрал oauth2 android flow.
Дополнительная информация: раньше работала на платформе браузера, но не работала на симуляторе Android с ошибкой 10, что означает «недопустимая аудитория». Поэтому я создал новые учетные данные для перехода с платформы браузера на платформу Android (все еще oauth2), и теперь я сталкиваюсь с этой проблемой. Цель здесь - войти в систему на Android, а не в браузере.