GithubHelp home page GithubHelp logo

appsflyer-nativescript-plugin's Introduction

appsflyer-nativescript-plugin

Nativescript Library for AppsFlyer SDK

npm version

Table of content

  • iOS AppsFlyerSDK v6.13.1
  • Android AppsFlyerSDK v6.13.0

v6.5.4

Android: deepLinkResult will return an object instead of a string

$ tns plugin add nativescript-plugin-appsflyer


Call module by adding (native javascript):

var appsFlyer = require("nativescript-plugin-appsflyer");


initializes the SDK.

parameter type description
options Object SDK configuration

options

name type default description
devKey string Appsflyer Dev key
appId string Apple Application ID (for iOS only)
isDebug boolean false debug mode (optional)
onConversionDataSuccess function AppsFlyer allows you to access the user attribution data in real-time for every new install, directly from the SDK level. By doing this you can serve users with personalized content or send them to specific activities within the app, which can greatly enhance their engagement with your app. For Android; for iOS
onConversionDataFailure function

Example:

 var options = {
            devKey:  'WdpTVAcYwmxsaQ4WeTspmh',
            appId: "975313579",
            isDebug: true,
            timeToWaitForATTUserAuthorization: 60,
            onConversionDataSuccess: function(_res){
                console.log(JSON.stringify(_res));
            },
            onConversionDataFailure: function(_res){
                console.warn("failure: " + JSON.stringify(_res));
            },
        };

        appsFlyer.initSdk(options).then(function(result) {
            viewModel.set("initSdkResponse", result.status);
        }, function(err) {
            viewModel.set("initSdkResponse", JSON.stringify(err));
        });

  • These in-app events help you measure how loyal users discover your app, and attribute them to specific campaigns/media-sources. Please take the time define the event/s you want to measure to allow you to measure the ROI (Return on Investment) and LTV (Lifetime Value).
  • The logEvent method allows you to send in-app events to AppsFlyer analytics. This method allows you to add events dynamically by adding them directly to the application code.
parameter type description
options Object log event configuration

options

parameter type description
eventName string custom event name, is presented in your dashboard. See the Event list HERE
eventValues Object event details (see example bellow)

Example: (native javascript)

 
        var options = {
            eventName: "af_add_to_cart",
            eventValues: {
                "af_content_id": "id123",
                "af_currency": "USD",
                "af_revenue": "2"
            }
        };
        appsFlyer.logEvent(options).then(function(result) {
            viewModel.set("logEventResponse", result);
        }, function(err) {
            viewModel.set("logEventResponse", JSON.stringify(err));
        });
    
    

Demo

This plugin has a demo project bundled with it. To give it a try , clone this repo and from root a.e. nativescript-plugin-appsflyer execute the following:

npm run setup
  • Run npm run demo.ios or npm run demo.android will run for the appropriate platform.

appsflyer-nativescript-plugin's People

Contributors

af-fess avatar al-af avatar codeback avatar gm-appsflyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

appsflyer-nativescript-plugin's Issues

Missing support of UDL deep-links for new and existing users

There is no support to implement UDL links for new and existing users.
For Android the plugin does not support versions 6.1+ as required for dynamic links.
There is no access on the plug-in API to the DeepLinkListener that is required to listen to UDL links.

Is there a time frame for upgrading this plug-in?

Version 5.4.2 - Appears to be a git repo or submodule

I have this error installing the new version 5.4.2. In the node-module folder of the package there is a .git folder. Deleting it then it works. Is it possible to resolve the problem with a new build?

npm ERR! path /node_modules/nativescript-plugin-appsflyer
npm ERR! code EISGIT
npm ERR! git /node_modules/nativescript-plugin-appsflyer: Appears to be a git repo or submodule.
npm ERR! git /node_modules/nativescript-plugin-appsflyer
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

How to use with Nativescript + Angular

Hi !
How tu use this plugin with Nativescript + Angular ?
I have this error :

/nativescript-plugin-appsflyer/index"' has no exported member 'appsFlyer'.

Thanks !

Android non-organic installs

Using the android SDK Integration test app, it reports that the integration test is OK, but I cannot see non-organic installs in the dashboard, but I see the click count rise with every test.

$ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 4.0.1 version and is up to date.
✔ Component tns-core-modules has 4.0.0 version and is up to date.
✔ Component tns-android has 4.0.1 version and is up to date.
✔ Component tns-ios has 4.0.1 version and is up to date.

I see organic installs and track_events but no result for non-organic installs

App Tracking Transparency (ATT) support

With the release of iOS 14.5, tracking frameworks are only allowed to access a users IDFA after he/she gave his/her consent actively. For the iOS AppsFyler SDK, there is the option to delay events (such as app installs) tracked with AppsFlyer until the user had the option to answer the dialogue asking for his consent to be tracked (and as a result, send those events with the IDFA from then on instead of sending them without IDFA until he gave his consent). However, I cannot find the option to do this in the Nativescript plugins API or documentation. Am I missing something?

In my understanding, it is really important to delay especially the app installs until the IDFA is accessible, to optimise advertisement campaigns. So it seems important, that events are delayed. When the option to delay events is not accessible in the plugin, is there another way? Like initialising the plugin after asking for consent? Does this also delay events?

Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/dynamic/zzg;

Hello, Good morning:

I am integrating my application with this plugin:

I installed the plugin with: tns plugin add nativescript-plugin-appsflyer

That added In the dependencies object in package.json:
"nativescript-plugin-appsflyer": "^5.2.2",

I my app.component.ts I call :

appsFlyer.initSdk(options).then(function(result) { console.log("intSDKresponse!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@@@: " + result.status ); }, function(err) { console.warn("initSDKresponse!!!!!!!!!!!@@@@@@@@@@@@@@@@: " +JSON.stringify(err)); });

with my devkey and appId given from my dashboard.

After that I run:
tns run android

My build is successfully but when I start my application I am getting the following stack-trace:

JS: HMR: Hot Module Replacement Enabled. Waiting for signal. JS: Fetching..... JS: AppsFlyer :: trackAppLaunch is called JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode. JS: intSDKresponse!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@@@: success System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to start activity ComponentInfo{com.some.foo.package/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/dynamic/zzg; System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.some.foo.package/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/dynamic/zzg; System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3139) System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3282) System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1970) System.err: at android.os.Handler.dispatchMessage(Handler.java:106) System.err: at android.os.Looper.loop(Looper.java:214) System.err: at android.app.ActivityThread.main(ActivityThread.java:7156) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/dynamic/zzg; System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tnsome.foo.packageonCreate(NativeScriptActivity.java:19) System.err: at android.app.Activity.performCreate(Activity.java:7335) System.err: at android.app.Activity.performCreate(Activity.java:7326) System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275) System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3119) System.err: ... 11 more System.err: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/dynamic/zzg; System.err: at com.google.android.gms.ads.internal.client.zzm.zzjs(Unknown Source:0) System.err: at com.google.android.gms.ads.internal.client.zzag.zza(Unknown Source:11) System.err: at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:12) System.err: at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:1) System.err: ... 22 more System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamic.zzg" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar",

We tried to fix that by changing our version of google play

googlePlayServicesVersion = "16.+"

with:

googlePlayServicesVersion = "+"

but that does not fix the issue.

Could you give me a clue? How can we fix it?

Uninstall measurement

For uninstall measurement to work, the native SDKs have updateServerUninstallToken for Android and registerUninstall for iOS, but nothing is exposed in the NativeScript plug-in for this.

I have resorted to calling the native methods directly but would be good to have this accessible via de plug-in in a convenient way.

NativeScript encountered a fatal error: ReferenceError: Can't find variable: AppsFlyerLibDelegate

Hello,
I am here again.
First, thanks appsflayer team for the help in my last issue.
#32

I have another issue:
I am working with xcode 12 and ios 14 .
But we are having the follow error when we add the dependency in Ios and toggle off appflayer
With "toggle off" I mean not calling any method of Appflayer in Nativescript.

***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x10c72562e NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10c777524 -[TNSRuntime executeModule:referredBy:]
3 0x10afe9f33 main
4 0x7fff20257415 start
JavaScript stack trace:
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0
at ../ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js(file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:138:1)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts(file: ../modules/@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/index.ts(file: ../modules/@companyname/moduleName/src/app/services/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/moduleName.module.ts(file: ../modules/@companyname/moduleName/src/app/moduleName.module.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/index.ts(file: ../modules/@companyname/moduleName/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./runner/app.module.ts(file: ../modules/runner/app.module.ts:1:0)
at webpack_require(file://<…>
JavaScript error:
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0: JS ERROR ReferenceError: Can't find variable: AppsFlyerLibDelegate
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: AppsFlyerLibDelegate
at
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0
at ../ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js(file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:138:1)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts(file: ../modules/@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/index.ts(file: ../modules/@companyname/moduleName/src/app/services/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/moduleName.module.ts(file: ../modules/@companyname/moduleName/src/app/moduleName.module.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/index.ts(file: ../modules/@companyname/moduleName/index.ts:1:0)
at webpack_require(file:/<…>
NativeScript caught signal 6.
Native Stack:
1 0x10c776171 sig_handler(int)
2 0x7fff5da3f5fd _sigtramp
3 0x1
4 0x7fff200fabd4 abort
5 0x7fff20250818 abort_message
6 0x7fff20241e7d demangling_unexpected_handler()
7 0x7fff201781d1 _objc_terminate()
8 0x7fff2024fc47 std::__terminate(void ()())
9 0x7fff202523d0 __cxa_get_exception_ptr
10 0x7fff20252397 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception
)
11 0x7fff2017809c _objc_exception_destructor(void*)
12 0x10c725b6f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13 0x10c777524 -[TNSRuntime executeModule:referredBy:]
14 0x10afe9f33 main
15 0x7fff20257415 start
JS Stack:
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x10dc0862e NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10dc5a524 -[TNSRuntime executeModule:referredBy:]
3 0x10c4ccf33 main
4 0x7fff20257415 start
JavaScript stack trace:
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0
at ../ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js(file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:138:1)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts(file: ../modules/@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/index.ts(file: ../modules/@companyname/moduleName/src/app/services/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/moduleName.module.ts(file: ../modules/@companyname/moduleName/src/app/moduleName.module.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/index.ts(file: ../modules/@companyname/moduleName/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./runner/app.module.ts(file: ../modules/runner/app.module.ts:1:0)
at webpack_require(file://<…>
JavaScript error:
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0: JS ERROR ReferenceError: Can't find variable: AppsFlyerLibDelegate
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: AppsFlyerLibDelegate
at
file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:136:0
at ../ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js(file: ../modules/ANOTHER_MODULE_NAME/node_modules/nativescript-plugin-appsflyer/appsflyer.js:138:1)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts(file: ../modules/@companyname/moduleName/src/app/services/apps-flyer/apps-flyer.service.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/services/index.ts(file: ../modules/@companyname/moduleName/src/app/services/index.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/src/app/moduleName.module.ts(file: ../modules/@companyname/moduleName/src/app/moduleName.module.ts:1:0)
at webpack_require(file: ../modules/webpack/bootstrap:750:0)
at fn(file: ../modules/webpack/bootstrap:120:0)
at ./@companyname/moduleName/index.ts(file: ../modules/@companyname/moduleName/index.ts:1:0)
at webpack_require(file:/<…>
NativeScript caught signal 6.
Native Stack:
1 0x10dc59171 sig_handler(int)
2 0x7fff5da3f5fd _sigtramp
3 0x1
4 0x7fff200fabd4 abort
5 0x7fff20250818 abort_message
6 0x7fff20241e7d demangling_unexpected_handler()
7 0x7fff201781d1 _objc_terminate()
8 0x7fff2024fc47 std::__terminate(void ()())
9 0x7fff202523d0 __cxa_get_exception_ptr
10 0x7fff20252397 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception
)
11 0x7fff2017809c _objc_exception_destructor(void*)
12 0x10dc08b6f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13 0x10dc5a524 -[TNSRuntime executeModule:referredBy:]
14 0x10c4ccf33 main
15 0x7fff20257415 start
JS Stack:

Letme know If you need more information or generate a new ticket in: [email protected].

Thanks in advance.
Francisco.

Illegal code TS1174: Classes can only extend a single class.

This line is illegal and wont pass linting/language validation, using TS 3.9.7 NS7

We must remove the ATTrackingManager in order for apps based on this code to compile. Having looked into the "typings" lib im not sure why it needs to use MI here, seems like nonsense.

export class CustomAppDelegate extends UIResponder, ATTrackingManager implements UIApplicationDelegate{

Plugin will not accept using "@nativescript/core": "7.1.4"

"nativescript-plugin-appsflyer": "6.2.3" depends on "@nativescript/core": "~7.0.0" however there are now important fixes to NS that require versions above "7.0.x". The latest core is now "7.3.0"

Some strict versions of NPM will error out when the dependency restriction is not satisfied.

Additional not required android permissions in manifest file issue

Additional permissions can be created in apps manifest after adding appsflyer plugin and build.
For example in my case WRITE_EXTERNAL_STORAGE access was added into main app manifest, by I do not require it.

It can be caused by merge with demo app AndroidManifest.xml file.

Callback to onDeepLinking() passes different parameter types on Android and on iOS.

On android the plugin calls: Android version

                if(args.onDeepLinking){
                  try{
                    appsFlyerLibInstance.subscribeForDeepLink(new com.appsflyer.deeplink.DeepLinkListener(<any>{
                      _onDeepLinkingCallback: args.onDeepLinking,
                      onDeepLinking(deepLinkResult: Object): void {
                        printLogs(`DeepLinkResult: ${deepLinkResult.toString()}`);
                        this._onDeepLinkingCallback(deepLinkResult.toString());  // <-- this is a string representation of DeepLinkResult
                      }
                    }));
                  } catch(e){
                    printLogs(`onDeepLinking Error: ${e}`);
                  }
                }

on the other hand on iOS the plugin calls on the delegate as: IOS version

    public didResolveDeepLink(DeepLinkResult: AppsFlyerDeepLinkResult): void {
      if (!this._didResolveDeepLink) {
        return;
      }
      if (typeof this._didResolveDeepLink === 'function') {
        if (DeepLinkResult) {
          this._didResolveDeepLink(DeepLinkResult.deepLink);  // <-- this is of type AppsFlyerDeepLink
        }
      } else {
        console.error(`AF-I :: _didResolveDeepLink: callback is not a function`);
      }
    }

They are not even different representations of the same object.

How to access AppsflyerUID from the plugin

We would like to get access to the AppsflyerUID from the plugin, but at the moment there does not seem to be an straight forward way of doing it. Is there some way to access that API in a simple manner?

It would be nice to have some way to access most of the APIs available on the SDK in some regular manner without needing to request access one by one. I understand it may not be straight forward given the differences between Android & iOS.

Support for Angular10

The plugin is not working on iOS with Angular10.

Error message is :
file: node_modules/nativescript-plugin-appsflyer/appsflyer.ios.js:4:0: JS ERROR TypeError: undefined is not an object (evaluating 'utils_1.ios.collections')

I have create a project example

This project has been created with the following procedure :

  • Upgrade nativescript to RC : npm i -g nativescript@rc
  • Create a default helloworld project : nsc create sampleapp --template @nativescript/template-hello-world-ng
  • Adding an entry in the package.json fornativescript-plugin-appsflyerversion 5.2.2
  • Adding a call to the method trackEvent in the items.component class
  • run npm i
  • run tns run ios

Compiles OK on iOS but not on Android

Hello!

I'm working on an app that uses this plugin, works perfectly fine when we build for iOS but when building for Android, gradle complains about not being able to find the required plugin:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_F0F1F2F3F4F5F6F7DebugApkCopy'.
   > Could not find :af-android-sdk-4.8.3:.
     Required by:
         project :app

I reproduced the issue on a blank newly created project here:
asciicast

I recorded the ZSH session so you can see all of the steps I went through.

Can you give me some guidance into what is it that I'm doing wrong? My tns --version is 3.4.2 BTW.

Thanks!

Nativescript 6.5, Angular, Android not working

I just installed the latest version of the plugin "nativescript-plugin-appsflyer": "~5.2.1".

It works on iOS but not on Android. I have no error in the logs, the trackEvent respond with "successfull" but on Android I don't see any entries in appFlyers.
I'm using Nativescript 6.5 with Angular.

Here my code (working on iOS)

main.ts

const appsflyerOptions: appsFlyer.InitSDKOptions = {
    devKey: 'XXX',
    appId: application.ios ? 'XXX' : null,
    isDebug: !environment.isProd
};

appsFlyer.initSdk(appsflyerOptions).then(() => {
    console.log('AppFlyer successfully initialized');  //<- I see this in the console
}, err => {
    console.warn('Could not initialize AppFlyer', err);
});

home-page.component.ts

appsFlyer.trackEvent({
        eventName: 'test',
        eventValues: {
            'af_content_id': 'id123',
            'af_currency': 'CHF',
            'af_revenue': '2.5'
}).then(result => {
        console.log('AppFlyers tracked event successfully'); // <- I see this in the console
}, err => {
        console.log('Error while tracking event in AppFlyers');
});

Always running in Debug mode

In both platforms the plugin is always running in debug mode due to this line:

Android (line 22)

var isDebug = (!args.isDebug) ? true : args.isDebug;

iOS (line 24)

appsFlyer.appsFlyerTracker.isDebug = (!args.isDebug) ? true : args.isDebug;

if args.isDebug is false, the above line is equal to true.

NativeScript encountered a fatal error: Uncaught TypeError: Cannot read property 'deepLink' of null

When building the app from a clean directory (ie. no ./platform folder) upon startup of the application it crashes with the error below. After the crash, opening the app works as expected.

...
Project successfully built.
Build time: 161.383 s.
The build result is located at: /Volumes/Development/Work/g-v2/platforms/ios/build/Debug-iphonesimulator/gv2.app
Installing on device D745AEEB-FA2B-4CD1-928E-09597ED3A52E...
Successfully installed on device with identifier 'D745AEEB-FA2B-4CD1-928E-09597ED3A52E'.
Successfully transferred all files on device D745AEEB-FA2B-4CD1-928E-09597ED3A52E.
Restarting application on device D745AEEB-FA2B-4CD1-928E-09597ED3A52E...
  App stores reloaded!
  Firebase stores reloaded!
  [HMR][4534b8b317615663c3ac] boot | HMR Enabled - waiting for changes...
  AF-I :: appsFlyer.initSdk: {"devKey":"removed","appId":"removed","isDebug":true,"timeToWaitForATTUserAuthorization":0}
  initSdkResponse success
  ***** Fatal JavaScript exception - application has been terminated. *****
  NativeScript encountered a fatal error: Uncaught TypeError: Cannot read property 'deepLink' of null
  at
  onDeepLinking(file:///app/bundle.js:816:53)
  at DeepLinkDelegate.didResolveDeepLink(file: app/webpack:/g-v2/node_modules/nativescript-plugin-appsflyer/appsflyer.ios.js:104:0)
...

Steps to reproduce:

  1. Initialize the SDK in code
  2. rm -rf ./platforms
  3. ns run ios

SDK init

 onMount(async () => {
        await appsFlyer.initSdk({
            devKey: 'removed',
            appId: 'removed',
            isDebug: true,
            timeToWaitForATTUserAuthorization: 0,
            onConversionDataSuccess: _res => {
                console.log("Get conversion data success: " + JSON.stringify(_res));
            },
            onConversionDataFail: _res => {
                console.log("Get conversion data failure: " + JSON.stringify(_res));
            },
            onAppOpenAttribution: _res => {
                console.log("onAppOpenAttribution: " + JSON.stringify(_res));
            },
            onAppOpenAttributionFailure: _res => {
                console.log("onAppOpenAttributionFailure: " + JSON.stringify(_res));
            },
            onDeepLinking: _res => {
                console.log("onDeepLinking: " + JSON.parse(_res).deepLink);
            },
        })
            .then(result => {
                console.log("initSdkResponse", result.status);
            }, err => {
                console.log("initSdkResponse", JSON.stringify(err));
            });
    })

Could not find :af-android-sdk-4.8.3

Hi,
I have a problem when I want to build a project with this plugin :

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_F0DebugApkCopy'.
Could not find :af-android-sdk-4.8.3:.
Required by:
project :app

Can you give me some guidance into what is it that I'm doing wrong?
Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.