Skip to content

Commit

Permalink
use SDK 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMoriarty committed Jan 4, 2021
1 parent 09e3e64 commit c83ed72
Show file tree
Hide file tree
Showing 14 changed files with 276 additions and 118 deletions.
4 changes: 2 additions & 2 deletions android-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ dependencies {
library when building the final binary.
*/
compileOnly fileTree(dir: 'libs', include: ['godot-lib*.aar'])
implementation 'com.appsflyer:af-android-sdk:5.+'
implementation 'com.appsflyer:af-android-sdk:6.1.+'
implementation 'com.android.installreferrer:installreferrer:1.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
}

group = 'ru.mobilap.godot'
version = '0.1.0'
version = '0.2.0'
ext {
artifact = 'godot-appsflyer'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void onAttributionFailure(String errorMessage) {
}
};
AppsFlyerLib.getInstance().init(key, conversionDataListener, getActivity().getApplicationContext());
AppsFlyerLib.getInstance().startTracking(getActivity().getApplication());
AppsFlyerLib.getInstance().start(getActivity().getApplication());
if(!ProductionMode) {
AppsFlyerLib.getInstance().setDebugLog(true);
}
Expand All @@ -115,7 +115,7 @@ public void onValidateInAppFailure(String error) {

public void track_event(final String event, final Dictionary params)
{
AppsFlyerLib.getInstance().trackEvent(getActivity(), event, params);
AppsFlyerLib.getInstance().logEvent(getActivity(), event, params);
}

public void set_uninstall_token(final String token)
Expand All @@ -124,7 +124,7 @@ public void set_uninstall_token(final String token)

public void track_revenue(final String revenue, final String currency, final String signature, final String originalJson, final String public_key)
{
AppsFlyerLib.getInstance().validateAndTrackInAppPurchase(getActivity(), public_key, signature, originalJson, revenue, currency, null);
AppsFlyerLib.getInstance().validateAndLogInAppPurchase(getActivity(), public_key, signature, originalJson, revenue, currency, null);
}

public String appsflyer_id()
Expand Down
8 changes: 8 additions & 0 deletions ios-framework/gdnative_ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
5123F01825A33AD800DDF370 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5123F01725A33AD800DDF370 /* AdSupport.framework */; };
5123F01A25A33ADD00DDF370 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5123F01925A33ADD00DDF370 /* iAd.framework */; };
519534CD24D847AA007FF66C /* entry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519534CA24D847AA007FF66C /* entry.cpp */; };
51B4368624D8707E0040DBF7 /* AppsFlyerLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51B4368524D8707E0040DBF7 /* AppsFlyerLib.framework */; };
51B4368B24D870940040DBF7 /* AppsFlyer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 51B4368924D870940040DBF7 /* AppsFlyer.hpp */; };
Expand All @@ -17,6 +19,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
5123F01725A33AD800DDF370 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
5123F01925A33ADD00DDF370 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; };
519534CA24D847AA007FF66C /* entry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = entry.cpp; sourceTree = "<group>"; };
51B4368524D8707E0040DBF7 /* AppsFlyerLib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppsFlyerLib.framework; path = gdnative_ios/AppsFlyerLib.framework; sourceTree = "<group>"; };
51B4368924D870940040DBF7 /* AppsFlyer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AppsFlyer.hpp; sourceTree = "<group>"; };
Expand All @@ -34,6 +38,8 @@
buildActionMask = 2147483647;
files = (
51E8DE9A24D83FF200CB0940 /* libgodot-cpp.ios.release.a in Frameworks */,
5123F01A25A33ADD00DDF370 /* iAd.framework in Frameworks */,
5123F01825A33AD800DDF370 /* AdSupport.framework in Frameworks */,
51B4368E24D870EE0040DBF7 /* UIKit.framework in Frameworks */,
51B4368624D8707E0040DBF7 /* AppsFlyerLib.framework in Frameworks */,
);
Expand Down Expand Up @@ -82,6 +88,8 @@
90A13CF424AB37D900E8464F /* Frameworks */ = {
isa = PBXGroup;
children = (
5123F01925A33ADD00DDF370 /* iAd.framework */,
5123F01725A33AD800DDF370 /* AdSupport.framework */,
51B4368D24D870EE0040DBF7 /* UIKit.framework */,
51B4368524D8707E0040DBF7 /* AppsFlyerLib.framework */,
51E8DE9924D83FC100CB0940 /* libgodot-cpp.ios.release.a */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
framework module AppsFlyerLib {
umbrella header "AppsFlyerTracker.h"
umbrella header "AppsFlyerLib.h"

export *
module * { export * }
}
export *
module * { export * }
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
NS_ASSUME_NONNULL_BEGIN

/**
AppsFlyer allows you to track and attribute installs originating
AppsFlyer allows you to log and attribute installs originating
from cross promotion campaigns of your existing apps.
Afterwards, you can optimize on your cross-promotion traffic to get even better results.
*/
@interface AppsFlyerCrossPromotionHelper : NSObject

/**
To track an impression use the following API call.
To log an impression use the following API call.
Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
@param appID Promoted App ID
@param campaign A campaign name
*/
+ (void)trackCrossPromoteImpression:(nonnull NSString *)appID
campaign:(nullable NSString *)campaign;
@param parameters Additional params like `@{@"af_sub1": @"val", @"custom_param": @"val2" }`
*/
+ (void)logCrossPromoteImpression:(nonnull NSString *)appID
campaign:(nullable NSString *)campaign
parameters:(nullable NSDictionary *)parameters;

/**
iOS allows you to utilize the StoreKit component to open
Expand All @@ -37,10 +39,10 @@ NS_ASSUME_NONNULL_BEGIN
@param parameters Additional params like `@{@"af_sub1": @"val", @"custom_param": @"val2" }`
@param openStoreBlock Contains promoted `clickURL`
*/
+ (void)trackAndOpenStore:(nonnull NSString *)appID
campaign:(nullable NSString *)campaign
paramters:(nullable NSDictionary *)parameters
openStore:(void (^)(NSURLSession *urlSession, NSURL *clickURL))openStoreBlock;
+ (void)logAndOpenStore:(nonnull NSString *)appID
campaign:(nullable NSString *)campaign
parameters:(nullable NSDictionary *)parameters
openStore:(void (^)(NSURLSession *urlSession, NSURL *clickURL))openStoreBlock;

@end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// AFSDKDeeplink.h
// AppsFlyerLib
//
// Created by Andrii Hahan on 20.08.2020.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(DeepLink)
@interface AppsFlyerDeepLink : NSObject

- (nonnull instancetype)init NS_UNAVAILABLE;
+ (nonnull instancetype)new NS_UNAVAILABLE;

@property (readonly, nonnull) NSDictionary<NSString *, id> *clickEvent;
@property (readonly, nullable) NSString *deeplinkValue;
@property (readonly, nullable) NSString *matchType;
@property (readonly, nullable) NSString *clickHTTPReferrer;
@property (readonly, nullable) NSString *mediaSource;
@property (readonly, nullable) NSString *campaign;
@property (readonly, nullable) NSString *campaignId;
@property (readonly, nullable) NSString *afSub1;
@property (readonly, nullable) NSString *afSub2;
@property (readonly, nullable) NSString *afSub3;
@property (readonly, nullable) NSString *afSub4;
@property (readonly, nullable) NSString *afSub5;
@property (readonly) BOOL isDeferred;

- (NSString *)toString;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// AFSDKDeepLinkObserver.h
// AppsFlyerLib
//
// Created by Andrii Hahan on 09.09.2020.
//

#import <Foundation/Foundation.h>

@class AppsFlyerDeepLinkResult;

NS_SWIFT_NAME(DeepLinkObserverDelegate)
@protocol AppsFlyerDeepLinkObserverDelegate <NSObject>

@optional
- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result;

@end

NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(DeepLinkObserver)
@interface AppsFlyerDeepLinkObserver : NSObject

@property(weak, nonatomic) id<AppsFlyerDeepLinkObserverDelegate> delegate;
@property NSTimeInterval timeoutInterval;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// AFSDKDeeplinkResult.h
// AppsFlyerLib
//
// Created by Andrii Hahan on 20.08.2020.
//

#import <Foundation/Foundation.h>

@class AppsFlyerDeepLink;

typedef NS_CLOSED_ENUM(NSUInteger, AFSDKDeepLinkResultStatus) {
AFSDKDeepLinkResultStatusNotFound,
AFSDKDeepLinkResultStatusFound,
AFSDKDeepLinkResultStatusFailure,
} NS_SWIFT_NAME(DeepLinkResultStatus);

NS_SWIFT_NAME(DeepLinkResult)
@interface AppsFlyerDeepLinkResult : NSObject

- (nonnull instancetype)init NS_UNAVAILABLE;
+ (nonnull instancetype)new NS_UNAVAILABLE;

@property(readonly) AFSDKDeepLinkResultStatus status;

@property(readonly, nullable) AppsFlyerDeepLink *deepLink;
@property(readonly, nullable) NSError *error;

@end
Loading

0 comments on commit c83ed72

Please sign in to comment.