NativeScript / NativeScript/plugins

@nativescript/google-signin Configure Placement

未关闭
#510 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
206
派生
123
平均合并
2 天 1 小时
30 天内合并 PR
1

描述

From the comment and past experiences I figured the configure method needed to be called in main.ts.
https://github.com/NativeScript/plugins/issues/492#issuecomment-1547155963

Also be sure you have called configure in main.ts (or app.ts depending on project type), eg:

import { GoogleSignin } from '@nativescript/google-signin';

GoogleSignin.configure();

This results in a error
GoogleSignin configuration error: Error: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter activity

and a GoogleSignin.signIn() error of
.signIn Error: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)' on a null object reference

Putting the configure in a component or service after main.ts, still ensuring it's called only once, fixes this but it conflicts with @NathanWalker's recommendation

Examples made from ns create example-app --ng:
https://github.com/NicholasSmilovic/nativescript-google-signin-demo -> master broken
https://github.com/NicholasSmilovic/nativescript-google-signin-demo/pull/1 -> working

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 issue 中描述的入口点 main.ts/app.ts 以及 @nativescript/google-signin 的 configure 和 signIn 调用开始。将损坏的示例与链接的可正常工作的 pull request 进行比较,然后验证从推荐的入口点进行配置不再产生 Android 错误,并且 signIn 成功。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, typescript
领域
authentication, mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。