Skip to content

Commit

Permalink
Merge pull request #180 from AppsFlyerSDK/releases/6.0.30
Browse files Browse the repository at this point in the history
6.0.30
  • Loading branch information
sokoloff06 committed Sep 7, 2020
2 parents 1d97fc8 + e2af6d8 commit 947e72f
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 62 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Versions

## 6.0.30

- iOS SDK 6.0.3

_init options properties renamed:_

| Old API | New API |
| ------------------------------|-----------------------------------|
| timeToWaitForAdvertiserID | timeToWaitForATTUserAuthorization |

## 6.0.20

- iOS SDK 6.0.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

- iOS AppsFlyerSDK **v6.0.2**
- iOS AppsFlyerSDK **v6.0.3**
- Android AppsFlyerSDK **v5.4.3**

## <a id="v6-breaking-changes"> ❗ v6 Breaking Changes
Expand All @@ -33,7 +33,7 @@ We have renamed the following APIs:
| trackLocation | logLocation |
| stopTracking | stop |
| trackCrossPromotionImpression | logCrossPromotionImpression |
| trackAndOpenStore | logCrossPromotionAndOpenStore |
| trackAndOpenStore | logCrossPromotionAndOpenStore |
| setDeviceTrackingDisabled | anonymizeUser |

And removed the following ones:
Expand Down
7 changes: 5 additions & 2 deletions SampleApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,19 @@ var onInstallConversionDataCanceller = appsFlyer.onInstallConversionData(
var onAppOpenAttributionCanceller = appsFlyer.onAppOpenAttribution((res) => {
console.log(res);
});

appsFlyer.setCustomerUserId("testID");
appsFlyer.initSdk(
{
isDebug: true,
devKey: '4UGrDF4vFvPLbHq5bXtCza',
appId: '753258300',
timeToWaitForAdvertiserID: 60,
timeToWaitForATTUserAuthorization: 60,
},
(result) => {
console.log('initSdk: ' + result);
if (Platform.OS === 'android') {
appsFlyer.setCollectAndroidID(true)
}
},
(error) => {
console.error('initSdk: ' + error);
Expand Down
10 changes: 5 additions & 5 deletions SampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- AppsFlyerFramework (6.0.2)
- AppsFlyerFramework (6.0.3)
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.4)
- CocoaLibEvent (1.0.0)
Expand Down Expand Up @@ -237,8 +237,8 @@ PODS:
- React-cxxreact (= 0.63.2)
- React-jsi (= 0.63.2)
- React-jsinspector (0.63.2)
- react-native-appsflyer (6.0.20):
- AppsFlyerFramework (~> 6.0.2)
- react-native-appsflyer (6.0.30):
- AppsFlyerFramework (~> 6.0.3)
- React
- React-RCTActionSheet (0.63.2):
- React-Core/RCTActionSheetHeaders (= 0.63.2)
Expand Down Expand Up @@ -427,7 +427,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
AppsFlyerFramework: 9e0cd7b807ccd375a87bef34fd50049f4c655eef
AppsFlyerFramework: 89ae0155d63b1890676ed22cf8a0752b9f22c9e6
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
Expand All @@ -454,7 +454,7 @@ SPEC CHECKSUMS:
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
react-native-appsflyer: cd59d41093d264f5e54dc431632e910ece6595c0
react-native-appsflyer: 8c3ddae37f526ae860d5cf6fc95207dc51f9d6a6
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"dependencies": {
"react": "16.13.1",
"react-native": "^0.63.2",
"react-native-appsflyer": "^6.0.20"
"react-native-appsflyer": "AppsFlyerSDK/appsflyer-react-native-plugin.git#releases/6.0.30"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -296,31 +296,41 @@ public void getAppsFlyerUID(Callback callback) {
@ReactMethod
public void updateServerUninstallToken(final String token, Callback callback) {
AppsFlyerLib.getInstance().updateServerUninstallToken(getReactApplicationContext(), token);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
public void setCustomerUserId(final String userId, Callback callback) {
AppsFlyerLib.getInstance().setCustomerUserId(userId);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
public void setCollectIMEI(boolean isCollect, Callback callback) {
AppsFlyerLib.getInstance().setCollectIMEI(isCollect);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
public void setCollectAndroidID(boolean isCollect, Callback callback) {
AppsFlyerLib.getInstance().setCollectAndroidID(isCollect);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

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

@ReactMethod
Expand All @@ -334,7 +344,9 @@ public void setAdditionalData(ReadableMap additionalData, Callback callback) {

HashMap<String, Object> copyData = new HashMap<>(data);
AppsFlyerLib.getInstance().setAdditionalData(copyData);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}


Expand Down Expand Up @@ -384,7 +396,9 @@ public void setAppInviteOneLinkID(final String oneLinkID, Callback callback) {
return;
}
AppsFlyerLib.getInstance().setAppInviteOneLink(oneLinkID);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
Expand All @@ -393,7 +407,9 @@ public void setCurrencyCode(final String currencyCode, Callback callback) {
return;
}
AppsFlyerLib.getInstance().setCurrencyCode(currencyCode);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
Expand Down Expand Up @@ -514,7 +530,9 @@ public void logCrossPromotionAndOpenStore(final String appId, final String campa
@ReactMethod
public void anonymizeUser(boolean b, Callback callback){
AppsFlyerLib.getInstance().setDeviceTrackingDisabled(b);
callback.invoke(SUCCESS);
if (callback != null) {
callback.invoke(SUCCESS);
}
}

@ReactMethod
Expand Down Expand Up @@ -552,15 +570,15 @@ public void setResolveDeepLinkURLs(ReadableArray urlsArray, Callback successCall
}

@ReactMethod
public void performOnAppAttribution(String urlString, Callback callback) {
public void performOnAppAttribution(String urlString, Callback successCallback, Callback errorCallback) {
try {
URI uri = URI.create(urlString);
Context c = application.getApplicationContext();
AppsFlyerLib.getInstance().performOnAppAttribution(c, uri);
callback.invoke(SUCCESS);
successCallback.invoke(SUCCESS);
} catch (Exception e) {
e.printStackTrace();
callback.invoke(INVALID_URI);
errorCallback.invoke(INVALID_URI);
}
}

Expand Down Expand Up @@ -589,6 +607,8 @@ public void setSharingFilter(ReadableArray partnersArray, Callback successCallba
@ReactMethod
public void logLocation(double longitude, double latitude, Callback successCallback) {
AppsFlyerLib.getInstance().trackLocation(getReactApplicationContext(), latitude, longitude);
successCallback.invoke(SUCCESS, longitude, latitude);
if (successCallback != null) {
successCallback.invoke(SUCCESS);
}
}
}
22 changes: 10 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,19 @@ declare module "react-native-appsflyer" {

export enum AF_EMAIL_CRYPT_TYPE {
NONE,
SHA1,
MD5,
SHA256
}

export interface InitSDKOptions {
devKey:string;
appId?:string; // iOS only
isDebug?:boolean;
timeToWaitForAdvertiserID?:number; // iOS only
timeToWaitForATTUserAuthorization?:number; // iOS only
}

export interface SetEmailsOptions {
emails?:string[];
emailsCryptType:AF_EMAIL_CRYPT_TYPE | 0 | 1 | 2 | 3;
emailsCryptType:AF_EMAIL_CRYPT_TYPE | 0 | 3;
}

export interface GenerateInviteLinkParams {
Expand All @@ -54,23 +52,23 @@ declare module "react-native-appsflyer" {

initSdk(options: InitSDKOptions, successC?: SuccessCB, errorC?: ErrorCB): Response<string>
logEvent(eventName: string, eventValues: object, successC?: SuccessCB, errorC?: ErrorCB): Response<string>
setUserEmails(options: SetEmailsOptions, successC?: SuccessCB, errorC?: ErrorCB): void
setUserEmails(options: SetEmailsOptions, successC: SuccessCB, errorC: ErrorCB): void
setAdditionalData(additionalData: object, successC?: SuccessCB): void
getAppsFlyerUID(callback: (error: Error, uid: string) => any): void
setCustomerUserId(userId: string, successC?: SuccessCB): void
stop(isStopped: boolean, successC?: SuccessCB): void
setAppInviteOneLinkID(oneLinkID: string, successC?: SuccessCB): void
generateInviteLink(params: GenerateInviteLinkParams, successC?: SuccessCB, errorC?: ErrorCB): void
generateInviteLink(params: GenerateInviteLinkParams, successC: SuccessCB, errorC: ErrorCB): void
logCrossPromotionImpression(appId: string, campaign: string, parameters: object): void
logCrossPromotionAndOpenStore(appId: string, campaign: string, params: object): void
setCurrencyCode(currencyCode: string, successC: SuccessCB): void
anonymizeUser(shouldAnonymize: boolean, successC: SuccessCB): void
setOneLinkCustomDomains(domains: string[], successC?: SuccessCB, errorC?: ErrorCB): void
setResolveDeepLinkURLs(urls: string[], successC?: SuccessCB, errorC?: ErrorCB): void
performOnAppAttribution(urlString, callback): void
setCurrencyCode(currencyCode: string, successC?: SuccessCB): void
anonymizeUser(shouldAnonymize: boolean, successC?: SuccessCB): void
setOneLinkCustomDomains(domains: string[], successC: SuccessCB, errorC: ErrorCB): void
setResolveDeepLinkURLs(urls: string[], successC: SuccessCB, errorC: ErrorCB): void
performOnAppAttribution(urlString, successC: SuccessCB, errorC: ErrorCB): void
setSharingFilterForAllPartners(): void
setSharingFilter(partners, successC, errorC): void
logLocation(longitude: number, latitude: number, callback: SuccessCB): void
logLocation(longitude: number, latitude: number, successC?: SuccessCB): void

/**
* For iOS Only
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ appsFlyer.setResolveDeepLinkURLs = (urls, successC, errorC) => {
* @param urlString String representing the URL that needs to be resolved/returned in the onAppOpenAttribution callback
* @param callback Result callback
*/
appsFlyer.performOnAppAttribution = (urlString, callback) => {
return RNAppsFlyer.performOnAppAttribution(urlString, callback);
appsFlyer.performOnAppAttribution = (urlString, successC, errorC) => {
return RNAppsFlyer.performOnAppAttribution(urlString, successC, errorC);
}

/**
Expand Down
8 changes: 6 additions & 2 deletions ios/AppsFlyerLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AppsFlyerLib.h
// AppsFlyerLib
//
// AppsFlyer iOS SDK 6.0.2 (179)
// AppsFlyer iOS SDK 6.0.3 (182)
// Copyright (c) 2012-2020 AppsFlyer Ltd. All rights reserved.
//

Expand Down Expand Up @@ -232,7 +232,11 @@ typedef enum {

@property(nonatomic, strong, readonly) NSString *advertisingIdentifier;

- (void)waitForAdvertisingIdentifierWithTimeoutInterval:(NSTimeInterval)timeoutInterval;
/**
Waits for request user authorization to access app-related data
*/
- (void)waitForATTUserAuthorizationWithTimeoutInterval:(NSTimeInterval)timeoutInterval
NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));

@property(nonatomic) BOOL disableSKAdNetwork;

Expand Down
9 changes: 5 additions & 4 deletions ios/RNAppsFlyer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ static NSString *const NO_APPID_FOUND = @"No 'appId' found or its
static NSString *const NO_EVENT_NAME_FOUND = @"No 'eventName' found or its empty";
static NSString *const EMPTY_OR_CORRUPTED_LIST = @"No arguments found or list is corrupted";
static NSString *const SUCCESS = @"Success";
static NSString *const INVALID_URI = @"Invalid URI";
static NSString *const IOS_14_ONLY = @"Feature only supported on iOS 14 and above";

// Appsflyer JS objects
#define afDevKey @"devKey"
#define afAppId @"appId"
#define afIsDebug @"isDebug"
#define timeToWaitForAdvertiserID @"timeToWaitForAdvertiserID"
#define afDevKey @"devKey"
#define afAppId @"appId"
#define afIsDebug @"isDebug"
#define timeToWaitForATTUserAuthorization @"timeToWaitForATTUserAuthorization"

#define afEmailsCryptType @"emailsCryptType"
#define afEmails @"emails"
Expand Down
Loading

0 comments on commit 947e72f

Please sign in to comment.