Skip to content

Add manual activate app#467

Merged
DennisAlund merged 7 commits intomainfrom
add-manual-activate-app
Dec 19, 2025
Merged

Add manual activate app#467
DennisAlund merged 7 commits intomainfrom
add-manual-activate-app

Conversation

@DennisAlund
Copy link
Member

@DennisAlund DennisAlund commented Dec 19, 2025

Made some updates to #466 to improve stability and consistency.

Using ActivityAware here makes activateApp depend on the Activity lifecycle, so the call can fail if it happens before an Activity is attached (startup ordering/background contexts), even though an Application is already available. Grabbing the Application from the engine’s applicationContext in onAttachedToEngine matches the SDK’s intended usage (callable from Application.onCreate when auto logging is disabled) and makes activateApp more robust/reliable because it no longer relies on Activity attach/detach timing.

Copilot AI review requested due to automatic review settings December 19, 2025 03:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds manual app activation functionality to the Facebook App Events plugin, allowing developers to manually trigger app activation events when automatic logging is disabled (e.g., for GDPR compliance). The implementation provides a new activateApp() method with optional application ID override support.

Key changes:

  • New activateApp() method in the Dart API with optional applicationId parameter
  • Platform-specific implementations for both iOS and Android
  • Test coverage for the new functionality

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/facebook_app_events.dart Adds the activateApp() method with documentation explaining when and how to use manual activation
test/facebook_app_events_test.dart Adds test cases to verify the method correctly handles null and provided applicationId parameters
ios/facebook_app_events/Sources/facebook_app_events/FacebookAppEventsPlugin.swift Implements iOS handler that sets logging override app ID when provided and calls SDK's activateApp()
android/src/main/kotlin/id/oddbit/flutter/facebook_app_events/FacebookAppEventsPlugin.kt Implements Android handler with null safety checks and calls SDK's activateApp() with optional applicationId

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DennisAlund DennisAlund merged commit 4b30057 into main Dec 19, 2025
1 check passed
@DennisAlund DennisAlund deleted the add-manual-activate-app branch December 19, 2025 05:25
@DennisAlund
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants