Open liuy97 opened 2 years ago
@liuy97 I believe this is an issue with your app, not with the plugin. It could be related to upgrading the nativescript platform version in your app from an earlier version. I can successfully create a new nativescript app using 8.1.4, add the Tealium plugin, and build without errors, but your demo project throws the error you described.
These are the steps I took:
tns create
- create a default Angular template appnpm i @tealium/nativescript-plugin
tns run ios
I can't see any issues in our package, and it works fine with our demo project. Sorry we can't be more helpful in this instance.
@craigrouse, Thanks for your qucik reply. I also created this demo from default template. However, you did not add any tealium-related code, did you? I have to call Tealium.initialize(config) in analytics.util.ts. Do I miss something? or this plugin does not need to initialize.
@liuy97 OK, I do see the error if I try to add some Tealium code to the app I created. I can resolve it by adding the file it claims is missing to the app's tsconfig.json, but it then crashes at runtime with a JS error. I believe this may be a bug in the NativeScript Angular plugin. I'll try a pure TypeScript app next without Angular and see if that works - this is what our demo app on the repo is, and that works perfectly.
Thanks. We plan to integrate this plugin into your app (Nativescript + Angular). I hope that you can provide a sample for Nativescript and Angular too.
@craigrouse Any idea on how to get this to work for NativeScript + Angular?
@fpaaske @liuy97 We are looking into it, but I don't have an immediate fix. As far as I can tell, there is nothing wrong with the plugin that should prevent it from working with Angular - I believe this is a NativeScript issue. Hopefully we'll be able to find a workaround. Let us know if you find one in the meantime.
@craigrouse , I have fixed this bug via rebasing your code with plugin-seed , refs https://github.com/liuy97/tealium-plugin. It works as expected now.
@liuy97 Thank you for this! We were in the process of coming up with a solution, but it was a lot more complicated than this. We'll take a look, and assuming this works for us, we'll get it merged into our repo. Appreciate you taking the time to let us know.
@liuy97 I have been looking into this issue and still seem to be having problems. I tried installing it via the repo you had sent and still get the error that the index.ios.ts
is missing. Did you make any configuration changes on your angular project / could you possibly setup a working demo project and attach it here?
No. I have committed all codes.
npm start
select @nativescript.build-all
npm start
select apps.demo-angular.ios
However, if you install from a npm package into another project, you need the following in references.d.ts
/// <reference path="./node_modules/@tealium/nativescript-plugin/platforms/android/typings/android.d.ts" />
/// <reference path="./node_modules/@tealium/nativescript-plugin/platforms/ios/typings/ios.d.ts" />
@craigrouse @trister1997 did you get any further with this? It would be great to have an official Tealium plugin to use in our NativeScript + Angular app.
@fpaaske I do apologise - this had fallen off our radar. We'll take another look at it and get back to you. If you have any suggestions, then do let us know; we aren't experts in NativeScript, and as far as I know we did everything properly (and it works with a pure JS NativeScript implementation), so I'm not sure exactly what's wrong.
ns 8.1.4
unzip demo.zip demo.zip
npm i
ns build ios
ERROR in ./node_modules/@tealium/nativescript-plugin/index.ios.ts