Skip to content

Android logEvent throws 'no devKey' error #645

@jenniredfield

Description

@jenniredfield

Plugin Version

6.17.2

App ID

No response

Email

No response

Platform(s)

Android

What did you do?

We followed the docs to initialise and startSdk on Android but the event logEvent throws the error 'no devKey' even though we pass it.
In addition, it is not clear how we should attach our device to the dashboard - is it via IMEI or GAID value?

import appsFlyer from "react-native-appsflyer";
... 
....

useEffect(() => {

      appsFlyer.initSdk(
        {
          devKey,
          isDebug: isDev(),
          appId: getAppId(),
          onInstallConversionDataListener: true,
          onDeepLinkListener: true,
          timeToWaitForATTUserAuthorization: 60,
          manualStart: isAndroid,
        },
        (result) => {
          console.log("AppsFlyer SDK initialized successfully:", result);
        },
        (error) => {
          console.error("AppsFlyer initialization error:", error);

          Logger.warn("AppsFlyer initialization error", {
            data: {
              error,
            },
          });
        }
      );

if (isAndroid) {
  appsFlyer.startSdk()
}

}) 


On login we call

import appsFlyer from "react-native-appsflyer";

          await appsFlyer.logEvent(eventName, {
            ...params,
            af_is_authenticated: data?.isAuthenticated || false,
            af_marketing_consent: hasMarketingConsent,
          });

Somehow appsFlyer does not find the devKey on logEvent even though we initialize it.

What did you expect to happen?

Expect logEvent not to throw error
Expect event to appear on dashboard

What happened instead?

Error was thrown
No log in dashboard

Any other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions