diff --git a/android-plugin/build.gradle b/android-plugin/build.gradle index 031f0d2..4560811 100644 --- a/android-plugin/build.gradle +++ b/android-plugin/build.gradle @@ -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' } diff --git a/android-plugin/src/main/java/ru/mobilap/appsflyer/AppsFlyer.java b/android-plugin/src/main/java/ru/mobilap/appsflyer/AppsFlyer.java index 293ed72..2e38ba0 100644 --- a/android-plugin/src/main/java/ru/mobilap/appsflyer/AppsFlyer.java +++ b/android-plugin/src/main/java/ru/mobilap/appsflyer/AppsFlyer.java @@ -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); } @@ -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) @@ -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() diff --git a/ios-framework/gdnative_ios.xcodeproj/project.pbxproj b/ios-framework/gdnative_ios.xcodeproj/project.pbxproj index e2a14c5..f6726f1 100644 --- a/ios-framework/gdnative_ios.xcodeproj/project.pbxproj +++ b/ios-framework/gdnative_ios.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 = ""; }; 51B4368524D8707E0040DBF7 /* AppsFlyerLib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppsFlyerLib.framework; path = gdnative_ios/AppsFlyerLib.framework; sourceTree = ""; }; 51B4368924D870940040DBF7 /* AppsFlyer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AppsFlyer.hpp; sourceTree = ""; }; @@ -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 */, ); @@ -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 */, diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Modules/module.modulemap b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Modules/module.modulemap index 047c0b9..dd2101c 100644 --- a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Modules/module.modulemap +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Modules/module.modulemap @@ -1,6 +1,6 @@ framework module AppsFlyerLib { - umbrella header "AppsFlyerTracker.h" +umbrella header "AppsFlyerLib.h" - export * - module * { export * } -} \ No newline at end of file +export * +module * { export * } +} diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/AppsFlyerLib b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/AppsFlyerLib index 4f6eb34..a6bbcf8 100644 Binary files a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/AppsFlyerLib and b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/AppsFlyerLib differ diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerCrossPromotionHelper.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerCrossPromotionHelper.h index 5c1c17f..483f8f8 100644 --- a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerCrossPromotionHelper.h +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerCrossPromotionHelper.h @@ -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 @@ -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 diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLink.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLink.h new file mode 100644 index 0000000..f099ace --- /dev/null +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLink.h @@ -0,0 +1,36 @@ +// +// AFSDKDeeplink.h +// AppsFlyerLib +// +// Created by Andrii Hahan on 20.08.2020. +// + +#import + +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 *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 diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkObserver.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkObserver.h new file mode 100644 index 0000000..395a6d4 --- /dev/null +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkObserver.h @@ -0,0 +1,29 @@ +// +// AFSDKDeepLinkObserver.h +// AppsFlyerLib +// +// Created by Andrii Hahan on 09.09.2020. +// + +#import + +@class AppsFlyerDeepLinkResult; + +NS_SWIFT_NAME(DeepLinkObserverDelegate) +@protocol AppsFlyerDeepLinkObserverDelegate + +@optional +- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result; + +@end + +NS_ASSUME_NONNULL_BEGIN +NS_SWIFT_NAME(DeepLinkObserver) +@interface AppsFlyerDeepLinkObserver : NSObject + +@property(weak, nonatomic) id delegate; +@property NSTimeInterval timeoutInterval; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkResult.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkResult.h new file mode 100644 index 0000000..50d41d7 --- /dev/null +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerDeepLinkResult.h @@ -0,0 +1,29 @@ +// +// AFSDKDeeplinkResult.h +// AppsFlyerLib +// +// Created by Andrii Hahan on 20.08.2020. +// + +#import + +@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 diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerTracker.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerLib.h similarity index 74% rename from ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerTracker.h rename to ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerLib.h index f097879..8a4c602 100644 --- a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerTracker.h +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerLib.h @@ -1,16 +1,19 @@ // -// AppsFlyerTracker.h +// AppsFlyerLib.h // AppsFlyerLib // -// AppsFlyer iOS SDK 5.2.0 (964) -// Copyright (c) 2012-2019 AppsFlyer Ltd. All rights reserved. +// AppsFlyer iOS SDK 6.1.3 (43) +// Copyright (c) 2012-2020 AppsFlyer Ltd. All rights reserved. // #import + #import "AppsFlyerCrossPromotionHelper.h" #import "AppsFlyerShareInviteHelper.h" -NS_ASSUME_NONNULL_BEGIN +#import "AppsFlyerDeepLinkResult.h" +#import "AppsFlyerDeepLink.h" +NS_ASSUME_NONNULL_BEGIN // In app event names constants #define AFEventLevelAchieved @"af_level_achieved" @@ -128,13 +131,6 @@ NS_ASSUME_NONNULL_BEGIN #define AFEventParamAdRevenueAdSize @"af_adrev_ad_size" #define AFEventParamAdRevenueMediatedNetworkName @"af_adrev_mediated_network_name" -#define kDefaultOneLink @"go.onelink.me" -#define kNoOneLinkFallback @"https://app.appsflyer.com" -#define kINviteAppleAppID @"af_siteid" - - - - /// Mail hashing type typedef enum { /// None @@ -147,11 +143,19 @@ typedef enum { EmailCryptTypeSHA256 = 3 } EmailCryptType; +NS_SWIFT_NAME(DeepLinkDelegate) +@protocol AppsFlyerDeepLinkDelegate + +@optional +- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result; + +@end + /** Conform and subscribe to this protocol to allow getting data about conversion and install attribution */ -@protocol AppsFlyerTrackerDelegate +@protocol AppsFlyerLibDelegate /** `conversionInfo` contains information about install. @@ -189,7 +193,7 @@ typedef enum { @end /** - You can track installs, app updates, sessions and additional in-app events + You can log installs, app updates, sessions and additional in-app events (including in-app purchases, game levels, etc.) to evaluate ROI and user engagement. The iOS SDK is compatible with all iOS/tvOS devices with iOS version 7 and above. @@ -198,15 +202,15 @@ typedef enum { for more information. */ -@interface AppsFlyerTracker : NSObject +@interface AppsFlyerLib : NSObject /** - Gets the singleton instance of the AppsFlyerTracker class, creating it if + Gets the singleton instance of the AppsFlyerLib class, creating it if necessary. - @return The singleton instance of AppsFlyerTracker. + @return The singleton instance of AppsFlyerLib. */ -+ (AppsFlyerTracker *)sharedTracker; ++ (AppsFlyerLib *)shared; /** In case you use your own user ID in your app, you can set this property to that ID. @@ -231,6 +235,25 @@ typedef enum { */ @property(nonatomic, strong) NSString * appleAppID; +#ifndef AFSDK_NO_IDFA +/** + AppsFlyer SDK collect Apple's `advertisingIdentifier` if the `AdSupport.framework` included in the SDK. + You can disable this behavior by setting the following property to YES +*/ +@property(nonatomic) BOOL disableAdvertisingIdentifier; + +@property(nonatomic, strong, readonly) NSString *advertisingIdentifier; + +/** + Waits for request user authorization to access app-related data + */ +- (void)waitForATTUserAuthorizationWithTimeoutInterval:(NSTimeInterval)timeoutInterval +NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); + +#endif + +@property(nonatomic) BOOL disableSKAdNetwork; + /** In case of in app purchase events, you can set the currency code your user has purchased with. The currency code is a 3 letter code according to ISO standards @@ -238,23 +261,17 @@ typedef enum { Objective-C:
- [[AppsFlyerTracker sharedTracker] setCurrencyCode:@"USD"];
+ [[AppsFlyerLib shared] setCurrencyCode:@"USD"];
  
