Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 30 additions & 1 deletion Assets/AppsFlyer/AppsFlyer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AppsFlyerSDK
public class AppsFlyer : MonoBehaviour
{

public static readonly string kAppsFlyerPluginVersion = "5.4.1";
public static readonly string kAppsFlyerPluginVersion = "5.4.2";


/// <summary>
Expand Down Expand Up @@ -362,6 +362,35 @@ public static void setPhoneNumber(string phoneNumber)
AppsFlyerAndroid.setPhoneNumber(phoneNumber);
#else

#endif
}

/// <summary>
/// Used by advertisers to exclude all networks/integrated partners from getting data.
/// </summary>
public static void setSharingFilterForAllPartners()
{
#if UNITY_IOS && !UNITY_EDITOR
AppsFlyeriOS.setSharingFilterForAllPartners();
#elif UNITY_ANDROID && !UNITY_EDITOR
AppsFlyerAndroid.setSharingFilterForAllPartners();
#else

#endif
}

/// <summary>
/// Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data.
/// </summary>
/// <param name="partners">partners to exclude from getting data</param>
public static void setSharingFilter(params string[] partners)
{
#if UNITY_IOS && !UNITY_EDITOR
AppsFlyeriOS.setSharingFilter(partners);
#elif UNITY_ANDROID && !UNITY_EDITOR
AppsFlyerAndroid.setSharingFilter(partners);
#else

#endif
}

Expand Down
21 changes: 21 additions & 0 deletions Assets/AppsFlyer/AppsFlyerAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,27 @@ public static string getHostPrefix()
#endif
}

/// <summary>
/// Used by advertisers to exclude all networks/integrated partners from getting data.
/// </summary>
public static void setSharingFilterForAllPartners()
{
#if !UNITY_EDITOR
appsFlyerAndroid.CallStatic("setSharingFilterForAllPartners");
#endif
}

/// <summary>
/// Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data.
/// </summary>
/// <param name="partners">partners to exclude from getting data</param>
public static void setSharingFilter(params string[] partners)
{
#if !UNITY_EDITOR
appsFlyerAndroid.CallStatic("setSharingFilter", (object)partners);
#endif
}

/// <summary>
/// Register a Conversion Data Listener.
/// Allows the developer to access the user attribution data in real-time for every new install, directly from the SDK level.
Expand Down
27 changes: 27 additions & 0 deletions Assets/AppsFlyer/AppsFlyeriOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,27 @@ public static void handleOpenUrl(string url, string sourceApplication, string an
#endif
}

/// <summary>
/// Used by advertisers to exclude all networks/integrated partners from getting data.
/// </summary>
public static void setSharingFilterForAllPartners()
{
#if !UNITY_EDITOR
_setSharingFilterForAllPartners();
#endif
}

/// <summary>
/// Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data.
/// </summary>
/// <param name="partners">partners to exclude from getting data</param>
public static void setSharingFilter(params string[] partners)
{
#if !UNITY_EDITOR
_setSharingFilter(partners.Length, partners);
#endif
}

