google-analytics-plugin icon indicating copy to clipboard operation
google-analytics-plugin copied to clipboard

Android startTrackerWithId call returns "" from nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson)

Open bigsmity opened this issue 2 years ago • 0 comments

My app is using plugin version 1.9.1. When running on android device my callbacks from startTrackerWithId are not firing.

While debugging I have found that the following call is never sent.

cordova.js Line: 992

var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); // If argsJson was received by Java as null, try again with the PROMPT bridge mode. // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. if (jsToNativeBridgeMode === jsToNativeModes.JS_OBJECT && msgs === '@Null arguments.') { androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); androidExec(success, fail, service, action, args); androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); } else if (msgs) { messagesFromNative.push(msgs); // Always process async to avoid exceptions messing up stack. nextTick(processMessages); }

Values:

this: Object action: "startTrackerWithId" args: (2) ['UA-xxxxxxxxx-2', 30] argsJson: "["UA-xxxxxxxxx-2",30]" callbackId: "UniversalAnalytics1471147327" fail: ƒ (e) i: 2 msgs: "" service: "UniversalAnalytics" success: ƒ (n)

When making the initial call to startTrackerWithId, the variable msgs is assigned the value "" and not hitting the following conditional blocks of code.

As this initial call is not functioning, all subsequent calls fail. The subsequent calls do return error messages in the msgs variable when they fail.

Has anyone seen this before?

Thanks,

bigsmity avatar Jun 22 '22 04:06 bigsmity