Skip to content

Commit

Permalink
Merge pull request #33 from AppsFlyerSDK/releases/6.2.41
Browse files Browse the repository at this point in the history
Releases/6.2.41
  • Loading branch information
sokoloff06 authored Mar 24, 2021
2 parents 48efe24 + b7bd83c commit 4a18632
Show file tree
Hide file tree
Showing 63 changed files with 98 additions and 981 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Supported platforms:

Based on:

- iOS AppsFlyerSDK **v6.2.3**
- iOS AppsFlyerSDK **v6.2.4**
- Android AppsFlyerSDK **v6.2.3**

Built with:
Expand Down
42 changes: 41 additions & 1 deletion SampleApp/src/Main.as
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package {

import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;

public class Main extends Sprite {
private static var appsFlyer:AppsFlyerInterface;
appsFlyer = new AppsFlyerInterface();


public function Main() {
var textField:TextField = new TextField();
textField.width = 1000;
textField.text = "Hello, World";
addChild(textField);

ButtonInteractivity()

trace("Main constructor")
appsFlyer.setDebug(true);
appsFlyer.setCurrency("GBP")
// appsFlyer.disableSKAdNetwork(true)

appsFlyer.addEventListener(AppsFlyerEvent.INSTALL_CONVERSATION_DATA_LOADED, eventHandler); // GCD success
appsFlyer.addEventListener(AppsFlyerEvent.INSTALL_CONVERSATION_FAILED, eventHandler); // GCD error
appsFlyer.addEventListener(AppsFlyerEvent.ATTRIBUTION_FAILURE, eventHandler); // OAOA error
Expand Down Expand Up @@ -53,6 +58,41 @@ public class Main extends Sprite {
appsFlyer.validateAndLogInAppPurchase(publicKey, signature, purchaseData, price, currency, JSON.stringify(additionalParameters));
}

private var button:Sprite = new Sprite();

public function ButtonInteractivity() {
drawButton()
button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
addChild(button);
}

private function drawButton():void {
var textLabel:TextField = new TextField()
button.graphics.clear();
button.graphics.beginFill(0xD4D4D4); // grey color
button.graphics.drawRoundRect(100, 100, 80, 25, 10, 10); // x, y, width, height, ellipseW, ellipseH
button.graphics.endFill();

textLabel.text = "Log event";
textLabel.x = 100
textLabel.y = 100
textLabel.width = 70;
textLabel.height = 20;
textLabel.selectable = false;
button.addChild(textLabel)
}

private function mouseDownHandler(event:MouseEvent):void {
var param:String = "af_purchase";
var value:Object = {
"af_content_id": "123",
"af_revenue": "20",
"af_currency": "GBP"
};
appsFlyer.logEvent("af_add_to_cart", JSON.stringify(value))
appsFlyer.logEvent(param, JSON.stringify(value))
}


}
}
3 changes: 3 additions & 0 deletions actionscript/default/src/AppsFlyerInterface.as
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public class AppsFlyerInterface extends EventDispatcher {
public function waitForATTUserAuthorization():void {
}

public function disableSKAdNetwork(shouldDisable:Boolean):void {
}

// public function requestATTPermission():void{
// }

Expand Down
4 changes: 4 additions & 0 deletions actionscript/mobile/src/AppsFlyerInterface.as
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public class AppsFlyerInterface extends EventDispatcher {
context.call("waitForATTUserAuthorization", timeout);
}

public function disableSKAdNetwork(shouldDisable:Boolean):void {
context.call("disableSKAdNetwork", shouldDisable);
}

// public function requestATTPermission():void{
// context.call("requestATTPermission");
// }
Expand Down
1 change: 1 addition & 0 deletions android/src/com/appsflyer/adobeair/AppsFlyerContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public Map<String, FREFunction> getFunctions() {
map.put("setCustomerUserId", new SetCustomerUserId());
map.put("setUserEmails", new SetUserEmails());
map.put("waitForATTUserAuthorization", new waitForATTUserAuthorization());
map.put("disableSKAdNetwork", new disableSKAdNetwork());
return map;
}

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

import android.util.Log;
import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;

public class disableSKAdNetwork implements FREFunction {


private final static String LOG = "AppsFlyer";

@Override
public FREObject call(FREContext freContext, FREObject[] freObjects) {
Log.d(LOG, "disableSKAdNetwork method is not supported on Android");
return null;
}
}
Binary file modified bin/AppsFlyerAIRExtension-strict.ane
Binary file not shown.
Binary file modified bin/AppsFlyerAIRExtension-witout-gp-support.ane
Binary file not shown.
Binary file modified bin/AppsFlyerAIRExtension-witout-gp.ane
Binary file not shown.
Binary file modified bin/AppsFlyerAIRExtension.ane
Binary file not shown.
Binary file modified bin/AppsFlyerAIRExtension.swc
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/33.1">
<id>com.appsflyer.adobeair</id>
<versionNumber>6.2.31</versionNumber>
<versionNumber>6.2.41</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
Expand Down
30 changes: 29 additions & 1 deletion ios/AppsFlyerAIRExtension/AppsFlyerAIRExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#define DEFINE_ANE_FUNCTION(fn) FREObject (fn)(FREContext context, void* functionData, uint32_t argc, FREObject argv[])

typedef void (*bypassDidFinishLaunchingWithOption)(id, SEL, NSInteger);

@implementation AppsFlyerAIRExtension

static IMP __original_applicationDidBecomeActive_Imp;
Expand Down Expand Up @@ -51,6 +53,18 @@ BOOL didReceiveRemoteNotificationHandler(id self, SEL _cmd, UIApplication* appli
return ((BOOL(*)(id, SEL, UIApplication*, NSDictionary*))__original_didReceiveRemoteNotification_Imp)(self, _cmd, application, userInfo);
}

static IMP __original_didFinishLaunchingWithOptions_Imp;
BOOL didFinishLaunchingWithOptions(id self, SEL _cmd, UIApplication* application, NSDictionary<UIApplicationLaunchOptionsKey,id> * launchOptions) {
NSLog(@"[AppsFlyerAIRExtension] didFinishLaunchingWithOptions: %@", self);
SEL SKSel = NSSelectorFromString(@"__willResolveSKRules:");
id AppsFlyer = [AppsFlyerLib shared];
if ([AppsFlyer respondsToSelector:SKSel]) {
bypassDidFinishLaunchingWithOption msgSend = (bypassDidFinishLaunchingWithOption)objc_msgSend;
msgSend(AppsFlyer, SKSel, 2);
}
return ((BOOL(*)(id, SEL, UIApplication*, NSDictionary<UIApplicationLaunchOptionsKey,id> *))__original_didFinishLaunchingWithOptions_Imp)(self, _cmd, application, launchOptions);
}

+ (void) load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Expand All @@ -64,18 +78,21 @@ + (void) load {
SEL originalOpenURLDeprecatedSelector = @selector(application:openURL:sourceApplication:annotation:);
SEL originalOpenURLSelector = @selector(application:openURL:options:);
SEL originalDidReceiveRemoteNotificationSelector = @selector(application:didReceiveRemoteNotification:);
SEL originalDidFinishLaunchingWithOptionsSelector = @selector(application:didFinishLaunchingWithOptions:);

Method originalApplicationDidBecomeActiveMethod = class_getInstanceMethod(objectClass, originalApplicationDidBecomeActiveSelector);
Method originalContinueUserActivityMethod = class_getInstanceMethod(objectClass, originalContinueUserActivitySelector);
Method originalOpenURLDeprecatedMethod = class_getInstanceMethod(objectClass, originalOpenURLDeprecatedSelector);
Method originalOpenURLMethod = class_getInstanceMethod(objectClass, originalOpenURLSelector);
Method originalDidReceiveRemoteNotificationMethod = class_getInstanceMethod(objectClass, originalDidReceiveRemoteNotificationSelector);
Method originalDidFinishLaunchingWithOptionsMethod = class_getInstanceMethod(objectClass, originalDidFinishLaunchingWithOptionsSelector);

__original_applicationDidBecomeActive_Imp = method_setImplementation(originalApplicationDidBecomeActiveMethod, (IMP)applicationDidBecomeActive);
__original_continueUserActivity_Imp = method_setImplementation(originalContinueUserActivityMethod, (IMP)continueUserActivity);
__original_openURLDeprecated_Imp = method_setImplementation(originalOpenURLDeprecatedMethod, (IMP)openURLDeprecated);
__original_openURL_Imp = method_setImplementation(originalOpenURLMethod, (IMP)openURL);
__original_didReceiveRemoteNotification_Imp = method_setImplementation(originalDidReceiveRemoteNotificationMethod, (IMP)didReceiveRemoteNotificationHandler);
__original_didFinishLaunchingWithOptions_Imp = method_setImplementation(originalDidFinishLaunchingWithOptionsMethod, (IMP)didFinishLaunchingWithOptions);
}
});
}
Expand Down Expand Up @@ -427,7 +444,14 @@ + (NSData *)dataFromHexString:(NSString *)string
double timeoutInterval = (double)interval;
[[AppsFlyerLib shared] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval];
}
return NULL;
}

DEFINE_ANE_FUNCTION(disableSKAdNetwork)
{
uint32_t value;
FREGetObjectAsBool(argv[0], &value);
[AppsFlyerLib shared].disableSKAdNetwork = value;
return NULL;
}

Expand All @@ -442,7 +466,7 @@ + (NSData *)dataFromHexString:(NSString *)string

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

func[19].name = (const uint8_t*)"init";
Expand Down Expand Up @@ -481,6 +505,10 @@ void AFExtContextInitializer(void* extData, const uint8_t* ctxType, FREContext c
func[27].functionData = NULL;
func[27].function = &setSharingFilter;

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

func[0].name = (const uint8_t*)"start";
func[0].functionData = NULL;
func[0].function = &start;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file not shown.
8 changes: 0 additions & 8 deletions sample-project — копия/build/build.custom.properties

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions sample-project — копия/build/build.properties

This file was deleted.

Loading

0 comments on commit 4a18632

Please sign in to comment.