adjust / cordova_sdk

This is the Cordova SDK of
http://www.adjust.com
Other
37 stars 43 forks source link

Ionic 3 issue - adjustConfig.hasConversionValueUpdatedCallbackListener is not a function #147

Closed afelipelli closed 2 years ago

afelipelli commented 2 years ago

I implemented the SDK with the latest plugin and Ionic wrapper:

ionic cordova plugin add com.adjust.sdk npm install @ionic-native/adjust

which installed these:

"com.adjust.sdk": "^4.29.0", "@ionic-native/adjust": "^5.36.0",

With those in place, the attribution wasn't working. After debugging, I noticed this error in the logs:

TypeError: adjustConfig.hasConversionValueUpdatedCallbackListener is not a function That was when I called adjust.create()

Indeed, this function didn't exist and I couldn't make it work, so I downgraded to versions I had used before:

"com.adjust.sdk": "^4.23.0", "@ionic-native/adjust": "^5.29.0",

And that worked. So apparently, there's something wrong with the latest versions. Maybe the combination of these two versions don't work? Notice I don't call this hasConversionValueUpdatedCallbackListener in my code.

Thanks, Alex

uerceg commented 2 years ago

Hi @afelipelli

Thanks for reporting this. We'll check this on our end and keep you posted.

ShishoA commented 2 years ago

I implemented the SDK with the latest plugin and Ionic wrapper:

ionic cordova plugin add com.adjust.sdk npm install @ionic-native/adjust

which installed these:

"com.adjust.sdk": "^4.29.0", "@ionic-native/adjust": "^5.36.0",

With those in place, the attribution wasn't working. After debugging, I noticed this error in the logs:

TypeError: adjustConfig.hasConversionValueUpdatedCallbackListener is not a function That was when I called adjust.create()

Indeed, this function didn't exist and I couldn't make it work, so I downgraded to versions I had used before:

"com.adjust.sdk": "^4.23.0", "@ionic-native/adjust": "^5.29.0",

And that worked. So apparently, there's something wrong with the latest versions. Maybe the combination of these two versions don't work? Notice I don't call this hasConversionValueUpdatedCallbackListener in my code.

Thanks, Alex

same .

rahulm2 commented 2 years ago

@afelipelli @uerceg when I moved back "com.adjust.sdk": "^4.23.0", "@ionic-native/adjust": "^5.29.0" it worked fine for android but didnt work for IOS. Can any of you help me with this

IgorSavchenko90 commented 2 years ago

Same problem. Have any solution?

rahulm2 commented 2 years ago

@afelipelli @uerceg Where can I find the documentation for ionic and capacitor implementation? Facing an issue with ios builds

uerceg commented 2 years ago

Hey guys,

Sorry for delay on this one. I think I see where the issue is. JavaScript method which is mentioned in the error message (https://github.com/adjust/cordova_sdk/blob/master/www/adjust_config.js#L290-L292) is not added to ionic-native typings (missing from this section https://github.com/danielsogl/awesome-cordova-plugins/blob/master/src/%40awesome-cordova-plugins/plugins/adjust/index.ts#L220-L242).

We will submit PR to awesome-cordova-plugins repo with the fix which, once merged should hopefully make this error disappear. Will keep you posted.

uerceg commented 2 years ago

PR submitted.

uerceg commented 2 years ago

PR has been merged. Can you guys give latest SDK version and latest TypeScript typings version a shot?

Aviho-M commented 2 years ago

Hi guys any new ? Which Sdk version works best?

uerceg commented 2 years ago

Hey @Aviho-M,

This is already released in awesome-cordova-plugins repo. If you are still facing the same issue, it might be because you are still trying to use TypeScript typings from deprecated ionic-native repo instead from awesome-cordova-plugins. Give this a shot:

  1. Check if inside of your APP_DIRECTORY/node_modules you have @ionic-native/adjust folder. If you do, that means that you have install from ionic-native repo. Remove it with npm uninstall @ionic-native/adjust.
  2. Install Adjust TypeScript typings from awesome-cordova-plugins repository with npm install @awesome-cordova-plugins/adjust.

In addition to that, make sure to change the import statement in your app code to redirect to new repo. So replace:

import { Adjust, AdjustConfig, AdjustEnvironment, AdjustLogLevel } from '@ionic-native/adjust/ngx';

with:

import { Adjust, AdjustConfig, AdjustEnvironment, AdjustLogLevel } from '@awesome-cordova-plugins/adjust/ngx';

After this, things should hopefully work. Let us know if this worked for you.

uerceg commented 2 years ago

In case issue still persists for you, feel free to comment / reopen. Cheers.