Skip to content

feat: expose Android setOaidData API - #204

Closed
nlinakis-xm wants to merge 1 commit into
AppsFlyerSDK:mainfrom
nlinakis-xm:feat/android-set-oaid-data
Closed

nlinakis-xm wants to merge 1 commit into
AppsFlyerSDK:mainfrom
nlinakis-xm:feat/android-set-oaid-data

Conversation

@nlinakis-xm

Copy link
Copy Markdown

Summary

  • expose AppsFlyer.setOaidData({ oaid }) in the public TypeScript API
  • delegate to Android SDK AppsFlyerLib.getInstance().setOaidData(oaid)
  • reject missing, empty, or blank OAID values using the plugin's INVALID_REQUEST pattern
  • document the API and add focused TypeScript and Android tests

This enables applications using custom OAID providers to retrieve the OAID themselves and supply it to AppsFlyer before SDK initialization, as documented in the AppsFlyer OAID guide.

Platform support

This method is Android-only. No iOS behavior is introduced; unsupported platforms continue to reject through Capacitor's existing unimplemented-method behavior.

Testing

  • npm run fmt (ESLint and Prettier completed; SwiftLint was unavailable locally and no Swift files changed)
  • npm run eslint
  • npm run prettier -- --check
  • npm test
  • npm run build
  • Android gradle clean build test --no-daemon with Gradle 8.14.3

The exact Android API signature was verified against the pinned com.appsflyer:af-android-sdk:7.0.1 AAR: public abstract void setOaidData(java.lang.String).

Copilot AI lite review requested due to automatic review settings September 7, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are user-facing inconsistencies in the new Android error message and the API documentation parameter naming that should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an Android-only setOaidData API to the Capacitor plugin’s public TypeScript surface so apps can supply a custom OAID to the AppsFlyer Android SDK prior to SDK initialization.

Changes:

  • Exposes AppsFlyer.setOaidData({ oaid }) via a Capacitor-specific SDK subclass and transport passthrough.
  • Implements setOaidData on the Android Capacitor plugin with input validation and delegation to AppsFlyerLib.setOaidData.
  • Updates docs and adds focused TypeScript and Android unit tests for the new API.
File summaries
File Description
src/index.ts Introduces SetOaidDataOptions and exposes setOaidData on the exported AppsFlyer singleton via a subclass.
src/capacitor-transport.ts Adds a setOaidData transport method forwarding to the native Capacitor plugin.
src/tests/public-types.smoke.ts Ensures the new public type is included in the public-types smoke check.
src/tests/index.test.ts Verifies the public AppsFlyer instance exposes and forwards setOaidData.
src/tests/capacitor-transport.test.ts Verifies the transport forwards setOaidData to the native plugin call.
docs/API.md Documents the new Android-only setOaidData method and adds it to the API matrix.
android/src/test/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPluginTest.kt Adds unit tests for the OAID validation helper.
android/src/main/java/capacitor/plugin/appsflyer/sdk/AppsFlyerPlugin.kt Implements setOaidData and adds an isValidOaid helper.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/API.md Outdated
@nlinakis-xm
nlinakis-xm force-pushed the feat/android-set-oaid-data branch from 35390c0 to 5fbcdc9 Compare September 7, 2026 14:34
@nlinakis-xm
nlinakis-xm force-pushed the feat/android-set-oaid-data branch from 5fbcdc9 to 64ea5ea Compare September 7, 2026 14:36
@al-af

al-af commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Hi @nlinakis-xm ,
Thanks for raising the issue , we fixed it in 7.0.2-v2 version.
Please check it out!

@al-af al-af closed this Sep 14, 2026
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.

3 participants