Meta SDK integration

0
Hi everyone,I'm looking at integrating the Meta SDK (formerly Facebook SDK) into a Mendix Native Mobile application to support app install attribution and app launch tracking for Meta Ads campaigns. The SDK automatically tracks events such as app installs and app activations when initialized correctly. Has anyone successfully implemented this in a Mendix native application.
asked
1 answers
0

Hi Ndihvhuwo,

Yes, you can integrate the Meta (formerly Facebook) SDK into a Mendix Native Mobile application.

However, this requires native React Native integration. It cannot be implemented using a regular Mendix microflow or a web-only JavaScript action.

I recommend the following approach:

1. Use a React Native Meta SDK wrapper

The original react-native-fbsdk repository has been archived. Its maintainers recommend using a community-maintained fork:

https://github.com/thebergamo/react-native-fbsdk-next

This wrapper provides access to Meta SDK functionality, including App Events.

2. Add the native dependency to Mendix

Install the compatible React Native package in your Native Template.

Then declare it in the JavaScript Action's native dependency declaration file (.js.json).

For example:

{
  "nativeDependencies": {
    "react-native-fbsdk-next": "EXACT_COMPATIBLE_VERSION"
  }
}

Use the exact package version compatible with your Mendix Native Template and React Native version.

3. Configure Android and iOS

Follow the package's native installation instructions for both platforms.

You need to configure:

  • Meta App ID.

  • Android application configuration and manifest metadata.

  • iOS application configuration and URL schemes where required.

  • Required native SDK initialization.

  • App Events and automatic event logging settings.

Make sure the configuration uses the correct Meta App ID for your application.

4. Create Mendix JavaScript Actions

Create JavaScript Actions to expose the required Meta SDK functions to Mendix nanoflows.

For example:

  • InitializeMetaSDK

  • LogMetaEvent

  • LogPurchaseEvent

  • TrackAppActivation

Use the wrapper's supported APIs to implement these actions.

5. Implement automatic app activation and install tracking

Meta's native SDK supports automatic app event logging and app activation tracking when configured correctly.

For example, the iOS SDK documents that app activation can record app activation and first-install events used for app acquisition measurement.

Avoid manually logging the same events if automatic logging is already enabled, as this can result in duplicate events.

6. Build a custom native application

Once the dependencies and native configurations are complete:

  1. Generate/configure the Native Template.

  2. Build a custom Android developer app.

  3. Build a custom iOS developer app.

  4. Test the integration on real devices.

  5. Verify the events in Meta Events Manager before distributing the production application.

A standard Make It Native app will not automatically contain your newly added native SDK dependency.

Recommended architecture

Mendix Native Mobile App
          |
          v
      Nanoflow
          |
          v
   JavaScript Actions
          |
          v
 React Native Meta SDK
          |
          v
 Native Meta SDK
    Android / iOS
          |
          v
     Meta App Events
          |
          v
    Meta Events Manager

Important: App install attribution and app activation tracking are subject to Meta configuration, platform privacy permissions, and the applicable Android/iOS attribution mechanisms. Installing the SDK alone does not guarantee attribution for every install.

Official references:

Hope this helps! If you find this answer helpful, please mark it as the accepted answer.

answered