Skip to content

Commit

Permalink
Merge pull request #192 from AppsFlyerSDK/releases/6.x.x/6.4.x/6.4.4
Browse files Browse the repository at this point in the history
Releases/6.x.x/6.4.x/6.4.4
  • Loading branch information
pazlavi authored Dec 13, 2021
2 parents 6fe51d8 + 68a028f commit 7853fe0
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ You can read more [here](https://support.appsflyer.com/hc/en-us/articles/2070320

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

- iOS AppsFlyerSDK **v6.4.0**
- Android AppsFlyerSDK **v6.4.0**
- iOS AppsFlyerSDK **v6.4.4**
- Android AppsFlyerSDK **v6.4.3**

### <a id="breakingChanges"> ❗v6 Breaking Changes

Expand Down
10 changes: 10 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Release Notes
### 6.4.4
Release date: *2021-Dec-14*

**Overview and Highlights:**

- Cordova >> Android >> setUserEmails with no encryption available
- Cordova >> Add setPartnerData API
- Cordova >> Update iOS SDK to v6.4.4
- Cordova >> Update Android SDK to v6.4.3

### 6.4.0
Release date: *2021-Sep-14*

Expand Down
19 changes: 18 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ The list of available methods for this plugin is described below.
| [`disableSKAD`](#disableSKAD) | `(boolean disableSkad)` | disable or enable SKAD |
| [`setCurrentDeviceLanguage`](#setCurrentDeviceLanguage) | `(string language)` | Set the language of the device. |
| [`setAdditionalData`](#setAdditionalData) | `(Object additionalData)` | Allows you to add custom data to events sent from the SDK. |
| [`setPartnerData`](#setPartnerData) | `(partnerId, data)` | Allows sending custom data for partner integration purposes. |



---
Expand Down Expand Up @@ -680,7 +682,7 @@ appsFlyer.setCurrentDeviceLanguage('en');
| `language` | `string` | Set the language of the device. |

---
##### <a id="setAdditionalData"> **`setAdditionalData(language): void`**
##### <a id="setAdditionalData"> **`setAdditionalData(additionalData): void`**
The setAdditionalData API allows you to add custom data to events sent from the SDK.<br>
Typically it is used to integrate on the SDK level with several external partner platforms.

Expand All @@ -697,6 +699,21 @@ appsFlyer.setAdditionalData({"aa":"cc",
| ----------- |-----------------------------|--------------|
| `additionalData` | `Object` | Set the language of the device. |

---
##### <a id="setPartnerData"> **`setPartnerData(partnerId, data): void`**
Allows sending custom data for partner integration purposes.

*Example:*

```javascript
appsFlyer.setPartnerData("af_int", {apps: "Flyer", cuid: "123abc"});
```

| parameter | type | description |
| ----------- |-----------------------------|--------------|
| `partnerId` | `String` | ID of the partner (usually suffixed with "_int"). |
| `data` | `Object` | Customer data, depends on the integration configuration with the specific partner. |

---
### <a id="deep-linking-tracking"> Deep linking Tracking

Expand Down
20 changes: 10 additions & 10 deletions docs/Guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ window.plugins.appsFlyer.initSdk(options, onSuccess, onError);

## <a id="ios14"> Set plugin for IOS 14

1. Add ```#import <AppTrackingTransparency/AppTrackingTransparency.h>``` in your ```AppDelegate.m``` file<br>
2. Add the ATT pop-up for IDFA collection. your ```AppDelegate.m``` should look like this:
1. Add ```#import <AppTrackingTransparency/AppTrackingTransparency.h>``` in your ```Classes/MainViewController.m``` file<br>
2. Add the ATT pop-up for IDFA collection. your ```MainViewController.m``` should look like this:


```javascript
-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.viewController = [[MainViewController alloc] init];
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
//If you want to do something with the pop-up
}];
- (void)viewDidLoad {
[super viewDidLoad];
[self.launchView setAlpha:1];

if @available(iOS 14, *) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
NSLog(@"Status: %lu", (unsigned long)status);
}];
}
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-appsflyer-sdk",
"version": "6.4.0",
"version": "6.4.4",
"description": "Cordova AppsFlyer SDK Plugin",
"cordova": {
"id": "cordova-plugin-appsflyer-sdk",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<config>
</config>
<pods use-frameworks="true">
<pod name="AppsFlyerFramework" spec="6.4.0"/>
<pod name="AppsFlyerFramework" spec="6.4.4"/>
</pods>
</podspec>
</platform>
Expand Down
38 changes: 27 additions & 11 deletions src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public boolean execute(final String action, JSONArray args, CallbackContext call
return setDisableAdvertisingIdentifier(args, callbackContext);
} else if ("setAdditionalData".equals(action)) {
return setAdditionalData(args);
} else if ("setPartnerData".equals(action)) {
return setPartnerData(args);
}

return false;
Expand Down Expand Up @@ -995,18 +997,19 @@ private boolean enableFacebookDeferredApplinks(JSONArray args) {
* @return
*/
private boolean setUserEmails(JSONArray args, CallbackContext callbackContext) {
try {
String[] emails = convertToStringArray(args);
if (emails == null || emails.length == 0) {
callbackContext.error(FAILURE);
return true;
cordova.getThreadPool().execute(() -> {
try {
String[] emails = convertToStringArray(args);
if (emails == null || emails.length == 0) {
callbackContext.error(FAILURE);
return;
}
AppsFlyerLib.getInstance().setUserEmails(AppsFlyerProperties.EmailsCryptType.SHA256, emails);
callbackContext.success(SUCCESS);
} catch (Exception e) {
e.printStackTrace();
}
AppsFlyerLib.getInstance().setUserEmails(emails);
callbackContext.success(SUCCESS);
} catch (Exception e) {
e.printStackTrace();
}

});
return true;
}

Expand Down Expand Up @@ -1091,6 +1094,19 @@ private boolean setAdditionalData(JSONArray args) {
return true;
}

private boolean setPartnerData(JSONArray args) {
cordova.getThreadPool().execute(() -> {
try {
String partnerId = args.getString(0);
Map<String, Object> data = toObjectMap(args.getJSONObject(1));
AppsFlyerLib.getInstance().setPartnerData(partnerId, data);
} catch (JSONException e) {
e.printStackTrace();
}
});
return true;
}

/**
* takes string representation of a string array and converts it to an array. use this method because old version of cordova cannot pass an array to native.
* newer versions can, but can break flow to older users
Expand Down
2 changes: 1 addition & 1 deletion src/android/cordovaAF.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ repositories {

dependencies {
implementation 'com.android.installreferrer:installreferrer:2.1'
implementation 'com.appsflyer:af-android-sdk:6.4.0@aar'
implementation 'com.appsflyer:af-android-sdk:6.4.3@aar'
implementation 'com.android.support:support-annotations:28.0.0'
}
6 changes: 6 additions & 0 deletions src/ios/AppsFlyerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -861,4 +861,10 @@ - (void)setAdditionalData:(CDVInvokedUrlCommand*)command{
[[AppsFlyerLib shared] setAdditionalData:additionalData];
}

- (void)setPartnerData:(CDVInvokedUrlCommand*)command{
NSString *partnerId = (NSString*)[command.arguments objectAtIndex: 0];
NSDictionary *data = (NSDictionary*)[command.arguments objectAtIndex: 1];
[[AppsFlyerLib shared] setPartnerDataWithPartnerId:partnerId partnerInfo:data];
}

@end
9 changes: 9 additions & 0 deletions www/appsflyer.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,16 @@ if (!window.CustomEvent) {
*/
AppsFlyer.prototype.setAdditionalData = function (additionalData){
exec(null, null, 'AppsFlyerPlugin', 'setAdditionalData', [additionalData]);
};

/**
* The setPartnerData API allows sending custom data for partner integration purposes.
* Typically it is used to integrate on the SDK level with several external partner platforms
* @param partnerId - ID of the partner (usually suffixed with "_int")
* @param data - Customer data, depends on the integration configuration with the specific partner
*/
AppsFlyer.prototype.setPartnerData = function (partnerId, data){
exec(null, null, 'AppsFlyerPlugin', 'setPartnerData', [partnerId, data]);
};

module.exports = new AppsFlyer();
Expand Down

0 comments on commit 7853fe0

Please sign in to comment.