Need help regarding integration in ionic

Hello,

i am pretty new to ionic and my task is to implement countly on ionic but i am not able to do it. My ionic info is:

I added this library to my app but it looks like it is written for vanilla javascript so i can't import it in my app. can anyone help me on this?

0

Comments

8 comments
  • Hi @izaan

    I will be able to help you on this.

    Countly is a global name scope.

    You can declare a global variable

    Countly: any;

    and start using the same method, in the documentation.

    There is also a ionic version implemented here:

    You can take a look at the example here.

    Also a link to the documentation page.

    Thanks

    0
    Comment actions Permalink
  • hi thanks for replying,

    i copy paste ionic.countly.ts file in my project and import it but when i call any function i get an error. Property doesn't exist on type "typeof Countly". i am new to ionic can you please explain in detail

    0
    Comment actions Permalink
  • Here is an example app for ionic with countly integration.

    I know it is very old, and haven't tested it since a while.

    Please review it and let me know.

    Thanks

    0
    Comment actions Permalink
  • hi,

    i copied ionic.countly.ts from countly-sdk-js (i tried to paste link but this post was treated as spam for some reason by your auto system ) into my project and then built for android and i am getting this error

    i can see that this function .exec() is used several times in countly file

    0
    Comment actions Permalink
  • trinisofttechnologie:

    Here is an example app for ionic with countly integration.

    cordova.exec is not available in browser mode.

    I think you are testing it on a browser.

    It only works on android / iPhone / simulator.

    Wouldn't work on web, there is a seperate sdk for it.

    countly-sdk-web

    Thanks

    0
    Comment actions Permalink
  • i know about the web sdk and i am using it in react but this one is not working on web, i am using ionic and testing it on a real physical android device, the screenshot i pasted is actually the debug mode. i have connected my android device via chrome remote devices and debugging the app remotely to see the error message

    0
    Comment actions Permalink
  • OK, I follow you now.

    I will review the example app,
    and the type script and let you know about any further changes.

    It will be better to create an issue for this on GitHub, so that you can track progress on it.

    0
    Comment actions Permalink
  • I was able to add ionic example to the repo
    https://github.com/Countly/countly-sdk-js/tree/master/example/ionic
    Here is an example for it.
    Please take a look at it.

    0
    Comment actions Permalink

Please sign in to leave a comment.