Skip to content

Commit

Permalink
6.1.0
Browse files Browse the repository at this point in the history
6.1.0
  • Loading branch information
amit-kremer93 committed Nov 17, 2020
2 parents fcb1fe9 + b52d139 commit 3dcb54c
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Versions
## 6.1.0
- iOS SDK 6.1.0
- Android SDK 6.1.0

## 6.0.50
- iOS SDK 6.0.5
- Android SDK 5.4.4
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

### <a id="plugin-build-for"> This plugin is built for

- iOS AppsFlyerSDK **v6.0.5**
- Android AppsFlyerSDK **v5.4.4**
- iOS AppsFlyerSDK **v6.1.0**
- Android AppsFlyerSDK **v6.1.0**

## <a id="v6-breaking-changes"> ❗ v6 Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ repositories {
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.1')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '5.4.4')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.1.0')}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ private String callSdkInternal(ReadableMap _options) {

if (currentActivity != null) {
// register for lifecycle with Activity (automatically fetching deeplink from Activity if present)
instance.startTracking(currentActivity, devKey);
instance.start(currentActivity, devKey);
} else {
// register for lifecycle with Application (cannot fetch deeplink without access to the Activity,
// also sending first session manually)
instance.trackAppLaunch(application, devKey);
instance.startTracking(application, devKey);
instance.start(application, devKey);
}
return null;
}
Expand Down Expand Up @@ -232,7 +231,7 @@ private String logEventInternal(final String eventName, ReadableMap eventData) {
Activity currentActivity = getCurrentActivity();

if (currentActivity != null) {
AppsFlyerLib.getInstance().trackEvent(currentActivity.getBaseContext(), eventName, data);
AppsFlyerLib.getInstance().logEvent(currentActivity.getBaseContext(), eventName, data);
}

return null;
Expand Down Expand Up @@ -314,7 +313,7 @@ public void setCollectAndroidID(boolean isCollect, Callback callback) {

@ReactMethod
public void stop(boolean isStopped, Callback callback) {
AppsFlyerLib.getInstance().stopTracking(isStopped, getReactApplicationContext());
AppsFlyerLib.getInstance().stop(isStopped, getReactApplicationContext());
callback.invoke(SUCCESS);
}

Expand Down Expand Up @@ -477,9 +476,9 @@ public void logCrossPromotionImpression(final String appId, final String campaig
Map<String, Object> temp = RNUtil.toMap(params);
Map<String, String> data = null;
data = (Map) temp;
CrossPromotionHelper.trackCrossPromoteImpression(getReactApplicationContext(), appId, campaign, data);
CrossPromotionHelper.logCrossPromoteImpression(getReactApplicationContext(), appId, campaign, data);
} catch (Exception e) {
CrossPromotionHelper.trackCrossPromoteImpression(getReactApplicationContext(), appId, campaign);
CrossPromotionHelper.logCrossPromoteImpression(getReactApplicationContext(), appId, campaign);
}
}

Expand All @@ -491,12 +490,12 @@ public void logCrossPromotionAndOpenStore(final String appId, final String campa
data = (Map) temp;
} catch (Exception e) {
}
CrossPromotionHelper.trackAndOpenStore(getReactApplicationContext(), appId, campaign, data);
CrossPromotionHelper.logAndOpenStore(getReactApplicationContext(), appId, campaign, data);
}

@ReactMethod
public void anonymizeUser(boolean b, Callback callback) {
AppsFlyerLib.getInstance().setDeviceTrackingDisabled(b);
AppsFlyerLib.getInstance().anonymizeUser(b);
callback.invoke(SUCCESS);
}

Expand Down Expand Up @@ -576,7 +575,7 @@ public void setSharingFilter(ReadableArray partnersArray, Callback successCallba

@ReactMethod
public void logLocation(double longitude, double latitude, Callback successCallback) {
AppsFlyerLib.getInstance().trackLocation(getReactApplicationContext(), latitude, longitude);
AppsFlyerLib.getInstance().logLocation(getReactApplicationContext(), latitude, longitude);
successCallback.invoke(SUCCESS);
}

Expand Down Expand Up @@ -614,7 +613,7 @@ public void validateAndLogInAppPurchase(ReadableMap purchaseInfo, Callback succe
return;
}
initInAppPurchaseValidatorListener(successCallback, errorCallback);
AppsFlyerLib.getInstance().validateAndTrackInAppPurchase(reactContext, publicKey, signature, purchaseData, price, currency, additionalParameters);
AppsFlyerLib.getInstance().validateAndLogInAppPurchase(reactContext, publicKey, signature, purchaseData, price, currency, additionalParameters);

}

Expand Down
36 changes: 36 additions & 0 deletions ios/AppsFlyerDeepLink.h
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
29 changes: 29 additions & 0 deletions ios/AppsFlyerDeepLinkResult.h
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
31 changes: 29 additions & 2 deletions ios/AppsFlyerLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
// AppsFlyerLib.h
// AppsFlyerLib
//
// AppsFlyer iOS SDK 6.0.5 (195)
// AppsFlyer iOS SDK 6.1.0 (23)
// Copyright (c) 2012-2020 AppsFlyer Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>

#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"
Expand Down Expand Up @@ -140,6 +143,14 @@ typedef enum {
EmailCryptTypeSHA256 = 3
} EmailCryptType;

NS_SWIFT_NAME(DeepLinkDelegate)
@protocol AppsFlyerDeepLinkDelegate <NSObject>

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

@end

/**
Conform and subscribe to this protocol to allow getting data about conversion and
install attribution
Expand Down Expand Up @@ -289,6 +300,8 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));
*/
@property(weak, nonatomic) id<AppsFlyerLibDelegate> delegate;

@property(weak, nonatomic) id<AppsFlyerDeepLinkDelegate> deepLinkDelegate;

/**
In app purchase receipt validation Apple environment(production or sandbox). The default value is NO
*/
Expand Down Expand Up @@ -579,12 +592,26 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
*/
@property(nonatomic, nullable) NSArray<NSString *> *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<NSString *, NSString*> *)parameters
NS_SWIFT_NAME(appendParametersToDeeplinkURL(contains:parameters:));

@end

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-appsflyer",
"version": "6.0.50",
"version": "6.1.0",
"description": "React Native Appsflyer plugin",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion react-native-appsflyer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.source_files = 'ios/**/*.{h,m}'
s.platform = :ios, "8.0"
s.static_framework = true
s.dependency 'AppsFlyerFramework', '~> 6.0.5'
s.dependency 'AppsFlyerFramework', ' 6.1.0'
s.dependency 'React'
end

0 comments on commit 3dcb54c

Please sign in to comment.