Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG : Application lifecycle events aren't logged #192

Open
Mo0Khaled opened this issue Nov 12, 2024 · 10 comments
Open

BUG : Application lifecycle events aren't logged #192

Mo0Khaled opened this issue Nov 12, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@Mo0Khaled
Copy link

Describe the bug
The Application lifecycle events isn't logged at all none of them, and I din't override the values on the builder, as I understand it should be logged be default.

Which platform is the issue occurring on
Is the error occurring on:

  • [1] Both Android and iOS

SDK initialisation snippet
Flutter 3.24.1

Framework version of the SDK
rudder_sdk_flutter: ^3.0.1

Check for Correct Usage of writeKey and dataPlaneUrl
all correct, other events working pretty good track, screen.

@Mo0Khaled Mo0Khaled added the bug Something isn't working label Nov 12, 2024
@1abhishekpandey
Copy link
Contributor

Hey @Mo0Khaled ,

Can you please provide the complete Rudder-Flutter SDK initialisation snippet?

@1abhishekpandey 1abhishekpandey self-assigned this Nov 12, 2024
@Mo0Khaled
Copy link
Author

Mo0Khaled commented Nov 12, 2024

Hey @Mo0Khaled ,

Can you please provide the complete Rudder-Flutter SDK initialisation snippet?

@1abhishekpandey Sure thing HYG:

     final builder = RudderConfigBuilder();

     final rudderTokenKey = BuildConfig.of().rudderTokenKey;
     final rudderDataPlaneUrl = BuildConfig.of().rudderDataPlaneUrl;

     builder.withDataPlaneUrl(rudderDataPlaneUrl);
     rudderClient.initialize(
       rudderTokenKey,
       config: builder.build(),
       )

@1abhishekpandey
Copy link
Contributor

Just to clarify, by this:

as I understand it should be logged be default.

Where exactly are you referring to? Is it the IDE logcat or the RudderStack dashboard?

@Mo0Khaled
Copy link
Author

Just to clarify, by this:

as I understand it should be logged be default.

Where exactly are you referring to? Is it the IDE logcat or the RudderStack dashboard?

I mean the dashboard but as we talked about on the other issue, we use customer.io dashboard

@1abhishekpandey
Copy link
Contributor

Could you please check the RudderStack—Flutter source live events tab (https://app.rudderstack.com/) and see if any lifecycle events (e.g., Application Installed, Application Opened, or Application Backgrounded) are reported or not?
image

@Mo0Khaled
Copy link
Author

Mo0Khaled commented Nov 12, 2024

Could you please check the RudderStack—Flutter source live events tab (https://app.rudderstack.com/) and see if any lifecycle events (e.g., Application Installed, Application Opened, or Application Backgrounded) are reported or not?

image

Tested it now and nothing there too.

Is there an extra code should be written to make this work?

image

@1abhishekpandey
Copy link
Contributor

The timer needs to be running. Just click on Resume and you'll observe all the events made by the Flutter source e.g., refer to this:
image

Is there an extra code should be written to make this work?

No additional code should be required to make the lifecycle events. They are enabled by default on the Android and iOS side. But if needed you can refer to our sample app:

MobileConfig mc = MobileConfig(
    recordScreenViews: true,
    collectDeviceId: false);

RudderConfigBuilder builder = RudderConfigBuilder();
builder
  ..withDataPlaneUrl(
      dotenv.env['DATA_PLANE_URL'] ?? "https://hosted.rudderlabs.com")
  ..withMobileConfig(mc)
  ..withLogLevel(RudderLogger.VERBOSE);
String writeKey = dotenv.env['WRITE_KEY'] ?? "INVALID_WRITE_KEY";
rudderClient.initialize(writeKey, config: builder.build(), options: null);

If it still doesn't work, please install the app fresh, run it for 30 seconds, move the app to the background and foreground, and share the complete Android logcat filtered by RudderSDK. We can then verify whether lifecycle events are made or not.

@1abhishekpandey
Copy link
Contributor

Hey @Mo0Khaled,

Could you please let us know if your issue has been resolved or if you need any further assistance?

@Mo0Khaled
Copy link
Author

Hello @1abhishekpandey ,

still not working we have tried it on version 2.9.0 and it's working is this information helpful for you so you can help me find the issue?

@1abhishekpandey
Copy link
Contributor

Could you please provide this and attempt to install the Flutter SDK in a new sample app?

If it still doesn't work, please install the app fresh, run it for 30 seconds, move the app to the background and foreground, and share the complete Android logcat filtered by RudderSDK. We can then verify whether lifecycle events are made or not.

By the way, there have been no changes to the lifecycle from v2.9.0 to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants