Skip to content

Commit d7af3bd

Browse files
committed
Added sharing filter support & upgraded unity version to 2022.3.21f1
1 parent 1296238 commit d7af3bd

9 files changed

Lines changed: 305 additions & 97 deletions

File tree

Assets/AppsflyerModule.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
public class AppsflyerModule
1515
{
16-
private bool isSandbox { get; }
1716
private string devkey { get; }
1817
private string appid { get; }
18+
private bool isSandbox { get; }
19+
private List<string> sharingFilter { get; set; }
1920
private int af_counter { get; set; }
2021
private string af_device_id { get; }
2122
private string cuid { get; set; }
@@ -28,6 +29,7 @@ public AppsflyerModule(string devkey, string appid, MonoBehaviour mono, bool isS
2829
this.devkey = devkey;
2930
this.appid = appid;
3031
this.mono = mono;
32+
this.sharingFilter = null;
3133
this.isStopped = true;
3234

3335
this.af_counter = PlayerPrefs.GetInt("af_counter");
@@ -63,7 +65,8 @@ private RequestData CreateRequestData()
6365
device_ids = deviceids,
6466
request_id = GenerateGuid(),
6567
limit_ad_tracking = false,
66-
customer_user_id = cuid
68+
customer_user_id = cuid,
69+
sharing_filter = this.sharingFilter
6770

6871
};
6972
return req;
@@ -174,6 +177,16 @@ public void SetCustomerUserId(string cuid)
174177
this.cuid = cuid;
175178
}
176179

180+
public void SetSharingFilterForPartners(List<string> sharingFilter) {
181+
this.sharingFilter = sharingFilter;
182+
Debug.Log("Sharing filter for partners has been set");
183+
}
184+
185+
public void SetSharingFilter(List<string> sharingFilter)
186+
{
187+
this.sharingFilter = sharingFilter;
188+
}
189+
177190
// send post request with Unity HTTP Client
178191
private IEnumerator SendUnityPostReq(RequestData req, AppsflyerRequestType REQ_TYPE)
179192
{
@@ -183,7 +196,7 @@ private IEnumerator SendUnityPostReq(RequestData req, AppsflyerRequestType REQ_T
183196
Newtonsoft.Json.Formatting.None,
184197
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }
185198
);
186-
// Debug.Log(json);
199+
Debug.Log(json);
187200

188201
// create auth token
189202
string auth = HmacSha256Digest(json, devkey);
@@ -329,6 +342,7 @@ class RequestData
329342
public string request_id;
330343
public bool limit_ad_tracking;
331344
public string customer_user_id;
345+
public List<string> sharing_filter;
332346
public string event_name;
333347
public Dictionary<string, object> event_parameters;
334348
public Dictionary<string, object> event_custom_parameters;

Assets/AppsflyerScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class AppsflyerScript : MonoBehaviour
99
public string DEV_KEY;
1010
public string APP_ID;
1111
public bool IS_SANDBOX;
12+
public List<string> SHARING_FILTER = null;
1213

1314
void Start()
1415
{
@@ -17,6 +18,11 @@ void Start()
1718

1819
// set CUID
1920
afm.SetCustomerUserId("testTEST12345");
21+
22+
// set the sharing filter, for this example:
23+
// SHARING_FILTER = new List<string>() {"partner1_int", "partner2_int"};
24+
afm.SetSharingFilterForPartners(SHARING_FILTER);
25+
2026
// start the SDK (send firstopen/session request)
2127
afm.Start();
2228

Assets/Scenes/SampleScene.unity

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ NavMeshSettings:
104104
serializedVersion: 2
105105
m_ObjectHideFlags: 0
106106
m_BuildSettings:
107-
serializedVersion: 2
107+
serializedVersion: 3
108108
agentTypeID: 0
109109
agentRadius: 0.5
110110
agentHeight: 2
@@ -117,7 +117,7 @@ NavMeshSettings:
117117
cellSize: 0.16666667
118118
manualTileSize: 0
119119
tileSize: 256
120-
accuratePlacement: 0
120+
buildHeightMesh: 0
121121
maxJobWorkers: 0
122122
preserveTilesOutsideBounds: 0
123123
debug:
@@ -155,20 +155,23 @@ MonoBehaviour:
155155
DEV_KEY:
156156
APP_ID:
157157
IS_SANDBOX: 0
158+
SHARING_FILTER:
159+
- partner1_int
160+
- partner2_int
158161
--- !u!4 &425522096
159162
Transform:
160163
m_ObjectHideFlags: 0
161164
m_CorrespondingSourceObject: {fileID: 0}
162165
m_PrefabInstance: {fileID: 0}
163166
m_PrefabAsset: {fileID: 0}
164167
m_GameObject: {fileID: 425522093}
168+
serializedVersion: 2
165169
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
166170
m_LocalPosition: {x: 0, y: 0, z: 0}
167171
m_LocalScale: {x: 1, y: 1, z: 1}
168172
m_ConstrainProportionsScale: 0
169173
m_Children: []
170174
m_Father: {fileID: 0}
171-
m_RootOrder: 1
172175
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
173176
--- !u!1 &519420028
174177
GameObject:
@@ -210,9 +213,17 @@ Camera:
210213
m_projectionMatrixMode: 1
211214
m_GateFitMode: 2
212215
m_FOVAxisMode: 0
216+
m_Iso: 200
217+
m_ShutterSpeed: 0.005
218+
m_Aperture: 16
219+
m_FocusDistance: 10
220+
m_FocalLength: 50
221+
m_BladeCount: 5
222+
m_Curvature: {x: 2, y: 11}
223+
m_BarrelClipping: 0.25
224+
m_Anamorphism: 0
213225
m_SensorSize: {x: 36, y: 24}
214226
m_LensShift: {x: 0, y: 0}
215-
m_FocalLength: 50
216227
m_NormalizedViewPortRect:
217228
serializedVersion: 2
218229
x: 0
@@ -246,11 +257,17 @@ Transform:
246257
m_PrefabInstance: {fileID: 0}
247258
m_PrefabAsset: {fileID: 0}
248259
m_GameObject: {fileID: 519420028}
260+
serializedVersion: 2
249261
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
250262
m_LocalPosition: {x: 0, y: 0, z: -10}
251263
m_LocalScale: {x: 1, y: 1, z: 1}
252264
m_ConstrainProportionsScale: 0
253265
m_Children: []
254266
m_Father: {fileID: 0}
255-
m_RootOrder: 0
256267
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
268+
--- !u!1660057539 &9223372036854775807
269+
SceneRoots:
270+
m_ObjectHideFlags: 0
271+
m_Roots:
272+
- {fileID: 519420032}
273+
- {fileID: 425522096}

Packages/manifest.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"dependencies": {
3-
"com.unity.collab-proxy": "1.17.7",
4-
"com.unity.feature.2d": "1.0.0",
5-
"com.unity.ide.rider": "3.0.16",
6-
"com.unity.ide.visualstudio": "2.0.16",
3+
"com.unity.ai.navigation": "1.1.5",
4+
"com.unity.collab-proxy": "2.2.0",
5+
"com.unity.feature.2d": "2.0.0",
6+
"com.unity.ide.rider": "3.0.27",
7+
"com.unity.ide.visualstudio": "2.0.22",
78
"com.unity.ide.vscode": "1.2.5",
8-
"com.unity.test-framework": "1.1.31",
9+
"com.unity.nuget.newtonsoft-json": "3.2.1",
10+
"com.unity.test-framework": "1.1.33",
911
"com.unity.textmeshpro": "3.0.6",
10-
"com.unity.timeline": "1.6.4",
12+
"com.unity.timeline": "1.7.6",
1113
"com.unity.ugui": "1.0.0",
12-
"com.unity.visualscripting": "1.7.8",
14+
"com.unity.visualscripting": "1.9.1",
1315
"com.unity.modules.ai": "1.0.0",
1416
"com.unity.modules.androidjni": "1.0.0",
1517
"com.unity.modules.animation": "1.0.0",

0 commit comments

Comments
 (0)