Swift:
- AppsFlyerTracker.shared().currencyCode = "USD"
+ AppsFlyerLib.shared().currencyCode = "USD"
  
*/ @property(nonatomic, strong, nullable) NSString *currencyCode; -/** - AppsFlyer SDK collect Apple's `advertisingIdentifier` if the `AdSupport.framework` included in the SDK. - You can disable this behavior by setting the following property to YES - */ -@property(atomic) BOOL disableAppleAdSupportTracking; - /** Prints SDK messages to the console log. This property should only be used in `DEBUG` mode. The default value is `NO` @@ -272,19 +289,23 @@ typedef enum { @property(nonatomic, strong, nullable, setter = setAppInviteOneLink:) NSString * appInviteOneLinkID; /** - Opt-out tracking for specific user + Opt-out logging for specific user */ -@property(atomic) BOOL deviceTrackingDisabled; +@property(atomic) BOOL anonymizeUser; /** - Opt-out tracking for Apple Search Ads attributions + Opt-out for Apple Search Ads attributions */ -@property(atomic) BOOL disableIAdTracking; +@property(atomic) BOOL disableCollectASA; + +@property(nonatomic) BOOL disableAppleAdsAttribution; /** - AppsFlyer delegate. See `AppsFlyerTrackerDelegate` + AppsFlyer delegate. See `AppsFlyerLibDelegate` */ -@property(weak, nonatomic) id delegate; +@property(weak, nonatomic) id delegate; + +@property(weak, nonatomic) id deepLinkDelegate; /** In app purchase receipt validation Apple environment(production or sandbox). The default value is NO @@ -296,19 +317,14 @@ typedef enum { */ @property(nonatomic) BOOL useUninstallSandbox; -/** - Advertising Id(exposed for RemoteDebug) - */ -@property(nonatomic, strong, readonly) NSString *advertiserId; - /** For advertisers who wrap OneLink within another Universal Link. - An advertiser will be able to deeplink from a OneLink wrapped within another Universal Link and also track this retargeting conversion. + An advertiser will be able to deeplink from a OneLink wrapped within another Universal Link and also log this retargeting conversion. Objective-C:
- [[AppsFlyerTracker sharedTracker] setResolveDeepLinkURLs:@[@"domain.com", @"subdomain.domain.com"]];
+ [[AppsFlyerLib shared] setResolveDeepLinkURLs:@[@"domain.com", @"subdomain.domain.com"]];
  
*/ @property(nonatomic, nullable) NSArray *resolveDeepLinkURLs; @@ -319,13 +335,13 @@ typedef enum { Objective-C:
- [[AppsFlyerTracker sharedTracker] oneLinkCustomDomains:@[@"domain.com", @"subdomain.domain.com"]];
+ [[AppsFlyerLib shared] oneLinkCustomDomains:@[@"domain.com", @"subdomain.domain.com"]];
  
*/ @property(nonatomic, nullable) NSArray *oneLinkCustomDomains; /* - * Set phone number for each `trackAppLaunch` event. `phoneNumber` will be sent as SHA256 string + * Set phone number for each `start` event. `phoneNumber` will be sent as SHA256 string */ @property(nonatomic, nullable) NSString *phoneNumber; @@ -335,7 +351,7 @@ typedef enum { To disable app's vendor identifier(IDFV), set disableIDFVCollection to true */ @property(nonatomic) BOOL disableIDFVCollection; - + /** Enable the collection of Facebook Deferred AppLinks Requires Facebook SDK and Facebook app on target/client device. @@ -344,13 +360,13 @@ typedef enum { Objective-C:
- [[AppsFlyerTracker sharedTracker] enableFacebookDeferredApplinksWithClass:[FBSDKAppLinkUtility class]]
+ [[AppsFlyerLib shared] enableFacebookDeferredApplinksWithClass:[FBSDKAppLinkUtility class]]
  
Swift:
- AppsFlyerTracker.shared().enableFacebookDeferredApplinks(with: FBSDKAppLinkUtility.self)
+ AppsFlyerLib.shared().enableFacebookDeferredApplinks(with: FBSDKAppLinkUtility.self)
  
@param facebookAppLinkUtilityClass requeries method call `[FBSDKAppLinkUtility class]` as param. @@ -366,33 +382,20 @@ typedef enum { - (void)setUserEmails:(NSArray * _Nullable)userEmails withCryptType:(EmailCryptType)type; /** - Track application launch(session). + Start SDK session Add the following method at the `applicationDidBecomeActive` in AppDelegate class */ -- (void)trackAppLaunch; +- (void)start; -- (void)trackAppLaunchWithCompletionHandler:(void (^ _Nullable)(NSDictionary * _Nullable dictionary, NSError * _Nullable error))completionHandler; +- (void)startWithCompletionHandler:(void (^ _Nullable)(NSDictionary * _Nullable dictionary, NSError * _Nullable error))completionHandler; /** - Use this method to track events in your app like purchases or user actions - - @param eventName Contains name of event that could be provided from predefined constants in `AppsFlyerTracker.h` - @param value Contains value for handling by backend - -
- [[AppsFlyer sharedTracker] trackEvent:AFEventPurchase withValue:"200"];
- 
- - */ -- (void)trackEvent:(NSString *)eventName withValue:(NSString * _Nullable)value __attribute__((deprecated)); - -/** - Use this method to track an events with mulitple values. See AppsFlyer's documentation for details. + Use this method to log an events with mulitple values. See AppsFlyer's documentation for details. Objective-C:
- [[AppsFlyerTracker sharedTracker] trackEvent:AFEventPurchase
+ [[AppsFlyerLib shared] logEvent:AFEventPurchase
         withValues: @{AFEventParamRevenue  : @200,
                       AFEventParamCurrency : @"USD",
                       AFEventParamQuantity : @2,
@@ -403,24 +406,24 @@ typedef enum  {
  Swift:
  
  
- AppsFlyerTracker.shared().trackEvent(AFEventPurchase,
+ AppsFlyerLib.shared().logEvent(AFEventPurchase,
         withValues: [AFEventParamRevenue  : "1200",
                      AFEventParamContent  : "shoes",
                      AFEventParamContentId: "123"])
  
- @param eventName Contains name of event that could be provided from predefined constants in `AppsFlyerTracker.h` + @param eventName Contains name of event that could be provided from predefined constants in `AppsFlyerLib.h` @param values Contains dictionary of values for handling by backend */ -- (void)trackEvent:(NSString *)eventName withValues:(NSDictionary * _Nullable)values; +- (void)logEvent:(NSString *)eventName withValues:(NSDictionary * _Nullable)values; -- (void)trackEventWithEventName:(NSString *)eventName - eventValues:(NSDictionary * _Nullable)eventValues - completionHandler:(void (^ _Nullable)(NSDictionary * _Nullable dictionary, NSError * _Nullable error))completionHandler -NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); +- (void)logEventWithEventName:(NSString *)eventName + eventValues:(NSDictionary * _Nullable)eventValues + completionHandler:(void (^ _Nullable)(NSDictionary * _Nullable dictionary, NSError * _Nullable error))completionHandler +NS_SWIFT_NAME(logEvent(name:values:completionHandler:)); /** - To track and validate in app purchases you can call this method from the completeTransaction: method on + To log and validate in app purchases you can call this method from the completeTransaction: method on your `SKPaymentTransactionObserver`. @param productIdentifier The product identifier @@ -431,25 +434,25 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); @param successBlock The success callback @param failedBlock The failure callback */ -- (void)validateAndTrackInAppPurchase:(NSString * _Nullable)productIdentifier - price:(NSString * _Nullable)price - currency:(NSString * _Nullable)currency - transactionId:(NSString * _Nullable)tranactionId - additionalParameters:(NSDictionary * _Nullable)params - success:(void (^ _Nullable)(NSDictionary * response))successBlock - failure:(void (^ _Nullable)(NSError * _Nullable error, id _Nullable reponse))failedBlock NS_AVAILABLE(10_7, 7_0); +- (void)validateAndLogInAppPurchase:(NSString * _Nullable)productIdentifier + price:(NSString * _Nullable)price + currency:(NSString * _Nullable)currency + transactionId:(NSString * _Nullable)tranactionId + additionalParameters:(NSDictionary * _Nullable)params + success:(void (^ _Nullable)(NSDictionary * response))successBlock + failure:(void (^ _Nullable)(NSError * _Nullable error, id _Nullable reponse))failedBlock NS_AVAILABLE(10_7, 7_0); /** - To Track location for geo-fencing. Does the same as code below. + To log location for geo-fencing. Does the same as code below.
- AppsFlyerTracker.shared().trackEvent(AFEventLocation, withValues: [AFEventParamLong:longitude, AFEventParamLat:latitude])
+ AppsFlyerLib.shared().logEvent(AFEventLocation, withValues: [AFEventParamLong:longitude, AFEventParamLat:latitude])
  
@param longitude The location longitude @param latitude The location latitude */ -- (void)trackLocation:(double)longitude latitude:(double)latitude; +- (void)logLocation:(double)longitude latitude:(double)latitude NS_SWIFT_NAME(logLocation(longitude:latitude:)); /** This method returns AppsFlyer's internal id(unique for your app) @@ -459,7 +462,7 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); - (NSString *)getAppsFlyerUID; /** - In case you want to track deep linking. Does the same as `-handleOpenURL:sourceApplication:withAnnotation`. + In case you want to log deep linking. Does the same as `-handleOpenURL:sourceApplication:withAnnotation`. @warning Prefered to use `-handleOpenURL:sourceApplication:withAnnotation`. @@ -469,7 +472,7 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); - (void)handleOpenURL:(NSURL * _Nullable)url sourceApplication:(NSString * _Nullable)sourceApplication API_UNAVAILABLE(macos); /** - In case you want to track deep linking. + In case you want to log deep linking. Call this method from inside your AppDelegate `-application:openURL:sourceApplication:annotation:` @param url The URL that was passed to your AppDelegate. @@ -492,7 +495,7 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); /** Allow AppsFlyer to handle restoration from an NSUserActivity. - Use this method to track deep links with OneLink. + Use this method to log deep links with OneLink. @param userActivity The NSUserActivity that caused the app to be opened. */ @@ -530,6 +533,15 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); */ - (void)remoteDebuggingCallWithData:(NSString *)data; +/** + Used to force the trigger `onAppOpenAttribution` delegate. + Notice, re-engagement, session and launch won't be counted. + Only for OneLink/UniversalLink/Deeplink resolving. + + @param URL The param to resolve into -[AppsFlyerLibDelegate onAppOpenAttribution:] + */ +- (void)performOnAppAttributionWithURL:(NSURL * _Nullable)URL; + /** @brief This property accepts a string value representing the host name for all endpoints. Can be used to Zero rate your application’s data usage. Contact your CSM for more information. @@ -539,13 +551,13 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); Objective-C:
- [[AppsFlyerTracker sharedTracker] setHost:@"example.com"];
+ [[AppsFlyerLib shared] setHost:@"example.com"];
  
Swift:
- AppsFlyerTracker.shared().host = "example.com"
+ AppsFlyerLib.shared().host = "example.com"
  
*/ @property(nonatomic, strong, readonly) NSString *host; @@ -572,13 +584,47 @@ NS_SWIFT_NAME(trackEvent(name:values:completionHandler:)); @warning This will disable all requests from AppsFlyer SDK. */ -@property(atomic) BOOL isStopTracking; +@property(atomic) BOOL isStopped; /** API to set manually Facebook deferred app link */ @property(nonatomic, nullable) NSURL *facebookDeferredAppLink; +/** + Block an events from being shared with ad networks and other 3rd party integrations + Must only include letters/digits or underscore, maximum length: 45 + */ +@property(nonatomic, nullable) NSArray *sharingFilter; + +@property(nonatomic) NSUInteger deepLinkTimeout; + +/** + Block an events from being shared with any partner + This method overwrite -[AppsFlyerLib setSharingFilter:] + */ +-(void)setSharingFilterForAllPartners; + +/** + Validate if URL contains certain string and append quiery + parameters to deeplink URL. In case if URL does not contain user-defined string, + parameters are not appended to the url. + + @param containsString string to check in URL. + @param parameters NSDictionary, which containins parameters to append to the deeplink url after it passed validation. + */ +- (void)appendParametersToDeepLinkingURLWithString:(NSString *)containsString + parameters:(NSDictionary *)parameters +NS_SWIFT_NAME(appendParametersToDeeplinkURL(contains:parameters:)); + +/** + Adds array of keys, which are used to compose key path + to resolve deeplink from push notification payload `userInfo`. + + @param deepLinkPath an array of strings which contains keys to search for deeplink in payload. + */ +- (void)addPushNotificationDeepLinkPath:(NSArray *)deepLinkPath; + @end NS_ASSUME_NONNULL_END diff --git a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerShareInviteHelper.h b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerShareInviteHelper.h index 6bc2533..715c14a 100644 --- a/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerShareInviteHelper.h +++ b/ios-framework/gdnative_ios/AppsFlyerLib.framework/Versions/A/Headers/AppsFlyerShareInviteHelper.h @@ -25,10 +25,10 @@ NS_ASSUME_NONNULL_BEGIN + (void)generateInviteUrlWithLinkGenerator:(AppsFlyerLinkGenerator *(^)(AppsFlyerLinkGenerator *generator))generatorCreator completionHandler:(void (^)(NSURL *_Nullable url))completionHandler; /** - * It is recommended to generate an in-app event after the invite is sent to track the invites from the senders' perspective. + * It is recommended to generate an in-app event after the invite is sent to log the invites from the senders' perspective. * This enables you to find the users that tend most to invite friends, and the media sources that get you these users. */ -+ (void)trackInvite:(nullable NSString *)channel parameters:(nullable NSDictionary *)parameters; ++ (void)logInvite:(nullable NSString *)channel parameters:(nullable NSDictionary *)parameters; @end diff --git a/ios-framework/gdnative_ios/src/AppsFlyer.mm b/ios-framework/gdnative_ios/src/AppsFlyer.mm index e577a02..d6d4712 100644 --- a/ios-framework/gdnative_ios/src/AppsFlyer.mm +++ b/ios-framework/gdnative_ios/src/AppsFlyer.mm @@ -7,7 +7,7 @@ #import #import "AppsFlyer.hpp" -#import +#import using namespace godot; @@ -63,14 +63,12 @@ NSString *strKey = [NSString stringWithUTF8String:key.utf8().get_data()]; NSString *strAppId = [NSString stringWithUTF8String:appId.utf8().get_data()]; - [AppsFlyerTracker sharedTracker].appsFlyerDevKey = strKey; - [AppsFlyerTracker sharedTracker].appleAppID = strAppId; - [AppsFlyerTracker sharedTracker].delegate = nil; + [AppsFlyerLib shared].appsFlyerDevKey = strKey; + [AppsFlyerLib shared].appleAppID = strAppId; + [AppsFlyerLib shared].delegate = nil; #ifdef DEBUG_ENABLED - [AppsFlyerTracker sharedTracker].isDebug = YES; + [AppsFlyerLib shared].isDebug = YES; #endif - - [[AppsFlyerTracker sharedTracker] trackAppLaunch]; } void AppsFlyer::trackEvent(const String event, const Dictionary params) @@ -78,18 +76,18 @@ NSString *eventName = [NSString stringWithUTF8String:event.utf8().get_data()]; NSDictionary *dict = convertFromDictionary(params); NSLog(@"Send AppsFlyer event: %@, %@", eventName, dict); - [[AppsFlyerTracker sharedTracker] trackEvent:eventName withValues: dict]; + [[AppsFlyerLib shared] logEvent:eventName withValues: dict]; } void AppsFlyer::setUninstallToken(const String token) { NSData *data = [NSData dataWithBytes:token.utf8().get_data() length:token.utf8().length()]; - [[AppsFlyerTracker sharedTracker] registerUninstall:data]; + [[AppsFlyerLib shared] registerUninstall:data]; } String AppsFlyer::appsFlyerId() { - NSString *appsflyerId = [AppsFlyerTracker sharedTracker].getAppsFlyerUID; + NSString *appsflyerId = [AppsFlyerLib shared].getAppsFlyerUID; String result([appsflyerId UTF8String]); return result; } diff --git a/nativelib-export/start_hook/appsflyer-plugin.gd b/nativelib-export/start_hook/appsflyer-plugin.gd new file mode 100644 index 0000000..7f543fd --- /dev/null +++ b/nativelib-export/start_hook/appsflyer-plugin.gd @@ -0,0 +1,8 @@ +extends Node + +static func process(features: PoolStringArray, debug: bool, path: String, flags: int) -> void: + if 'Android' in features: + pass + if 'iOS' in features: + add_ios_framework('AdSupport.framework') + add_ios_framework('iAd.framework') diff --git a/nativelib.json b/nativelib.json index e51d438..8014c68 100644 --- a/nativelib.json +++ b/nativelib.json @@ -1,13 +1,15 @@ { "name": "appsflyer", "description": "AppsFlyer plugin for Godot engine", - "version": "0.1.1", + "version": "0.2.0", "license": "MIT", "url": "https://github.com/DrMoriarty/godot-appsflyer.git", "dependencies": [ + "nativelib-export" ], "files": { - "scripts": "scripts" + "scripts": "scripts", + "nativelib-export": "addons/nativelib-export" }, "variables": { "AppsFlyer/DevKey": {