plugins icon indicating copy to clipboard operation
plugins copied to clipboard

@nativescript/google-signin Configure Placement

Open NicholasSmilovic opened this issue 2 years ago • 0 comments

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

NicholasSmilovic avatar Jun 12 '23 15:06 NicholasSmilovic