mkloubert / nativescript-social-login

NativeScript plugin for social (token based) log-ins.
MIT License
42 stars 44 forks source link

interop is undefined #56

Closed rohanrichards closed 6 years ago

rohanrichards commented 6 years ago

I'm following the readme and am including the class definition in my main.ts file before bootstrapping (Nativescript, Angular, Typescript)

Initially there are many undefined variables, so I had to go and look at the example which shows you how to define them to satisfy TS. However one is left undefined:

  try {
    const errorRef = new interop.Reference(); //interop is undefined here
    GGLContext.sharedInstance().configureWithError(errorRef);

    const signIn = GIDSignIn.sharedInstance();
    gglDelegate = true;
  } catch (error) {
    console.log(error);
  }

I am testing just adding declare var interop: any to the top of the file to see if that will let me build, however I'm not confident this will work as I'm not familiar with any of this.

jogboms commented 6 years ago

@rohanrichards That should fix it. But as a side note, you can install tns-platform-declarations so that can get native Type definitions.

rohanrichards commented 6 years ago

@jogboms Thanks for the quick reply and recomendation. For future reference, if you dont mind what's the full command to install those TS definitions? Are they usually just an NPM module?

npm i tns-platform-declarations

jogboms commented 6 years ago

Yes it is. do this instead npm i -D tns-platform-declarations