Skip to content

feat: add unified DL support to appsflyer #756

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

Merged
merged 2 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ PODS:
- React
- RNGestureHandler (2.6.0):
- React-Core
- segment-analytics-react-native (2.10.0):
- segment-analytics-react-native (2.11.0):
- React-Core
- sovran-react-native
- segment-analytics-react-native-plugin-idfa (0.5.0):
- segment-analytics-react-native-plugin-idfa (0.6.0):
- React-Core
- sovran-react-native (0.4.5):
- React-Core
Expand Down Expand Up @@ -478,8 +478,8 @@ SPEC CHECKSUMS:
RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
RNGestureHandler: 920eb17f5b1e15dae6e5ed1904045f8f90e0b11e
segment-analytics-react-native: 64c117fa7c8e265ca4a3b170e396b88c34cd41e7
segment-analytics-react-native-plugin-idfa: 00f56afe6a185acad542caf00485fa0c35b53c47
segment-analytics-react-native: 2ba71e946824d44bea9a9001a911c3fcf84f0b16
segment-analytics-react-native-plugin-idfa: c9335ec0327b8f5f35c78bbf0bf7821e9137537e
sovran-react-native: fd3dc8f1a4b14acdc4ad25fc6b4ac4f52a2a2a15
Yoga: 0b84a956f7393ef1f37f3bb213c516184e4a689d

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/info.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const libraryInfo = {
name: '@segment/analytics-react-native',
version: '2.10.1',
version: '2.11.0',
};
2 changes: 1 addition & 1 deletion packages/plugins/plugin-appsflyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@segment/analytics-react-native": "*"
},
"dependencies": {
"react-native-appsflyer": "^6.3.50"
"react-native-appsflyer": "^6.9.4"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
Expand Down
18 changes: 18 additions & 0 deletions packages/plugins/plugin-appsflyer/src/AppsflyerPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export class AppsflyerPlugin extends DestinationPlugin {
!this.hasRegisteredDeepLinkCallback
) {
this.registerDeepLinkCallback();
this.registerUnifiedDeepLinkCallback();

this.hasRegisteredDeepLinkCallback = true;
}
if (!this.hasInitialized) {
Expand Down Expand Up @@ -110,4 +112,20 @@ export class AppsflyerPlugin extends DestinationPlugin {
}
});
};

registerUnifiedDeepLinkCallback = () => {
appsFlyer.onDeepLink((res) => {
if (res.deepLinkStatus !== 'NOT_FOUND') {
const { DLValue, media_source, campaign } = res.data;
const properties = {
deepLink: DLValue,
campaign: {
name: campaign,
source: media_source,
},
};
this.analytics?.track('Deep Link Opened', properties);
}
});
};
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10521,10 +10521,10 @@ react-native-appboy-sdk@^1.32.0:
resolved "https://registry.yarnpkg.com/react-native-appboy-sdk/-/react-native-appboy-sdk-1.36.0.tgz#fdda158ba8e6fb87dda7ab8c89510686fe13c02c"
integrity sha512-ZveH33LRxJNVEc5ym/tYVpKEEeQwMShV/5Afdum5NZjeTi2Mh/ghTVlCp3t+Icb1BWDnMjke3myiqISYyFXMFw==

react-native-appsflyer@^6.3.50:
version "6.6.1"
resolved "https://registry.yarnpkg.com/react-native-appsflyer/-/react-native-appsflyer-6.6.1.tgz#9e0cb55f9a318a7a4f345ed51b18fa0e8f817a10"
integrity sha512-OPy4ujSlGDpOgrIcVi+Koe967weGIk6Gzx3Z1Fwd0JPp6nu/Tv0Lt6HUPJjMaQUqnC+sdricHikrNixaCo0/dQ==
react-native-appsflyer@^6.9.4:
version "6.9.4"
resolved "https://registry.yarnpkg.com/react-native-appsflyer/-/react-native-appsflyer-6.9.4.tgz#35d8adbee93d169a7af3770739e8fe04de2d2680"
integrity sha512-GR02uyTjN08oAotVErCqE6nuqKReEskztSCcZhLZ8RbAYAu4Phj6ySvElc6cPF/KxBtR0Q9SE0RLaC1QLBM4mw==

react-native-branch@^5.6.0:
version "5.6.2"
Expand Down