Skip to content

Commit

Permalink
Merge pull request #52 from AppsFlyerSDK/dev/DELIVERY-54556/plugin-up…
Browse files Browse the repository at this point in the history
…date

Plugin 6.13.2 Update
  • Loading branch information
andr-ggn authored Apr 25, 2024
2 parents fa1cc04 + fb3420d commit e6a9552
Show file tree
Hide file tree
Showing 18 changed files with 171 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"as3mxml.sdk.framework": "/Users/qua5ar/sdks/air/AIRSDK_50.2.3"
"as3mxml.sdk.framework": "/Users/q5/sdks/air"
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ public class AppsFlyerInterface extends EventDispatcher {
public function setSharingFilterForPartners(partners:Array):void {
}

public function enableTCFDataCollection(enable:Boolean):void {

}

public function setConsentForNonGDPRUser():void {

}

public function setConsentForGDPRUser(hasConsentForDataUsage:Boolean, hasConsentForAdsPersonalization:Boolean):void {

}
//
// public function subscribeForDeepLink():void {
// }
Expand Down
12 changes: 12 additions & 0 deletions actionscript/src/com/appsflyer/adobeair/AppsFlyerInterface.as
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ public class AppsFlyerInterface extends EventDispatcher {
context.call("setSharingFilterForPartners", partners);
}

public function enableTCFDataCollection(enable:Boolean):void {
context.call("EnableTCFDataCollection", enable);
}

public function setConsentForNonGDPRUser():void {
context.call("SetConsentForNonGDPRUser");
}

public function setConsentForGDPRUser(hasConsentForDataUsage:Boolean, hasConsentForAdsPersonalization:Boolean):void {
context.call("SetConsentForGDPRUser", hasConsentForDataUsage, hasConsentForAdsPersonalization);
}

// public function subscribeForDeepLink():void {
// context.addEventListener(StatusEvent.STATUS, _handleStatusEvents);
// context.call("subscribeForDeepLink");
Expand Down
6 changes: 3 additions & 3 deletions android/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.appsflyer:af-android-sdk:6.12.2'
implementation 'com.appsflyer:af-android-sdk:6.13.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
//implementation 'com.google.android.gms:play-services-base:15.0.1'
//implementation 'com.google.android.gms:play-services-ads:15.0.1'
}

task copyDependencies(type: Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public Map<String, FREFunction> getFunctions() {
map.put("setDisableAdvertisingIdentifiers", new SetDisableAdvertisingIdentifiers());
map.put("setSharingFilterForPartners", new SetSharingFilterForPartners());
map.put("setCurrentDeviceLanguage", new SetCurrentDeviceLanguage());
map.put("EnableTCFDataCollection", new EnableTCFDataCollection());
map.put("SetConsentForNonGDPRUser", new SetConsentForNonGDPRUser());
map.put("SetConsentForGDPRUser", new SetConsentForGDPRUser());
// map.put("subscribeForDeepLink", new SubscribeForDeepLink());
return map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void onConversionDataFail(String errorMessage) {
};

AppsFlyerLib.getInstance().init(devKey, conversionDataListener, freContext.getActivity().getApplicationContext());
PluginInfo pluginInfo = new PluginInfo(Plugin.ADOBE_AIR, "6.12.1");
PluginInfo pluginInfo = new PluginInfo(Plugin.ADOBE_AIR, "6.13.2");
AppsFlyerLib.getInstance().setPluginInfo(pluginInfo);
cnt.setDevKey(devKey);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.appsflyer.adobeair.functions;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.appsflyer.AppsFlyerLib;

public class EnableTCFDataCollection implements FREFunction {
@Override
public FREObject call(FREContext freContext, FREObject[] freObjects) {

Boolean enableTCFDataCollection = false;
try {
enableTCFDataCollection = freObjects[0].getAsBool();
AppsFlyerLib.getInstance().enableTCFDataCollection(enableTCFDataCollection);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.appsflyer.adobeair.functions;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.appsflyer.AppsFlyerConsent;
import com.appsflyer.AppsFlyerLib;

public class SetConsentForGDPRUser implements FREFunction {
@Override
public FREObject call(FREContext freContext, FREObject[] freObjects) {

Boolean hasConsentForDataUsage = false;
Boolean hasConsentForAdsPersonalization = false;
try {
hasConsentForDataUsage = freObjects[0].getAsBool();
hasConsentForAdsPersonalization = freObjects[1].getAsBool();
AppsFlyerConsent consent = AppsFlyerConsent.forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization);
AppsFlyerLib.getInstance().setConsentData(consent);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.appsflyer.adobeair.functions;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.appsflyer.AppsFlyerConsent;
import com.appsflyer.AppsFlyerLib;

public class SetConsentForNonGDPRUser implements FREFunction {
@Override
public FREObject call(FREContext freContext, FREObject[] freObjects) {
try {
AppsFlyerConsent consent = AppsFlyerConsent.forNonGDPRUser();
AppsFlyerLib.getInstance().setConsentData(consent);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}
}
Binary file modified bin/AppsFlyerAIRExtension.ane
Binary file not shown.
2 changes: 1 addition & 1 deletion build/extension.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<extension xmlns="http://ns.adobe.com/air/extension/50.2">
<id>com.appsflyer.adobeair</id>
<versionNumber>6.12.1</versionNumber>
<versionNumber>6.13.2</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
Expand Down
21 changes: 11 additions & 10 deletions build/platform-android.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
<packagedDependencies>

<packagedDependency>installreferrer-2.2.jar</packagedDependency>
<packagedDependency>af-android-sdk-6.12.2.jar</packagedDependency>

<packagedDependency>af-android-sdk-6.13.0.jar</packagedDependency>
<!-- Not Using -->
<!-- <packagedDependency>google-play-services.jar</packagedDependency> -->


<!-- PlayServices/Support -->
<!--
<packagedDependency>play-services-base-15.0.1.jar</packagedDependency>
<packagedDependency>play-services-basement-15.0.1.jar</packagedDependency>
<packagedDependency>play-services-ads-15.0.1.jar</packagedDependency>
<packagedDependency>play-services-ads-identifier-15.0.1.jar</packagedDependency>
<!-- // kotlin-stdlib-1.8.0
// kotlin-stdlib-common-1.8.0
// kotlin-stdlib-jdk7-1.8.0
// kotlin-stdlib-jdk8-1.8.0 -->
<packagedDependency>play-services-ads-identifier-15.0.1.jar</packagedDependency>
-->


<!-- Kotlin -->
<packagedDependency>kotlin-stdlib-1.8.0.jar</packagedDependency>
<packagedDependency>kotlin-stdlib-common-1.8.0.jar</packagedDependency>
<packagedDependency>kotlin-stdlib-jdk7-1.8.0.jar</packagedDependency>
<packagedDependency>kotlin-stdlib-jdk8-1.8.0.jar</packagedDependency>

</packagedDependencies>
<packagedResources>
<!-- <packagedResource>
Expand Down
47 changes: 45 additions & 2 deletions ios/AppsFlyerAIRExtension/AppsFlyerAIRExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ + (NSData *)dataFromHexString:(NSString *)string
NSString *developerKey = [AppsFlyerAIRExtension getString: argv[0]];
NSString *appId = [AppsFlyerAIRExtension getString: argv[1]];
[[AppsFlyerLib shared] setPluginInfoWith:AFSDKPluginAdobeAir
pluginVersion:@"6.12.1"
pluginVersion:@"6.13.2"
additionalParams:nil];
[AppsFlyerLib shared].appsFlyerDevKey = developerKey;
[AppsFlyerLib shared].appleAppID = appId;
Expand Down Expand Up @@ -469,10 +469,41 @@ + (NSData *)dataFromHexString:(NSString *)string
return NULL;
}

DEFINE_ANE_FUNCTION(EnableTCFDataCollection)
{
uint32_t value;
FREGetObjectAsBool(argv[0], &value);
[[AppsFlyerLib shared] enableTCFDataCollection:value];
return NULL;
}

DEFINE_ANE_FUNCTION(SetConsentForNonGDPRUser)
{
id consent = [[AppsFlyerConsent alloc] initNonGDPRUser];
[[AppsFlyerLib shared] setConsentData:consent];
return NULL;
}

// void SetConsentForGDPRUser(bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization)
DEFINE_ANE_FUNCTION(SetConsentForGDPRUser)
{
uint32_t hasConsentForDataUsage;
FREGetObjectAsBool(argv[0], &hasConsentForDataUsage);

uint32_t hasConsentForAdsPersonalization;
FREGetObjectAsBool(argv[0], &hasConsentForAdsPersonalization);


id consent = [[AppsFlyerConsent alloc] initForGDPRUserWithHasConsentForDataUsage:hasConsentForDataUsage
hasConsentForAdsPersonalization:hasConsentForAdsPersonalization];
[[AppsFlyerLib shared] setConsentData:consent];
return NULL;
}


void AFExtContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet)
{
*numFunctionsToTest = 32;
*numFunctionsToTest = 35;
FRENamedFunction* func = (FRENamedFunction*)malloc(sizeof(FRENamedFunction) * *numFunctionsToTest);

func[0].name = (const uint8_t*)"start";
Expand Down Expand Up @@ -603,6 +634,18 @@ void AFExtContextInitializer(void* extData, const uint8_t* ctxType, FREContext c
func[31].functionData = NULL;
func[31].function = &setSharingFilterForPartners;

func[32].name = (const uint8_t*)"EnableTCFDataCollection";
func[32].functionData = NULL;
func[32].function = &EnableTCFDataCollection;

func[33].name = (const uint8_t*)"SetConsentForNonGDPRUser";
func[33].functionData = NULL;
func[33].function = &SetConsentForNonGDPRUser;

func[34].name = (const uint8_t*)"SetConsentForGDPRUser";
func[34].functionData = NULL;
func[34].function = &SetConsentForGDPRUser;

*functionsToSet = func;

conversionDelegate = [[AppsFlyerDelegate alloc] init];
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

target 'AppsFlyerAIRExtension' do

pod 'AppsFlyerFramework', '6.12.1'
pod 'AppsFlyerFramework', '6.13.2'
end

target 'AppsFlyerAIRExtension-Strict' do

pod 'AppsFlyerFramework/Strict', '6.12.1'
pod 'AppsFlyerFramework/Strict', '6.13.2'
end
2 changes: 1 addition & 1 deletion sample/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"as3mxml.sdk.framework": "/Users/qua5ar/sdks/air/AIRSDK_50.2.3"
"as3mxml.sdk.framework": "/Users/q5/sdks/air"
}
8 changes: 4 additions & 4 deletions sample/asconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
"output": "bin/Main.apk",
"signingOptions": {
"storetype": "pkcs12",
"keystore": "android_certificate.p12"
"keystore": "a1.p12"
}
},
"ios": {
"target": "ipa-debug-interpreter",
"output": "bin/Main.ipa",
"signingOptions": {
"storetype": "pkcs12",
"keystore": "ios_certificate.p12",
"provisioning-profile": "example.mobileprovision"
"keystore": "a1.p12",
"provisioning-profile": "iOSExample.mobileprovision"
}
},
"ios_simulator": {
"target": "ipa-debug-interpreter-simulator",
"platformsdk": "/Applications/Xcode14.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk",
"platformsdk": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.2.sdk",
"output": "bin/Main.ipa",
"signingOptions": {
"storetype": "pkcs12",
Expand Down
2 changes: 1 addition & 1 deletion sample/src/Main-app.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/50.2">
<id>com.appsflyer.Device-Id</id>
<id>com.appsflyer.iOS-Example</id>
<versionNumber>1.0.0</versionNumber>
<filename>Main</filename>
<name>Main</name>
Expand Down
7 changes: 6 additions & 1 deletion sample/src/Main.as
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public class Main extends Sprite {
appsFlyer.setResolveDeepLinkURLs(["5a5b39e8a8df.ngrok.io"]);
appsFlyer.init("4UGrDF4vFvPLbHq5bXtCza", "753258300");
appsFlyer.start("4UGrDF4vFvPLbHq5bXtCza", "753258300");

// Test 1
appsFlyer.enableTCFDataCollection(true);
// Test 2
appsFlyer.setConsentForNonGDPRUser();
// Test 3
appsFlyer.setConsentForGDPRUser(true, true);
function eventHandler(event:AppsFlyerEvent):void {
log("AppsFlyer event: " + event.type + "; \nData: " + event.data);
textField.text = "AppsFlyer event: " + event.type + "; \nData: " + event.data + "\n";
Expand Down

0 comments on commit e6a9552

Please sign in to comment.