Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases/6.x.x/6.15.x/6.15.1 rc4 #259

Merged
merged 55 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7191a6c
Merge branch 'master' into development
noa-kogonia May 1, 2024
a69c72f
add some attempt of adding the adrevenue api
noa-kogonia Aug 12, 2024
b55d63b
update plugin.xml and package.json files
pazlavi Aug 12, 2024
2ac18d4
rm constructor - move the validation to native part, add enum class
noa-kogonia Aug 14, 2024
d90f279
Merge branch 'releases/6.x.x/6.15.x/6.15.0-rc1' of https://github.com…
noa-kogonia Aug 14, 2024
9c1e406
add adrevenue api
noa-kogonia Aug 14, 2024
c6757b1
add the enum correctly
noa-kogonia Aug 20, 2024
d142abc
change the way we compare
noa-kogonia Aug 20, 2024
4eeaf15
fix comparision
noa-kogonia Aug 20, 2024
923c27f
change ios to 6.15.1
noa-kogonia Aug 20, 2024
6707bdc
change incorrect variable type
noa-kogonia Aug 20, 2024
60f54d5
update the code in ios
noa-kogonia Aug 20, 2024
3147be6
update the api validations
noa-kogonia Aug 20, 2024
8822691
add more checks
noa-kogonia Aug 20, 2024
afd1051
dummy push
noa-kogonia Aug 22, 2024
01fc71c
update plugin.xml and package.json files
pazlavi Aug 22, 2024
04aea75
dummy
noa-kogonia Aug 29, 2024
c510779
update plugin.xml and package.json files
pazlavi Aug 29, 2024
1531af3
dummy
noa-kogonia Aug 29, 2024
19d6d74
Merge branch 'releases/6.x.x/6.15.x/6.15.1-rc1' of https://github.com…
noa-kogonia Aug 29, 2024
990f1fe
dummy
noa-kogonia Aug 29, 2024
7baac1b
dummy p
noa-kogonia Aug 29, 2024
c98e8b1
p
noa-kogonia Aug 29, 2024
2bfce31
update plugin.xml and package.json files
pazlavi Aug 29, 2024
d6b5587
Merge 2bfce31b776d09ecb6b04905aa0e50fad8010408 into 5167dd368f36e7d04…
noa-kogonia Aug 29, 2024
e625900
6.15.1
pazlavi Aug 29, 2024
99a0cb3
Update RELEASENOTES.md
pazlavi Aug 29, 2024
835ce1b
add nsnull default val
noa-kogonia Aug 29, 2024
d1f3c08
update plugin.xml and package.json files
pazlavi Aug 29, 2024
a026e6c
add more nil check
noa-kogonia Aug 29, 2024
b66a067
Merge branch 'releases/6.x.x/6.15.x/6.15.1-rc2' of https://github.com…
noa-kogonia Aug 29, 2024
403b5b6
apply code review changes
noa-kogonia Aug 29, 2024
7635fc1
change the impl
noa-kogonia Sep 1, 2024
3f93af7
change impl for additional params map ios
noa-kogonia Sep 2, 2024
a369e73
update plugin.xml and package.json files
pazlavi Sep 2, 2024
6b017a3
add nslog fot invalid args
noa-kogonia Sep 2, 2024
044d893
Merge branch 'releases/6.x.x/6.15.x/6.15.1-rc3' of https://github.com…
noa-kogonia Sep 2, 2024
3d65f6e
Merge 044d893791889529f59538eba17300a7f7bbbaf7 into 5167dd368f36e7d04…
noa-kogonia Sep 2, 2024
51a2379
6.15.1
pazlavi Sep 2, 2024
381f720
Update RELEASENOTES.md
pazlavi Sep 2, 2024
0afc51d
add documentation
noa-kogonia Sep 2, 2024
0e70db2
Merge branch 'releases/6.x.x/6.15.x/6.15.1-rc3' of https://github.com…
noa-kogonia Sep 2, 2024
2c11ddd
add more documentation
noa-kogonia Sep 2, 2024
e595438
rm dup
noa-kogonia Sep 2, 2024
46823ca
add more logs
noa-kogonia Sep 2, 2024
9b21a5d
update plugin.xml and package.json files
pazlavi Sep 2, 2024
ebb8b05
typo
noa-kogonia Sep 2, 2024
8f95054
Merge branch 'releases/6.x.x/6.15.x/6.15.1-rc3' of https://github.com…
noa-kogonia Sep 2, 2024
5f5fe4d
fix for ci
noa-kogonia Sep 2, 2024
c41417a
update plugin.xml and package.json files
pazlavi Sep 2, 2024
63db06c
fix for ci
noa-kogonia Sep 2, 2024
5aff575
update plugin.xml and package.json files
pazlavi Sep 2, 2024
ed369f8
Merge 5aff575ee6b35bf4265308d647105fe1f2275586 into 5167dd368f36e7d04…
noa-kogonia Sep 2, 2024
06079d7
6.15.1
pazlavi Sep 2, 2024
af330b1
Update RELEASENOTES.md
pazlavi Sep 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ For lower versions of cordova-android please use plugin version 4.3.3 available
- From version **6.1.10** the plugin uses cocoapods(NOT StaticLib) in order to support iOS app-kids Strict mode. <br>
You can read more [here](https://support.appsflyer.com/hc/en-us/articles/207032066#integration-strict-mode-sdk)
- From version **6.10.2** the plugin requires using the implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.20' in Android.
- From version **6.14.3** the plugin requires Target version 12 and higher in iOS.
- From version **6.15.1** the plugin requires adding the value '/usr/lib/swift' to Build Settings 'RunPath Search Paths' key in iOS.
----------


Expand All @@ -42,8 +44,13 @@ 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.14.3**
- Android AppsFlyerSDK **v6.14.0**
- iOS AppsFlyerSDK **v6.15.1**
- Android AppsFlyerSDK **v6.15.0**

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

iOS platform:
The plugin requires adding the value '/usr/lib/swift' to Build Settings 'RunPath Search Paths' key in iOS, Otherwise there might be some compilation errors.

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

Expand Down
10 changes: 10 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 6.15.1
Release date: *2024-09-02*

- Cordova >> Update Plugin to v6.15.1

## 6.15.1
Release date: *2024-09-02*

- Cordova >> Update Plugin to v6.15.1

## 6.14.3
Release date: *2024-04-30*

Expand Down
44 changes: 43 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ The list of available methods for this plugin is described below.
| [`sendPushNotificationData`](#sendPushNotificationData) | `(Object data)` | Measure and get data from push-notification campaigns. |
| [`setDisableNetworkData`](#setDisableNetworkData) | `(boolean disable)` | Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device. |
| [`setConsentData`](#setConsentData) | `(boolean disable)` | Use to manually collecting the consent data from the user. |
| [`enableTCFDataCollection`](#enableTCFDataCollection) | `(boolean enable)` | instruct the SDK to collect the TCF data from the device. |
| [`enableTCFDataCollection`](#enableTCFDataCollection) | `(boolean enable)` | instruct the SDK to collect the TCF data from the device. |
| [`logAdRevenue`](#logAdRevenue) | `(Object adRevenueData, Object additionalParams)` | Log ad revenue event. |


---
Expand Down Expand Up @@ -799,6 +800,47 @@ window.plugins.appsFlyer.enableTCFDataCollection(true);
```

---

##### <a id="logAdRevenue"> **`logAdRevenue(adRevenueData, additionalParams): void`**
log ad-revenue event.

| parameter | type | description |
|------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `adRevenueData` | `Object` | the object must contain the following fields:<br/>monetizationNetwork: String testMonetizationNetwork<br/> mediationNetwork: MediationNetwork testMediationNetwork<br/>currencyIso4217Code: String currencyByIso4217CodeFormat <br/>revenue:double revenue |
| `additionalData` | `Object` | additional Params Data map, @Nullable |


*Example:*

```javascript

let mediationNetwork = MediationNetwork.TOPON;
let adRevenueData = {
'monetizationNetwork': 'testMonetizationNetwork',
'mediationNetwork': mediationNetwork,
'currencyIso4217Code': 'USD',
'revenue': 15.0
};
let additionalParams = {
'additionalKey1':'additionalValue1',
'additionalKey2':'additionalValue2'
}
window.plugins.appsFlyer.logAdRevenue(adRevenueData, additionalParams);


```
Here's how you use `appsFlyer.logAdRevenue` within a Cordova app:

1. Prepare the `adRevenueData` object as shown, including any additional parameters you wish to track along with the ad revenue event.
2. Call the `appsFlyer.logAdRevenue` method with the `adRevenueData` object.

By passing all the required fields in `AFAdRevenueData`, you help ensure accurate tracking within the AppsFlyer platform. This enables you to analyze your ad revenue alongside other user acquisition data to optimize your app's overall monetization strategy.

**Note:**
The `additionalParameters` object is optional. You can add any additional data you want to log with the ad revenue event in this object. This can be useful for detailed analytics or specific event tracking later on. Make sure that the custom parameters follow the data types and structures specified by AppsFlyer in their documentation.
---


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


Expand Down
54 changes: 53 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,104 @@
{

"name": "cordova-plugin-appsflyer-sdk",
"version": "6.14.3",

"version": "6.15.1",

"description": "Cordova AppsFlyer SDK Plugin",

"cordova": {

"id": "cordova-plugin-appsflyer-sdk",

"platforms": [

"android",

"ios"

]

},

"repository": {

"type": "git",

"url": "git+https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk.git"

},

"keywords": [

"cordova",

"appsflyer",

"ecosystem:cordova",

"cordova-android",

"cordova-ios"

],

"engines": [

{

"name": "cordova",

"version": ">=4.3.0"

}

],

"author": "Appsflyer",

"license": {

"type": "MIT",

"url": "https://github.com/AppsFlyerSDK/appsflyer-cordova-plugin/blob/master/LICENSE"

},

"bugs": {

"url": "https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk/issues"

},

"homepage": "https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk#readme",

"scripts": {

"test": "npm run jshint",

"jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests",

"setupIonicCordova": "cd examples/ionic-cordova; npm install; ionic cordova plugin rm cordova-plugin-appsflyer-sdk --save; ionic cordova platform rm android; ionic cordova platform rm ios; ionic cordova plugin add cordova-plugin-appsflyer-sdk --save; ionic cordova platform add android; ionic cordova platform add ios",

"runIonicCordovaIos": "cd examples/ionic-cordova; ionic cordova prepare ios; ionic cordova run ios;",

"runIonicCordovaAndroid": "cd examples/ionic-cordova; ionic cordova prepare android; ionic cordova run android;",

"setupCordova": "cd examples/cordova; npm install; cordova plugin rm cordova-plugin-appsflyer-sdk --save; cordova platform rm android; cordova platform rm ios; cordova plugin add cordova-plugin-appsflyer-sdk --save; cordova platform add android; cordova platform add ios",

"runCordovaIos": "cd examples/cordova; cordova prepare ios; cordova run ios;",

"runCordovaAndroid": "cd examples/cordova; cordova prepare android; cordova run android;"

},

"devDependencies": {

"jshint": "^2.6.0"

},

"dependencies": {}

}

3 changes: 1 addition & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@
<config>
</config>
<pods use-frameworks="true">
<pod name="AppsFlyerFramework" spec="6.14.3"/>
<pod name="AppsFlyerFramework" spec="6.15.1"/>
</pods>
</podspec>
</platform>


</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class AppsFlyerConstants {

final static String PLUGIN_VERSION = "6.14.0";
final static String PLUGIN_VERSION = "6.15.1";
final static String NO_DEVKEY_FOUND = "AppsFlyer 'devKey' is missing or empty";
final static String NO_GCM_PROJECT_NUMBER_PROVIDED = "No GCM Project number provided";
final static String SUCCESS = "Success";
Expand Down
50 changes: 50 additions & 0 deletions src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
import com.appsflyer.internal.platform_extension.Plugin;
import com.appsflyer.internal.platform_extension.PluginInfo;
import com.appsflyer.AppsFlyerConsent;
import com.appsflyer.MediationNetwork;
import com.appsflyer.AFAdRevenueData;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
Expand Down Expand Up @@ -176,10 +178,58 @@ public boolean execute(final String action, JSONArray args, CallbackContext call
return setConsentData(args);
} else if ("enableTCFDataCollection".equals(action)) {
return enableTCFDataCollection(args);
} else if ("logAdRevenue".equals(action)) {
return logAdRevenue(args);
}
return false;
}

/**
* log AdRevenue event
*
* @param args - event params
* @return true
*/
private boolean logAdRevenue(JSONArray args) {
cordova.getThreadPool().execute(() -> {
Map<String, Object> additionalParameters = null;
try {
if(!args.get(0).equals(null)){
JSONObject afAdRevenueDataJsonObj = args.getJSONObject(0);
String monetizationNetwork = afAdRevenueDataJsonObj.optString("monetizationNetwork", null);
String mediationNetwork = afAdRevenueDataJsonObj.optString("mediationNetwork", null);
String currencyIso4217Code = afAdRevenueDataJsonObj.optString("currencyIso4217Code", null);
double revenue = afAdRevenueDataJsonObj.optDouble("revenue", -1);
MediationNetwork mediationNetworkEnumVal = null;

if(mediationNetwork != null){
for(MediationNetwork mediationNetworkEnum: MediationNetwork.values()){
if(mediationNetworkEnum.getValue().equals(mediationNetwork)){
mediationNetworkEnumVal = mediationNetworkEnum;
continue;
}
}
}

if(!args.get(1).equals(null)){
JSONObject additionalParametersJson = args.getJSONObject(1);
additionalParameters = toObjectMap(additionalParametersJson);
}
if(mediationNetworkEnumVal != null){
AFAdRevenueData afAdRevenueData = new AFAdRevenueData(monetizationNetwork, mediationNetworkEnumVal, currencyIso4217Code, revenue);
AppsFlyerLib.getInstance().logAdRevenue(afAdRevenueData, additionalParameters);
}
else{
Log.d("AppsFlyer", "Could not log Ad-Revenue event, bad inputs");
}
}
} catch (JSONException e) {
e.printStackTrace();
}
});
return true;
}

/**
* set consent data according to GDPR if applies or not.
*
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,7 +4,7 @@ repositories {

dependencies {
implementation 'com.android.installreferrer:installreferrer:2.1'
implementation 'com.appsflyer:af-android-sdk:6.14.0@aar'
implementation 'com.appsflyer:af-android-sdk:6.15.0@aar'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.20'
}
1 change: 1 addition & 0 deletions src/ios/AppsFlyerPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- (void)setCurrentDeviceLanguage:(CDVInvokedUrlCommand*)command;
- (void)setAdditionalData:(CDVInvokedUrlCommand*)command;
- (void)setConsentData:(CDVInvokedUrlCommand*)command;
- (void)logAdRevenue:(CDVInvokedUrlCommand*)command;
- (void)enableTCFDataCollection:(CDVInvokedUrlCommand*)command;
- (void)setSharingFilter:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
- (void)setSharingFilterForAllPartners:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
Expand Down
Loading
Loading