/// <summary>
/// To record an impression use the following API call.
/// Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
Expand Down Expand Up @@ -539,6 +560,12 @@ public static void recordInvite(string channel, Dictionary<string, string> param
[DllImport("__Internal")]
private static extern void _handleOpenUrl(string url, string sourceApplication, string annotation);

[DllImport("__Internal")]
private static extern void _setSharingFilterForAllPartners();

[DllImport("__Internal")]
private static extern void _setSharingFilter(int length, params string[] partners);

[DllImport("__Internal")]
private static extern void _recordCrossPromoteImpression(string appID, string campaign, string parameters);

Expand Down
2 changes: 1 addition & 1 deletion Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<androidPackages>
<androidPackage spec="com.appsflyer:af-android-sdk:5.4.1">
</androidPackage>
<androidPackage spec="com.appsflyer:unity-wrapper:5.4.1">
<androidPackage spec="com.appsflyer:unity-wrapper:5.4.2">
</androidPackage>
<androidPackage spec="com.android.installreferrer:installreferrer:1.1.2">
</androidPackage>
Expand Down
12 changes: 11 additions & 1 deletion Assets/AppsFlyer/Plugins/iOS/AppsFlyeriOSWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ const void _setUserEmails (int emailCryptTypeInt , int length, const char **user
const void _setPhoneNumber (const char* phoneNumber) {
[[AppsFlyerTracker sharedTracker] setPhoneNumber:stringFromChar(phoneNumber)];
}

const void _setSharingFilterForAllPartners () {
[[AppsFlyerTracker sharedTracker] setSharingFilterForAllPartners];
}

const void _setSharingFilter (int length, const char **partners) {
if(length > 0 && partners) {
[[AppsFlyerTracker sharedTracker] setSharingFilter:NSArrayFromCArray(length, partners)];
}
}

const void _validateAndSendInAppPurchase (const char* productIdentifier, const char* price, const char* currency, const char* tranactionId, const char* additionalParameters, const char* objectName) {

Expand All @@ -179,7 +189,7 @@ const void _validateAndSendInAppPurchase (const char* productIdentifier, const c
transactionId:stringFromChar(tranactionId)
additionalParameters:dictionaryFromJson(additionalParameters)
success:^(NSDictionary *result){
unityCallBack(stringFromChar(objectName), VALIDATE_CALLBACK, stringFromdictionary(result));
unityCallBack(validateObjectName, VALIDATE_CALLBACK, stringFromdictionary(result));
} failure:^(NSError *error, id response) {
unityCallBack(validateObjectName, VALIDATE_ERROR_CALLBACK, error ? [[error localizedDescription] UTF8String] : "error");
}];
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Versions

## 5.4.2

RD-43178 - added setSharingFilterForAllPartners() api
RD-43178 - added setSharingFilter(params string[] partners) api
RD-42761 - fix validateAndSendInAppPurchase callback on iOS

## 5.4.1

RD-40404 - add additional params for recordCrossPromoteImpression api (ios & android)
Expand Down
4 changes: 2 additions & 2 deletions android-unity-wrapper/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android.enableJetifier=true

GROUP=com.appsflyer

VERSION_CODE=4
VERSION_NAME=5.4.1
VERSION_CODE=5
VERSION_NAME=5.4.2

POM_ARTIFACT_ID=unity-wrapper
POM_PACKAGING=aar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void initSDK(String devKey, String objectName) {
}

AppsFlyerLib.getInstance().init(devKey, conversionListener, UnityPlayer.currentActivity);
AppsFlyerLib.getInstance().setExtension("unity_android_5.4.1");
AppsFlyerLib.getInstance().setExtension("unity_android_5.4.2");
}

public static void startTracking() {
Expand Down Expand Up @@ -198,6 +198,14 @@ public static void setCollectOaid(boolean isCollect) {
AppsFlyerLib.getInstance().setCollectOaid(isCollect);
}

public static void setSharingFilterForAllPartners() {
AppsFlyerLib.getInstance().setSharingFilterForAllPartners();
}

public static void setSharingFilter(String ... partners) {
AppsFlyerLib.getInstance().setSharingFilter(partners);
}

public static void getConversionData(final String objectName){
if (conversionListener == null){
conversionListener = getConversionListener(objectName);
Expand Down
Binary file removed appsflyer-unity-plugin-5.4.1.unitypackage
Binary file not shown.
Binary file added appsflyer-unity-plugin-5.4.2.unitypackage
Binary file not shown.
4 changes: 2 additions & 2 deletions deploy/build_unity_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Start Build for appsflyer-unity-plugin.unitypackage"

DEPLOY_PATH=outputs
UNITY_PATH="/Applications/Unity/Unity.app/Contents/MacOS/Unity"
PACKAGE_NAME="appsflyer-unity-plugin-5.4.1.unitypackage"
PACKAGE_NAME="appsflyer-unity-plugin-5.4.2.unitypackage"
mkdir -p $DEPLOY_PATH


Expand All @@ -20,7 +20,7 @@ mkdir -p $DEPLOY_PATH
Assets \
$PWD/$DEPLOY_PATH/$PACKAGE_NAME \
-quit \
&& echo "package exported successfully to outputs/appsflyer-unity-plugin-5.4.1.unitypackage" \
&& echo "package exported successfully to outputs/appsflyer-unity-plugin-5.4.2.unitypackage" \
|| echo "Failed to export package. See create_unity_core.log for more info."


Expand Down
33 changes: 33 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The list of available methods for this plugin is described below.
- [attributeAndOpenStore](#attributeAndOpenStore)
- [recordCrossPromoteImpression](#recordCrossPromoteImpression)
- [generateUserInviteLink](#generateUserInviteLink)
- [setSharingFilterForAllPartners](#setSharingFilterForAllPartners)
- [setSharingFilter](#setSharingFilter)
- [Android Only API](#androidOnly)
- [updateServerUninstallToken](#updateServerUninstallToken)
- [setImeiData](#setImeiData)
Expand Down Expand Up @@ -522,6 +524,37 @@ AppsFlyer.generateUserInviteLink(params, this);

---

##### <a id="setSharingFilterForAllPartners"> **`void setSharingFilterForAllPartners()`**

Used by advertisers to exclude all networks/integrated partners from getting data.

*Example:*

```c#
AppsFlyer.setSharingFilterForAllPartners();
```

---

##### <a id="setSharingFilter"> **`void setSharingFilter(params string[] partners)`**


Used by advertisers to set some (one or more) networks/integrated partners to exclude from getting data.


| parameter | type | description |
| ----------- |----------------------------- |-----------------------------------------------------|
| `partners` | `params string[] partners` | partners to exclude from getting data |


*Example:*

```c#
AppsFlyer.setSharingFilter("googleadwords_int","snapchat_int","doubleclick_int");
```

---

## <a id="androidOnly"> Android Only API

##### <a id="updateServerUninstallToken"> **`void updateServerUninstallToken(string token)`**
Expand Down