1

I'm trying to make the Cordova plugin for HockeyApp work in my ionic 2 project. It doesn't seem to work with typescript so I found a typescript definition to add here: https://github.com/bitstadium/HockeySDK-Cordova/issues/47 (the comment by oz-frog) but I don't know how to use it.

I tried to but the file in my app-folder but that didn't work. I tried to paste it below the component that will use it, in the same file, but that didn't work either.

So now I'm stuck. Anyone who knows what to do?

/Nattis

Nattis
  • 11
  • 3

1 Answers1

0

I solved! Thought I'd post my solution here for others with the same problem :)

I simply declared my own hockeyapp-variable and then it just worked. It doesn't work in the browser though for obvious reasons.

declare var hockeyapp;

I put it above the @Component, right below the imports, I don't know if that's important. Then I just used my variable as the instructions says:

try{
  hockeyapp.start(null, null, appid);
}catch(error){
  console.log("No hockeyapp for you");
}

I put the try-catch there so I still can run it in the browser without getting errors.

Nattis
  • 11
  • 3