From 0b354bf2ea5d39ee45dfe5413ec64e7237ecbac8 Mon Sep 17 00:00:00 2001 From: romanlitvin Date: Wed, 9 Nov 2022 16:15:06 +0200 Subject: [PATCH 01/17] Update GenerateInviteLinkParams interface type definitions. --- index.d.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 793c131b..2cf89aa8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,9 +102,15 @@ declare module "react-native-appsflyer" { channel: string; campaign?: string; customerID?: string; - userParams?: object; - - [key: string]: any; + userParams?: { + deep_link_value?: string; + [key: string]: any; + }; + referrerName?: string; + referrerImageUrl?: string; + deeplinkPath?: string; + baseDeeplink?: string; + brandDomain?: string; } const appsFlyer: { From 9df372771a34645fdfdb66db2a5c1c3edf2a9ec6 Mon Sep 17 00:00:00 2001 From: Amit Date: Thu, 26 Jan 2023 17:42:52 +0000 Subject: [PATCH 02/17] fixed jira script --- .github/workflows/scripts/releaseNotesGenerator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/releaseNotesGenerator.sh b/.github/workflows/scripts/releaseNotesGenerator.sh index 2c0f5897..92a976ab 100755 --- a/.github/workflows/scripts/releaseNotesGenerator.sh +++ b/.github/workflows/scripts/releaseNotesGenerator.sh @@ -2,12 +2,12 @@ JIRA_TOKEN=$1 JIRA_FIXED_VERSION=$2 fixed_version_found=false -curl -X GET -H "Authorization: Basic $JIRA_TOKEN=" https://appsflyer.atlassian.net/rest/api/3/project/11723/versions | jq -r '.[] | .name+""+.id' | while read version ; do +curl -X GET https://appsflyer.atlassian.net/rest/api/3/project/11723/versions --user $JIRA_TOKEN | jq -r '.[] | .name+""+.id' | while read version ; do if [[ "$version" == *"$JIRA_FIXED_VERSION"* ]] ;then echo "$JIRA_FIXED_VERSION Found!" fixed_version_found=true version_id=${version#"$JIRA_FIXED_VERSION"} - echo $(curl -X GET -H "Authorization: Basic $JIRA_TOKEN=" https://appsflyer.atlassian.net/rest/api/3/search?jql=fixVersion=$version_id | jq -r '.issues[] | "- " + .fields["summary"]+"@"') > "$JIRA_FIXED_VERSION-releasenotes".txt + echo $(curl -X GET https://appsflyer.atlassian.net/rest/api/3/search?jql=fixVersion=$version_id --user $JIRA_TOKEN | jq -r '.issues[] | "- " + .fields["summary"]+"@"') > "$JIRA_FIXED_VERSION-releasenotes".txt sed -i -r -e "s/@ /\n/gi" "$JIRA_FIXED_VERSION-releasenotes".txt sed -i -r -e "s/@/\n/gi" "$JIRA_FIXED_VERSION-releasenotes".txt cat "$JIRA_FIXED_VERSION-releasenotes".txt From 6e2d8c5311ce60ce6bd6f0fc9e71027bdc6f2dda Mon Sep 17 00:00:00 2001 From: Konstantinos K <47348484+KonstantinosKoulaxizis@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:29:14 +0100 Subject: [PATCH 03/17] Update platforms to include tvos --- react-native-appsflyer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-appsflyer.podspec b/react-native-appsflyer.podspec index 0947068a..7b92de83 100644 --- a/react-native-appsflyer.podspec +++ b/react-native-appsflyer.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = pkg["author"] s.source = { :git => pkg["repository"]["url"] } s.source_files = 'ios/**/*.{h,m}' - s.platform = :ios, "9.0" + s.platforms = { :ios => "9.0", :tvos => "12.0" } s.static_framework = true s.dependency 'React' From 428b6c11a73158bda37c7be2f3e383e530b145e7 Mon Sep 17 00:00:00 2001 From: Konstantinos K <47348484+KonstantinosKoulaxizis@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:43:01 +0100 Subject: [PATCH 04/17] Update index.d.ts --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 793c131b..9cd9e718 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,8 +3,8 @@ **/ declare module "react-native-appsflyer" { type Response = void | Promise; - type SuccessCB = (result?: any) => any; - type ErrorCB = (error?: any) => any; + type SuccessCB = (result?: unknown) => unknown; + type ErrorCB = (error?: Error) => unknown; export type ConversionData = { status: "success" | "failure", type: "onInstallConversionDataLoaded" | "onInstallConversionFailure" From 010a4c6f3682944e2793940ecb25667b9653502e Mon Sep 17 00:00:00 2001 From: Konstantinos K <47348484+KonstantinosKoulaxizis@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:46:19 +0100 Subject: [PATCH 05/17] Revert platform changes --- react-native-appsflyer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native-appsflyer.podspec b/react-native-appsflyer.podspec index 7b92de83..0947068a 100644 --- a/react-native-appsflyer.podspec +++ b/react-native-appsflyer.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = pkg["author"] s.source = { :git => pkg["repository"]["url"] } s.source_files = 'ios/**/*.{h,m}' - s.platforms = { :ios => "9.0", :tvos => "12.0" } + s.platform = :ios, "9.0" s.static_framework = true s.dependency 'React' From 75f69e52adef1f6efc3abbf2fba4bb73f9104cfc Mon Sep 17 00:00:00 2001 From: Amit Date: Thu, 23 Mar 2023 11:24:01 +0200 Subject: [PATCH 06/17] update minor version regex in workflows --- .github/workflows/deploy-to-QA.yml | 8 ++++---- .github/workflows/pre-release-workflow.yml | 2 +- .github/workflows/release-Production-workflow.yml | 6 +++--- .github/workflows/release-QA-workflow.yml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-to-QA.yml b/.github/workflows/deploy-to-QA.yml index 08558d63..f25c9a08 100644 --- a/.github/workflows/deploy-to-QA.yml +++ b/.github/workflows/deploy-to-QA.yml @@ -23,7 +23,7 @@ jobs: BRANCH_NAME: ${{github.ref_name}} run: | fixed_version_found=false - plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9].[0-9]+') + plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+') jira_fixed_version="React Native SDK v$plugin_version" # echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV @@ -32,7 +32,7 @@ jobs: - name: Update package.json file run: | - plugin_rc_version=$(echo "${{github.ref_name}}" | grep -Eo '[0-9].[0-9].[0-9]+-rc[0-9]+') + plugin_rc_version=$(echo "${{github.ref_name}}" | grep -Eo '[0-9].[0-9]+.[0-9]+-rc[0-9]+') echo "Updating plugin to version $plugin_rc_version" npm version $plugin_rc_version git push @@ -48,7 +48,7 @@ jobs: env: SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }} run: | - ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9].[0-9]\*\*') - android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9].[0-9]\*\*') + ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') + android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') CHANGES=$(cat "${{env.JIRA_FIXED_VERSION}}-releasenotes".txt) curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"${{github.ref_name}}"'", "changes_and_fixes": "'"$CHANGES"'", "android_dependencie": "'"$android_sdk_version"'", "ios_dependencie": "'"$ios_sdk_version"'"}' "$SLACK_TOKEN" diff --git a/.github/workflows/pre-release-workflow.yml b/.github/workflows/pre-release-workflow.yml index 2af12b93..12340816 100644 --- a/.github/workflows/pre-release-workflow.yml +++ b/.github/workflows/pre-release-workflow.yml @@ -27,7 +27,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Update package.json file run: | - plugin_version=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9].[0-9].[0-9]+') + plugin_version=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9].[0-9]+.[0-9]+') # we export plugin_version and release branch name as env so we can use them in the next step echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV echo "GIT_BRANCH_RELEASE=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV diff --git a/.github/workflows/release-Production-workflow.yml b/.github/workflows/release-Production-workflow.yml index 042cd01f..72b11bdc 100644 --- a/.github/workflows/release-Production-workflow.yml +++ b/.github/workflows/release-Production-workflow.yml @@ -31,7 +31,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Determine release tag and release branch run: | - TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9].[0-9].[0-9]+') + TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9].[0-9]+.[0-9]+') echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV echo "push new release >> $TAG" @@ -74,7 +74,7 @@ jobs: run: | chmod +x .github/workflows/scripts/releaseNotesGenerator.sh .github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" - ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9].[0-9]\*\*') - android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9].[0-9]\*\*') + ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') + android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "Production", "install_tag": "latest", "git_branch": "'"$RELEASE_BRACH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "android_dependencie": "'"$android_sdk_version"'", "ios_dependencie": "'"$ios_sdk_version"'"}' "$SLACK_TOKEN" diff --git a/.github/workflows/release-QA-workflow.yml b/.github/workflows/release-QA-workflow.yml index cdf70685..84bfa9d2 100644 --- a/.github/workflows/release-QA-workflow.yml +++ b/.github/workflows/release-QA-workflow.yml @@ -3,7 +3,7 @@ name: Release plugin to QA on: push: branches: - - releases/[0-9].x.x/[0-9].[0-9].x/[0-9].[0-9].[0-9]+-rc[0-9]+ + - releases/[0-9].x.x/[0-9].[0-9]+.x/[0-9].[0-9]+.[0-9]+-rc[0-9]+ jobs: Run-Unit-Tests: From e43b31df70c7d49e28c556077313b50132678ec2 Mon Sep 17 00:00:00 2001 From: Amit Date: Tue, 28 Mar 2023 14:33:55 +0300 Subject: [PATCH 07/17] ios sdk v6.10.1, android sdk v6.10.2, deeplinking docs and platform extension --- Docs/DeepLink.md | 4 +- android/build.gradle | 2 +- .../reactnative/RNAppsFlyerConstants.java | 1 + .../reactnative/RNAppsFlyerModule.java | 22 ++++++++ ios/AppsFlyerAttribution.h | 1 - ios/AppsFlyerAttribution.m | 1 + ios/AppsFlyerLib.h | 53 ++++++++++++++----- ios/AppsFlyerShareInviteHelper.h | 2 +- ios/RNAppsFlyer.h | 11 ++-- ios/RNAppsFlyer.m | 16 +++--- react-native-appsflyer.podspec | 3 +- 11 files changed, 87 insertions(+), 29 deletions(-) diff --git a/Docs/DeepLink.md b/Docs/DeepLink.md index 0d473fcf..7172de85 100644 --- a/Docs/DeepLink.md +++ b/Docs/DeepLink.md @@ -22,7 +22,7 @@ For more info please check out the [OneLink™ Deep Linking Guide](https://suppo ### 1. Deferred Deep Linking (Get Conversion Data) -Check out the deferred deeplinkg guide from the AppFlyer knowledge base [here](https://support.appsflyer.com/hc/en-us/articles/207032096-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deeplinking-#Introduction). +Check out the deferred deeplinkg guide from the AppFlyer knowledge base [here](https://dev.appsflyer.com/hc/docs/dl_work_flow). Code Sample to handle the conversion data: @@ -60,7 +60,7 @@ The `appsFlyer.onInstallConversionData` returns function to unregister this eve ### 2. Direct Deeplinking -When a deeplink is clicked on the device the AppsFlyer SDK will return the resolved link in the [onAppOpenAttribution](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#deep-linking-data-the-onappopenattribution-method-) method. +When a deeplink is clicked on the device the AppsFlyer SDK will return the resolved link in the onAppOpenAttribution method.([Android](https://dev.appsflyer.com/hc/docs/dl_android_gcd_legacy) / [iOS](https://dev.appsflyer.com/hc/docs/dl_ios_gcd_legacy)) Code Sample to handle OnAppOpenAttribution: diff --git a/android/build.gradle b/android/build.gradle index d42a44c7..926a2633 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -54,5 +54,5 @@ repositories { dependencies { implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}" implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.1')}" - api "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.9.4')}" + api "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.10.2')}" } diff --git a/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java b/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java index 973d6f23..eb3f524b 100755 --- a/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java +++ b/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerConstants.java @@ -6,6 +6,7 @@ public class RNAppsFlyerConstants { + final static String PLUGIN_VERSION = "6.10.2"; final static String NO_DEVKEY_FOUND = "No 'devKey' found or its empty"; final static String UNKNOWN_ERROR = "AF Unknown Error"; final static String SUCCESS = "Success"; diff --git a/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java b/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java index 82264b99..c607a1a5 100755 --- a/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java +++ b/android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java @@ -19,6 +19,8 @@ import com.appsflyer.AppsFlyerConversionListener; import com.appsflyer.AppsFlyerLib; import com.appsflyer.AppsFlyerProperties.EmailsCryptType; +import com.appsflyer.internal.platform_extension.Plugin; +import com.appsflyer.internal.platform_extension.PluginInfo; import com.appsflyer.share.CrossPromotionHelper; import com.appsflyer.share.LinkGenerator; import com.appsflyer.share.ShareInviteHelper; @@ -150,6 +152,10 @@ private String callSdkInternal(ReadableMap _options) { isDeepLinking = options.optBoolean(afDeepLink, false); isManualStartMode = options.optBoolean("manualStart", false); + boolean isExpoApp = this.isExpoApp(); + PluginInfo pluginInfo = new PluginInfo(isExpoApp ? Plugin.EXPO : Plugin.REACT_NATIVE, PLUGIN_VERSION); + instance.setPluginInfo(pluginInfo); + instance.init(devKey, (isConversionData == true) ? registerConversionListener() : null, application.getApplicationContext()); if (isDeepLinking) { instance.subscribeForDeepLink(registerDeepLinkListener()); @@ -161,6 +167,22 @@ private String callSdkInternal(ReadableMap _options) { return null; } + /** + * We try to load this class which is associated with Expo. If the class is loaded we return true + * so we handle this app as an Expo app. If not its just a React Native app. + * @return true if its an Expo app, false is its React Native app + */ + private boolean isExpoApp() { + try { + Class.forName("expo.modules.devmenu.react.DevMenuAwareReactActivity"); + return true; + } catch (ClassNotFoundException e) { + return false; + } catch (Exception e) { + return false; + } + } + private DeepLinkListener registerDeepLinkListener() { return new DeepLinkListener() { @Override diff --git a/ios/AppsFlyerAttribution.h b/ios/AppsFlyerAttribution.h index d46dbbd7..48212bf4 100644 --- a/ios/AppsFlyerAttribution.h +++ b/ios/AppsFlyerAttribution.h @@ -7,7 +7,6 @@ #ifndef AppsFlyerAttribution_h #define AppsFlyerAttribution_h #endif /* AppsFlyerAttribution_h */ -#import "AppsFlyerLib.h" @interface AppsFlyerAttribution : NSObject @property BOOL RNAFBridgeReady; diff --git a/ios/AppsFlyerAttribution.m b/ios/AppsFlyerAttribution.m index c9bfe8ed..07a46ee7 100644 --- a/ios/AppsFlyerAttribution.m +++ b/ios/AppsFlyerAttribution.m @@ -7,6 +7,7 @@ #import #import "AppsFlyerAttribution.h" +#import @interface AppsFlyerAttribution () @property NSUserActivity * userActivity; diff --git a/ios/AppsFlyerLib.h b/ios/AppsFlyerLib.h index 4d86f52e..4cefe262 100644 --- a/ios/AppsFlyerLib.h +++ b/ios/AppsFlyerLib.h @@ -2,16 +2,16 @@ // AppsFlyerLib.h // AppsFlyerLib // -// AppsFlyer iOS SDK 6.5.4 (62) -// Copyright (c) 2012-2020 AppsFlyer Ltd. All rights reserved. +// AppsFlyer iOS SDK 6.10.1.106 (106) +// Copyright (c) 2012-2023 AppsFlyer Ltd. All rights reserved. // #import -#import "AppsFlyerCrossPromotionHelper.h" -#import "AppsFlyerShareInviteHelper.h" -#import "AppsFlyerDeepLinkResult.h" -#import "AppsFlyerDeepLink.h" +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -131,18 +131,33 @@ NS_ASSUME_NONNULL_BEGIN #define AFEventParamAdRevenueAdSize @"af_adrev_ad_size" #define AFEventParamAdRevenueMediatedNetworkName @"af_adrev_mediated_network_name" + /// Mail hashing type typedef enum { /// None EmailCryptTypeNone = 0, - /// SHA1 - EmailCryptTypeSHA1 = 1, - /// MD5 - EmailCryptTypeMD5 = 2, /// SHA256 EmailCryptTypeSHA256 = 3 } EmailCryptType; +typedef NS_CLOSED_ENUM(NSInteger, AFSDKPlugin) { + AFSDKPluginIOSNative, + AFSDKPluginUnity, + AFSDKPluginFlutter, + AFSDKPluginReactNative, + AFSDKPluginAdobeAir, + AFSDKPluginAdobeMobile, + AFSDKPluginCocos2dx, + AFSDKPluginCordova, + AFSDKPluginMparticle, + AFSDKPluginNativeScript, + AFSDKPluginExpo, + AFSDKPluginUnreal, + AFSDKPluginXamarin, + AFSDKPluginCapacitor, +} NS_SWIFT_NAME(AppsFlyerPlugin); + + NS_SWIFT_NAME(DeepLinkDelegate) @protocol AppsFlyerDeepLinkDelegate @@ -212,6 +227,9 @@ NS_SWIFT_NAME(DeepLinkDelegate) */ + (AppsFlyerLib *)shared; + +- (void)setUpInteroperabilityObject:(id)object; + /** In case you use your own user ID in your app, you can set this property to that ID. Enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and the other devices’ IDs @@ -294,10 +312,13 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); @property(atomic) BOOL anonymizeUser; /** - Opt-out for Apple Search Ads attributions + Deprecated. This API has no effect, since the SDK is no longer fetching Apple Search Ads data from the iAd Framework. iAd Framework has been deprecated by Apple. For more information, see here: https://developer.apple.com/documentation/iad/iad_changelog */ -@property(atomic) BOOL disableCollectASA; +@property(atomic) BOOL disableCollectASA DEPRECATED_MSG_ATTRIBUTE("Deprecated. This API has no effect, since the SDK is no longer fetching Apple Search Ads data from the iAd Framework."); +/** + Disable Apple Ads Attribution API +[AAAtribution attributionTokenWithError:] + */ @property(nonatomic) BOOL disableAppleAdsAttribution; /** @@ -368,6 +389,14 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); */ @property(nonatomic, nullable) NSString *currentDeviceLanguage; +/** + Internal API. Please don't use. + */ +- (void)setPluginInfoWith:(AFSDKPlugin)plugin + pluginVersion:(NSString *)version + additionalParams:(NSDictionary * _Nullable)additionalParams +NS_SWIFT_NAME(setPluginInfo(plugin:version:additionalParams:)); + /** Enable the collection of Facebook Deferred AppLinks Requires Facebook SDK and Facebook app on target/client device. diff --git a/ios/AppsFlyerShareInviteHelper.h b/ios/AppsFlyerShareInviteHelper.h index 715c14ab..f55dbf9d 100644 --- a/ios/AppsFlyerShareInviteHelper.h +++ b/ios/AppsFlyerShareInviteHelper.h @@ -7,7 +7,7 @@ // #import -#import "AppsFlyerLinkGenerator.h" +#import /** AppsFlyerShareInviteHelper diff --git a/ios/RNAppsFlyer.h b/ios/RNAppsFlyer.h index 143c38bd..39237df6 100755 --- a/ios/RNAppsFlyer.h +++ b/ios/RNAppsFlyer.h @@ -10,11 +10,11 @@ #import "AppsFlyerAttribution.h" #import -//#if __has_include() // from Pod -//#import -//#else -//#import "AppsFlyerLib.h" -//#endif +#if __has_include() // from Pod +#import +#else +#import "AppsFlyerLib.h" +#endif @interface RNAppsFlyer: RCTEventEmitter @@ -22,6 +22,7 @@ @end +static NSString *const kAppsFlyerPluginVersion = @"6.10.2"; static NSString *const NO_DEVKEY_FOUND = @"No 'devKey' found or its empty"; static NSString *const NO_APPID_FOUND = @"No 'appId' found or its empty"; static NSString *const NO_EVENT_NAME_FOUND = @"No 'eventName' found or its empty"; diff --git a/ios/RNAppsFlyer.m b/ios/RNAppsFlyer.m index 7014fcdb..284c31e9 100755 --- a/ios/RNAppsFlyer.m +++ b/ios/RNAppsFlyer.m @@ -1,4 +1,5 @@ #import "RNAppsFlyer.h" +#import "AppsFlyerAttribution.h" @implementation RNAppsFlyer @synthesize bridge = _bridge; @@ -94,6 +95,11 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { [[AppsFlyerLib shared] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval]; } #endif + BOOL isExpoApp = [self isExpoApp]; + [[AppsFlyerLib shared] setPluginInfoWith:isExpoApp ? AFSDKPluginExpo : AFSDKPluginReactNative + pluginVersion:kAppsFlyerPluginVersion + additionalParams:nil]; + [AppsFlyerLib shared].appleAppID = appId; [AppsFlyerLib shared].appsFlyerDevKey = devKey; [AppsFlyerLib shared].isDebug = isDebug; @@ -191,12 +197,6 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions { int _t = [emailsCryptTypeId intValue]; switch (_t) { - case EmailCryptTypeSHA1: - emailsCryptType = EmailCryptTypeSHA1; - break; - case EmailCryptTypeMD5: - emailsCryptType = EmailCryptTypeMD5; - break; case EmailCryptTypeSHA256: emailsCryptType = EmailCryptTypeSHA256; break; @@ -424,6 +424,10 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type { } } +- (BOOL)isExpoApp { + return NSClassFromString(@"EXAppDelegateWrapper") != nil; +} + RCT_EXPORT_METHOD(anonymizeUser: (BOOL *)b callback:(RCTResponseSenderBlock)callback) { [AppsFlyerLib shared].anonymizeUser = b; callback(@[SUCCESS]); diff --git a/react-native-appsflyer.podspec b/react-native-appsflyer.podspec index 0947068a..6949d405 100644 --- a/react-native-appsflyer.podspec +++ b/react-native-appsflyer.podspec @@ -25,6 +25,7 @@ Pod::Spec.new do |s| Pod::UI.puts "#{s.name}: Using default AppsFlyerFramework. You may require App Tracking Transparency. Not allowed for Kids apps." Pod::UI.puts "#{s.name}: You may set variable `$RNAppsFlyerStrictMode=true` in Podfile to use strict mode for kids apps." end - s.dependency 'AppsFlyerFramework', '6.9.1' + # s.dependency 'AppsFlyerFramework', '6.9.1' + s.dependency 'appsflyer-apple-sdk-qa', '6.10.1.106' end end From 1bab53b1ecd1aae5ea9502a77774c552eb89516e Mon Sep 17 00:00:00 2001 From: Amit Date: Tue, 28 Mar 2023 14:37:22 +0300 Subject: [PATCH 08/17] update readme --- Docs/DeepLink.md | 2 -- README.md | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Docs/DeepLink.md b/Docs/DeepLink.md index 7172de85..65a77b9c 100644 --- a/Docs/DeepLink.md +++ b/Docs/DeepLink.md @@ -18,8 +18,6 @@ Since users may or may not have the mobile app installed, there are 3 types of d 2. Direct Deep Linking - Directly serving personalized content to existing users, which already have the mobile app installed. 3. Starting from v6.1.3, the new Unified Deep Linking API is available to handle deeplinking logic. -For more info please check out the [OneLink™ Deep Linking Guide](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#Intro). - ### 1. Deferred Deep Linking (Get Conversion Data) Check out the deferred deeplinkg guide from the AppFlyer knowledge base [here](https://dev.appsflyer.com/hc/docs/dl_work_flow). diff --git a/README.md b/README.md index 3094ee85..6a090b6b 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ ### This plugin is built for -- Android AppsFlyer SDK **v6.9.4** -- iOS AppsFlyer SDK **v6.9.1** +- Android AppsFlyer SDK **v6.10.2** +- iOS AppsFlyer SDK **v6.10.1** ## ❗❗ Breaking changes when updating to v6.x.x❗❗ From 0825b543aadc0cdbe07596ede1794680ea82da1f Mon Sep 17 00:00:00 2001 From: Amit Date: Thu, 30 Mar 2023 17:03:47 +0300 Subject: [PATCH 09/17] Add deeplink code snippets in swift --- Docs/DeepLink.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Docs/DeepLink.md b/Docs/DeepLink.md index 65a77b9c..9bd89ef8 100644 --- a/Docs/DeepLink.md +++ b/Docs/DeepLink.md @@ -189,12 +189,12 @@ For more on App Links check out the guide [here](https://dev.appsflyer.com/hc/do ### iOS Deeplink Setup -In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file: +In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file or in your **bridging header if you are using Swift**: -#### import ```objectivec #import ``` +For Objective-c projects: add the following to you **AppDelegate.m** ```objectivec // Deep linking // Open URI-scheme for iOS 9 and above @@ -213,6 +213,23 @@ In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in return YES; } ``` +For Swift projects: add the following to you **AppDelegate.swift** +```swift + func application(_ application: UIApplication, handleOpen url: URL) -> Bool { + AppsFlyerAttribution.shared().handleOpen(url) + return true + } + + func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { + AppsFlyerAttribution.shared().handleOpen(url, sourceApplication: sourceApplication, annotation: annotation) + return true + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + AppsFlyerAttribution.shared().continue(userActivity) + return true + } +``` #### Universal Links Universal Links link between an iOS mobile app and an associate website/domain, such as AppsFlyer’s OneLink domain (xxx.onelink.me). To do so, it is required to: From cf34e1412162274f752786ad3cf6340a8cf4ad7c Mon Sep 17 00:00:00 2001 From: Amit Date: Thu, 30 Mar 2023 17:04:59 +0300 Subject: [PATCH 10/17] swift code snippets --- Docs/DeepLink.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Docs/DeepLink.md b/Docs/DeepLink.md index 9bd89ef8..b014045a 100644 --- a/Docs/DeepLink.md +++ b/Docs/DeepLink.md @@ -189,7 +189,8 @@ For more on App Links check out the guide [here](https://dev.appsflyer.com/hc/do ### iOS Deeplink Setup -In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file or in your **bridging header if you are using Swift**: +In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK.
+First, import the plugin in the **AppDelegate.m** file or in your **bridging header if you are using Swift**: ```objectivec #import From 56b0f2d6a8e4b091b51208f344ef07ec30586ed4 Mon Sep 17 00:00:00 2001 From: Amit Date: Sun, 2 Apr 2023 14:35:51 +0300 Subject: [PATCH 11/17] update ios to 6.10.1 --- package.json | 3 --- react-native-appsflyer.podspec | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f898fe48..a1ed0855 100755 --- a/package.json +++ b/package.json @@ -55,8 +55,5 @@ "setupFiles": [ "/__tests__/setup.js" ] - }, - "peerDependencies": { - "expo": "*" } } diff --git a/react-native-appsflyer.podspec b/react-native-appsflyer.podspec index 6949d405..d2f6642c 100644 --- a/react-native-appsflyer.podspec +++ b/react-native-appsflyer.podspec @@ -18,14 +18,13 @@ Pod::Spec.new do |s| # AppsFlyerFramework if defined?($RNAppsFlyerStrictMode) && ($RNAppsFlyerStrictMode == true) Pod::UI.puts "#{s.name}: Using AppsFlyerFramework/Strict mode" - s.dependency 'AppsFlyerFramework/Strict', '6.9.1' + s.dependency 'AppsFlyerFramework/Strict', '6.10.1' s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AFSDK_NO_IDFA=1' } else if !defined?($RNAppsFlyerStrictMode) Pod::UI.puts "#{s.name}: Using default AppsFlyerFramework. You may require App Tracking Transparency. Not allowed for Kids apps." Pod::UI.puts "#{s.name}: You may set variable `$RNAppsFlyerStrictMode=true` in Podfile to use strict mode for kids apps." end - # s.dependency 'AppsFlyerFramework', '6.9.1' - s.dependency 'appsflyer-apple-sdk-qa', '6.10.1.106' + s.dependency 'AppsFlyerFramework', '6.10.1' end end From bd14556785d91bd18357201f0428a4fd44966dfb Mon Sep 17 00:00:00 2001 From: Amit Date: Sun, 2 Apr 2023 14:40:17 +0300 Subject: [PATCH 12/17] update ios to 6.10.1 --- ios/AppsFlyerLib.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ios/AppsFlyerLib.h b/ios/AppsFlyerLib.h index 4cefe262..0b900a92 100644 --- a/ios/AppsFlyerLib.h +++ b/ios/AppsFlyerLib.h @@ -2,7 +2,7 @@ // AppsFlyerLib.h // AppsFlyerLib // -// AppsFlyer iOS SDK 6.10.1.106 (106) +// AppsFlyer iOS SDK 6.10.1 (109) // Copyright (c) 2012-2023 AppsFlyer Ltd. All rights reserved. // @@ -140,7 +140,7 @@ typedef enum { EmailCryptTypeSHA256 = 3 } EmailCryptType; -typedef NS_CLOSED_ENUM(NSInteger, AFSDKPlugin) { +typedef NS_CLOSED_ENUM (NSInteger ,AFSDKPlugin) { AFSDKPluginIOSNative, AFSDKPluginUnity, AFSDKPluginFlutter, @@ -155,8 +155,11 @@ typedef NS_CLOSED_ENUM(NSInteger, AFSDKPlugin) { AFSDKPluginUnreal, AFSDKPluginXamarin, AFSDKPluginCapacitor, -} NS_SWIFT_NAME(AppsFlyerPlugin); + AFSDKPluginSegment, + AFSDKPluginAdobeSwiftAEP +} NS_SWIFT_NAME(Plugin); +@class AFSDKPluginInfo; NS_SWIFT_NAME(DeepLinkDelegate) @protocol AppsFlyerDeepLinkDelegate @@ -312,9 +315,9 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); @property(atomic) BOOL anonymizeUser; /** - Deprecated. This API has no effect, since the SDK is no longer fetching Apple Search Ads data from the iAd Framework. iAd Framework has been deprecated by Apple. For more information, see here: https://developer.apple.com/documentation/iad/iad_changelog + Opt-out for Apple Search Ads attributions */ -@property(atomic) BOOL disableCollectASA DEPRECATED_MSG_ATTRIBUTE("Deprecated. This API has no effect, since the SDK is no longer fetching Apple Search Ads data from the iAd Framework."); +@property(atomic) BOOL disableCollectASA; /** Disable Apple Ads Attribution API +[AAAtribution attributionTokenWithError:] @@ -392,11 +395,8 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); /** Internal API. Please don't use. */ -- (void)setPluginInfoWith:(AFSDKPlugin)plugin - pluginVersion:(NSString *)version - additionalParams:(NSDictionary * _Nullable)additionalParams +- (void)setPluginInfoWith:(AFSDKPlugin)plugin pluginVersion:(NSString *)version additionalParams:(NSDictionary * _Nullable)additionalParams NS_SWIFT_NAME(setPluginInfo(plugin:version:additionalParams:)); - /** Enable the collection of Facebook Deferred AppLinks Requires Facebook SDK and Facebook app on target/client device. From 311401b34fbb80ec2adab4c1671e3c2abc5bf33b Mon Sep 17 00:00:00 2001 From: Amit Date: Sun, 2 Apr 2023 15:22:15 +0300 Subject: [PATCH 13/17] fix slack report --- .github/workflows/deploy-to-QA.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-QA.yml b/.github/workflows/deploy-to-QA.yml index f25c9a08..88d2191b 100644 --- a/.github/workflows/deploy-to-QA.yml +++ b/.github/workflows/deploy-to-QA.yml @@ -48,7 +48,7 @@ jobs: env: SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }} run: | - ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') - android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') + ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK' | grep -Eo '[0-9].[0-9]+.[0-9]') + android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK' | grep -Eo '[0-9].[0-9]+.[0-9]') CHANGES=$(cat "${{env.JIRA_FIXED_VERSION}}-releasenotes".txt) curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"${{github.ref_name}}"'", "changes_and_fixes": "'"$CHANGES"'", "android_dependencie": "'"$android_sdk_version"'", "ios_dependencie": "'"$ios_sdk_version"'"}' "$SLACK_TOKEN" From 16981706645be2c7c39486476bc002a5899ec9b2 Mon Sep 17 00:00:00 2001 From: "Amit.kremer" Date: Sun, 2 Apr 2023 12:36:31 +0000 Subject: [PATCH 14/17] 6.10.2-rc2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a1ed0855..eeae86a3 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-appsflyer", - "version": "6.9.4", + "version": "6.10.2-rc2", "description": "React Native Appsflyer plugin", "main": "index.js", "types": "index.d.ts", From a2d490aa4e65f04179ede8f3cd2454386917107b Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 3 Apr 2023 09:49:19 +0300 Subject: [PATCH 15/17] fix workflow --- .github/workflows/release-Production-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-Production-workflow.yml b/.github/workflows/release-Production-workflow.yml index 72b11bdc..c7464422 100644 --- a/.github/workflows/release-Production-workflow.yml +++ b/.github/workflows/release-Production-workflow.yml @@ -74,7 +74,7 @@ jobs: run: | chmod +x .github/workflows/scripts/releaseNotesGenerator.sh .github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" - ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') - android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK \*\*v[0-9].[0-9]+.[0-9]\*\*') + ios_sdk_version=$(cat README.md | grep 'iOS AppsFlyer SDK' | grep -Eo '[0-9].[0-9]+.[0-9]') + android_sdk_version=$(cat README.md | grep 'Android AppsFlyer SDK' | grep -Eo '[0-9].[0-9]+.[0-9]') CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "Production", "install_tag": "latest", "git_branch": "'"$RELEASE_BRACH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "android_dependencie": "'"$android_sdk_version"'", "ios_dependencie": "'"$ios_sdk_version"'"}' "$SLACK_TOKEN" From 983f5a5ed9c16ee82df7859623ffdc9990212a51 Mon Sep 17 00:00:00 2001 From: "Amit.kremer" Date: Mon, 3 Apr 2023 06:50:14 +0000 Subject: [PATCH 16/17] 6.10.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eeae86a3..58e78638 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-appsflyer", - "version": "6.10.2-rc2", + "version": "6.10.2", "description": "React Native Appsflyer plugin", "main": "index.js", "types": "index.d.ts", From 8dd6c1bb681511e5d473ca83fbf58ffb0476d359 Mon Sep 17 00:00:00 2001 From: "Amit.kremer" Date: Mon, 3 Apr 2023 06:50:16 +0000 Subject: [PATCH 17/17] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 385ee786..1d08439c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 6.10.2 + Release date: *2023-04-03* + +- Update Android SDK to v6.10.2 +- Update iOS SDK to v6.10.1 + ## 6.9.4 Release date: *2022-12-27*