com.amanotes.gdk 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/Packages/AmaGDKConfig.unitypackage +0 -0
  3. package/Packages/AmaGDKExample.unitypackage +0 -0
  4. package/Packages/AmaGDKTest.unitypackage +0 -0
  5. package/Packages/AppsFlyerAdapter_v6.5.4.unitypackage +0 -0
  6. package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
  7. package/Packages/FirebaseRemoteConfigAdapter_v9.1.0.unitypackage +0 -0
  8. package/{Samples~/Example/AmaGDKExample.unity.meta → Packages/FirebaseRemoteConfigAdapter_v9.1.0.unitypackage.meta} +1 -1
  9. package/Packages/IronsourceAdapter_v7.2.6.unitypackage +0 -0
  10. package/Runtime/AmaGDK.Adapters.cs +19 -0
  11. package/Runtime/AmaGDK.Ads.cs +2 -16
  12. package/Runtime/AmaGDK.Internal.cs +1 -1
  13. package/Runtime/AmaGDK.RemoteConfig.cs +343 -0
  14. package/Runtime/{AmaPassport/AmaGDK.AmaPassport.cs.meta → AmaGDK.RemoteConfig.cs.meta} +1 -1
  15. package/Runtime/AmaGDK.Utils.cs +42 -13
  16. package/Runtime/AmaGDK.WebUtils.cs +6 -9
  17. package/Runtime/AmaGDK.cs +5 -3
  18. package/package.json +1 -1
  19. package/Packages/AppsflyerAdapter_v6.5.4.unitypackage +0 -0
  20. package/Runtime/AmaPassport/AmaGDK.AmaPassport.cs +0 -444
  21. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdCallback.java +0 -7
  22. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdCallback.java.meta +0 -32
  23. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdFetcher.cs +0 -96
  24. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdFetcher.cs.meta +0 -11
  25. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdFetcher.java +0 -79
  26. package/Runtime/AmaPassport/Plugins/Android/AdvertisingIdFetcher.java.meta +0 -32
  27. package/Runtime/AmaPassport/Plugins/Android.meta +0 -8
  28. package/Runtime/AmaPassport/Plugins/iOS/KeyChain.cs +0 -59
  29. package/Runtime/AmaPassport/Plugins/iOS/KeyChain.cs.meta +0 -11
  30. package/Runtime/AmaPassport/Plugins/iOS/KeyChainPlugin.mm +0 -52
  31. package/Runtime/AmaPassport/Plugins/iOS/KeyChainPlugin.mm.meta +0 -33
  32. package/Runtime/AmaPassport/Plugins/iOS/UICKeyChainStore.h +0 -281
  33. package/Runtime/AmaPassport/Plugins/iOS/UICKeyChainStore.h.meta +0 -33
  34. package/Runtime/AmaPassport/Plugins/iOS/UICKeyChainStore.m +0 -1393
  35. package/Runtime/AmaPassport/Plugins/iOS/UICKeyChainStore.m.meta +0 -33
  36. package/Runtime/AmaPassport/Plugins/iOS.meta +0 -8
  37. package/Runtime/AmaPassport/Plugins.meta +0 -8
  38. package/Runtime/AmaPassport.meta +0 -8
  39. package/Samples~/Example/AmaGDKExample.cs +0 -87
  40. package/Samples~/Example/AmaGDKExample.cs.meta +0 -11
  41. package/Samples~/Example/AmaGDKExample.unity +0 -3114
  42. package/Sample~/Example/AmaGDKExample.cs +0 -87
  43. package/Sample~/Example/AmaGDKExample.cs.meta +0 -11
  44. package/Sample~/Example/AmaGDKExample.unity +0 -3114
  45. package/Sample~/Example/AmaGDKExample.unity.meta +0 -7
  46. /package/Packages/{AppsflyerAdapter_v6.5.4.unitypackage.meta → AppsFlyerAdapter_v6.5.4.unitypackage.meta} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.21 - 2023-05-22]
4
+ ### Add Remote Config module + Firebase Remote Config adapter
5
+ ### Rearrange adapters
6
+ ### Add "enableAnalyticsCollection" to Firebase Analytics config
7
+ ### Fix AmaGDK to compatible with Unity 2019
8
+
3
9
  ## [0.1.20 - 2023-04-20]
4
10
  ### Refactor Adapter architure to support reading adapter config from Core
5
11
  ### Add session stat for Analytics module
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 10026e46727964068991024d2146c0c7
2
+ guid: c4acdfbf7c40646b6b8d379d00b3df5d
3
3
  DefaultImporter:
4
4
  externalObjects: {}
5
5
  userData:
@@ -86,6 +86,25 @@ namespace Amanotes.Core.Internal
86
86
  return result;
87
87
  }
88
88
 
89
+ public static T GetSingleAdapter<T>() where T: class
90
+ {
91
+ var adapters = Adapter.FindAll<T>();
92
+
93
+ if (adapters == null || adapters.Count < 1)
94
+ {
95
+ LogError($"Not found adapter for <{nameof(T)}>!");
96
+ return null;
97
+ }
98
+
99
+ if (adapters.Count > 1)
100
+ {
101
+ LogError($"Multiple adapters detected. <{nameof(T)}> supports only one adapter!");
102
+ return null;
103
+ }
104
+
105
+ return adapters[0].GetAdapterApi<T>();
106
+ }
107
+
89
108
  public static T GetConfig<T>() where T : ConfigAsset
90
109
  {
91
110
  return (T)AmaGDK.Config;
@@ -63,22 +63,8 @@ namespace Amanotes.Core
63
63
  public static Action<string> OnRewardedVideoFailCallback;
64
64
 
65
65
  public static void Init()
66
- {
67
- var adsModules = Adapter.FindAll<IAds>();
68
-
69
- if (adsModules == null || adsModules.Count < 1)
70
- {
71
- LogError("Ads module not found!");
72
- return;
73
- }
74
-
75
- if (adsModules.Count > 1)
76
- {
77
- LogError("Multiple Ads modules is not supported!");
78
- return;
79
- }
80
-
81
- adsModule = adsModules[0].GetAdapterApi<IAds>();
66
+ {
67
+ adsModule =Adapter.GetSingleAdapter<IAds>();
82
68
  }
83
69
 
84
70
  public static void RequestBanner(BannerPosition position)
@@ -44,6 +44,7 @@ namespace Amanotes.Core.Internal
44
44
  "FirebaseAnalyticsAdapter_v9.1.0",
45
45
  "AppsFlyerAdapter_v6.5.4",
46
46
  // "IronsourceAdapter_v7.2.6",
47
+ "FirebaseRemoteConfigAdapter_v9.1.0"
47
48
  };
48
49
 
49
50
  #if UNITY_EDITOR
@@ -67,7 +68,6 @@ namespace Amanotes.Core.Internal
67
68
  #endif
68
69
  }
69
70
 
70
-
71
71
  public static class Logging
72
72
  {
73
73
  public static readonly StringBuilder tmpWarningSB = new StringBuilder();
@@ -0,0 +1,343 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.IO;
4
+ using System.Text;
5
+ using UnityEngine;
6
+
7
+ using Amanotes.Core.Internal;
8
+ using static Amanotes.Core.Internal.Logging;
9
+
10
+ namespace Amanotes.Core
11
+ {
12
+ public partial class AmaGDK //Remote Config
13
+ {
14
+ public enum RemoteConfigSource
15
+ {
16
+ DefaultAsset,
17
+ DefaultFile,
18
+ Cache,
19
+ Internet
20
+ }
21
+
22
+ [Serializable]
23
+ public partial class RemoteConfig //Public
24
+ {
25
+ public static Dictionary<string, string> DictConfig { get { return dictConfig; } }
26
+ public static RemoteConfigSource Source { private set; get; }
27
+ static bool? _cacheExisted = null;
28
+ public static bool HasCache {
29
+ get
30
+ {
31
+ if (_cacheExisted == null)
32
+ _cacheExisted = FileUtils.Exist(fileName);
33
+ return _cacheExisted.GetValueOrDefault();
34
+ }
35
+ }
36
+
37
+ public static T ParseConfig<T>(T config = null) where T : class, new()
38
+ {
39
+ if (config == null)
40
+ config = new T();
41
+
42
+ var configInJson = GetConfigAsJson();
43
+ if (string.IsNullOrEmpty(configInJson))
44
+ {
45
+ LogWarning("[RemoteConfig] The config is empty");
46
+ return config;
47
+ }
48
+
49
+ try
50
+ {
51
+ return config = JsonUtility.FromJson<T>(configInJson);
52
+ }
53
+ catch (Exception e)
54
+ {
55
+ LogError("[RemoteConfig] Cannot parse remote config file. Error: " + e.Message);
56
+ return config;
57
+ }
58
+ }
59
+
60
+ public static T Get<T>(string key, T defaultValue = default(T))
61
+ {
62
+ if (dictConfig.ContainsKey(key))
63
+ return (T)Convert.ChangeType(dictConfig[key], typeof(T));
64
+ return defaultValue;
65
+ }
66
+
67
+ public static string GetConfigAsJson()
68
+ {
69
+ return JsonUtils.DictionaryToJson(dictConfig);
70
+ }
71
+ }
72
+
73
+ public partial class RemoteConfig //Internal
74
+ {
75
+ internal enum FetchState
76
+ {
77
+ None,
78
+ ResolveDependencies,
79
+ CheckInternet,
80
+ Fetch,
81
+ SaveCache,
82
+
83
+ LoadCache,
84
+ LoadDefaultFile,
85
+ LoadDefaultAsset,
86
+
87
+ Success,
88
+ Fail
89
+ }
90
+
91
+ static Dictionary<string, string> dictConfig = new Dictionary<string, string>();
92
+ static string fileName = $"{nameof(RemoteConfig)}.kv";
93
+ static string defaultConfigFileName = "remote_config_defaults";
94
+
95
+ static FetchState _state = FetchState.None;
96
+ internal static FetchState State { get { return _state; } }
97
+ static readonly Dictionary<FetchState, Action[]> fetchSM = new Dictionary<FetchState, Action[]>
98
+ {
99
+ { FetchState.None, new Action[]{ ResolveDependency }},
100
+ { FetchState.ResolveDependencies, new Action[]{ LoadCache, CheckInternet}},
101
+ { FetchState.CheckInternet, new Action[]{ LoadCache, Fetch}},
102
+ { FetchState.Fetch, new Action[]{ LoadCache, SaveCache}},
103
+ { FetchState.SaveCache, new Action[]{ SetDone }},
104
+ { FetchState.LoadCache, new Action[]{ LoadDefaultFile, SetDone}},
105
+ { FetchState.LoadDefaultFile, new Action[]{ LoadDefaultAsset, SetDone}},
106
+ { FetchState.LoadDefaultAsset, new Action[]{ SetFail, SetDone}}
107
+ };
108
+
109
+ internal static IRemoteConfig adapter;
110
+ internal static Action<bool> onAdapterInitCompleteCallback;
111
+
112
+ internal static void NextState(bool result = true)
113
+ {
114
+ if (!fetchSM.TryGetValue(_state, out var actions))
115
+ {
116
+ LogWarning("[RemoteConfig] Invalid / Unsupported state: " + _state);
117
+ return;
118
+ }
119
+
120
+ if (actions.Length == 1)
121
+ {
122
+ actions[0]();
123
+ return;
124
+ }
125
+
126
+ actions[result ? 1 : 0]();
127
+ }
128
+
129
+ static void ResolveDependency()
130
+ {
131
+ _state = FetchState.ResolveDependencies;
132
+ adapter = Adapter.GetSingleAdapter<IRemoteConfig>();
133
+ if (adapter == null)
134
+ {
135
+ NextState(false);
136
+ return;
137
+ }
138
+ adapter.ResolveDependencies(NextState);
139
+ }
140
+
141
+ static void CheckInternet()
142
+ {
143
+ _state = FetchState.CheckInternet;
144
+ NextState(Application.internetReachability != NetworkReachability.NotReachable);
145
+ }
146
+
147
+ static void Fetch()
148
+ {
149
+ _state = FetchState.Fetch;
150
+ adapter.FetchConfig(HasCache, (isSuccess, result) =>
151
+ {
152
+ if (!isSuccess)
153
+ {
154
+ NextState(false);
155
+ return;
156
+ }
157
+
158
+ dictConfig = result;
159
+ Source = RemoteConfigSource.Internet;
160
+ Log("[RemoteConfig] Load from the internet");
161
+ NextState(true);
162
+ });
163
+ }
164
+
165
+ static void SaveCache()
166
+ {
167
+ _state = FetchState.SaveCache;
168
+ StringBuilder sb = new StringBuilder();
169
+ foreach (var c in dictConfig)
170
+ {
171
+ sb.AppendLine($"{c.Key}\t{c.Value}");
172
+ }
173
+
174
+ var filePath = FileUtils.GetPath(fileName);
175
+ FileUtils.Save(filePath, sb.ToString());
176
+ Log($"[RemoteConfig] Saved remote config to {filePath}");
177
+ NextState();
178
+ }
179
+
180
+ static void LoadCache()
181
+ {
182
+ _state = FetchState.LoadCache;
183
+
184
+ if (!HasCache)
185
+ {
186
+ NextState(false);
187
+ return;
188
+ }
189
+
190
+ try
191
+ {
192
+ dictConfig.Clear();
193
+ using (StreamReader sr = new StreamReader(FileUtils.GetPath(fileName)))
194
+ {
195
+ string line;
196
+ int lineIdx = 0;
197
+ while ((line = sr.ReadLine()) != null)
198
+ {
199
+ lineIdx++;
200
+ var idx = line.IndexOf('\t');
201
+ if (idx == -1)
202
+ {
203
+ LogWarning($"[RemoteConfig] Cannot get (key, value) at line {lineIdx} of cache");
204
+ continue;
205
+ }
206
+ string key = line.Substring(0, idx);
207
+ string value = line.Substring(idx + 1);
208
+ dictConfig.Add(key, value);
209
+ }
210
+ }
211
+ Source = RemoteConfigSource.Cache;
212
+ Log("[RemoteConfig] Load from cache");
213
+ }
214
+ catch (Exception ex)
215
+ {
216
+ LogWarning($"[RemoteConfig] Error on LoadCache: {ex.Message}");
217
+ _cacheExisted = false;
218
+ NextState(false);
219
+ return;
220
+ }
221
+
222
+ NextState(true);
223
+ }
224
+
225
+ static void LoadDefaultFile()
226
+ {
227
+ _state = FetchState.LoadDefaultFile;
228
+
229
+ var defaultConfigFile = Resources.Load<TextAsset>(defaultConfigFileName);
230
+ if (defaultConfigFile == null)
231
+ {
232
+ NextState(false);
233
+ return;
234
+ }
235
+
236
+ dictConfig = JsonToDictionary(defaultConfigFile.text);
237
+
238
+ Source = RemoteConfigSource.DefaultFile;
239
+ Log("[RemoteConfig] Load from default file");
240
+ NextState(true);
241
+ }
242
+
243
+ static void LoadDefaultAsset()
244
+ {
245
+ _state = FetchState.LoadDefaultAsset;
246
+
247
+ var defaultValue = ((AdapterContext)adapter).GetAdapterConfig<RemoteConfigConfig>().defaultValue;
248
+
249
+ if (defaultValue.Length == 0)
250
+ {
251
+ NextState(false);
252
+ return;
253
+ }
254
+
255
+ foreach (var item in defaultValue)
256
+ {
257
+ dictConfig.Add(item.key, item.value);
258
+ }
259
+ Source = RemoteConfigSource.DefaultAsset;
260
+ Log("[RemoteConfig] Load from default asset");
261
+ NextState(true);
262
+ }
263
+
264
+ static void SetDone()
265
+ {
266
+ _state = FetchState.Success;
267
+ onAdapterInitCompleteCallback(true);
268
+ }
269
+
270
+ static void SetFail()
271
+ {
272
+ _state = FetchState.Fail;
273
+ onAdapterInitCompleteCallback(false);
274
+ }
275
+
276
+ static Dictionary<string, string> JsonToDictionary(string json)
277
+ {
278
+ var dictResult = new Dictionary<string, string>();
279
+ string[] lines = json.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
280
+ for (int i = 0; i < lines.Length; i++)
281
+ {
282
+ int idx = lines[i].IndexOf(':');
283
+ if (idx < 0)
284
+ {
285
+ continue;
286
+ }
287
+ string key = lines[i].Substring(0, idx - 1).Trim().Trim('"');
288
+ string value = "";
289
+ if (idx == lines.Length - 1)
290
+ {
291
+ value = lines[i].Substring(idx + 1).Trim().Trim('"');
292
+ }
293
+ else
294
+ {
295
+ value = lines[i].Substring(idx + 1).Trim();
296
+ value = value.Substring(1, value.Length - 3);
297
+ }
298
+ dictResult[key] = value;
299
+ }
300
+ return dictResult;
301
+ }
302
+ }
303
+ }
304
+
305
+ public static class RemoteConfigExtension
306
+ {
307
+ public static void InitRemoteConfigModule(this IRemoteConfig ap, Action<bool> onCompleteCallback)
308
+ {
309
+ if (AmaGDK.RemoteConfig.State != AmaGDK.RemoteConfig.FetchState.None)
310
+ {
311
+ LogWarning($"[RemoteConfig] Current state {AmaGDK.RemoteConfig.State.ToString()}\n" +
312
+ $"Cannot start to initialize");
313
+ return;
314
+ }
315
+ AmaGDK.RemoteConfig.onAdapterInitCompleteCallback = onCompleteCallback;
316
+ AmaGDK.RemoteConfig.NextState();
317
+ }
318
+ }
319
+ }
320
+
321
+ namespace Amanotes.Core.Internal
322
+ {
323
+ [Serializable]
324
+ public class RemoteConfigConfig
325
+ {
326
+ public KeyValue[] defaultValue;
327
+ public float firstFetchTimeOutInSeconds = 10;
328
+ public float defaultTimeOutInSeconds = 3;
329
+ }
330
+
331
+ [Serializable]
332
+ public class KeyValue
333
+ {
334
+ public string key;
335
+ public string value;
336
+ }
337
+
338
+ public interface IRemoteConfig
339
+ {
340
+ void ResolveDependencies(Action<bool> onComplete);
341
+ void FetchConfig(bool isFirstTime, Action<bool, Dictionary<string, string>> onComplete);
342
+ }
343
+ }
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: ce8b955ef63a04f96b8402c5d9558928
2
+ guid: d81aa5ad940bd43139879d9d53e0e00b
3
3
  MonoImporter:
4
4
  externalObjects: {}
5
5
  serializedVersion: 2
@@ -16,6 +16,11 @@ namespace Amanotes.Core.Internal
16
16
  return Path.Combine(basePath, fileName);
17
17
  }
18
18
 
19
+ internal static bool Exist(string fileName)
20
+ {
21
+ return File.Exists(GetPath(fileName));
22
+ }
23
+
19
24
  internal static void Save(string fileName, string content)
20
25
  {
21
26
  if (string.IsNullOrWhiteSpace(fileName))
@@ -127,7 +132,7 @@ namespace Amanotes.Core.Internal
127
132
  {
128
133
  LogWarningOnce(path + "\n" + ex);
129
134
  }
130
- }
135
+ }
131
136
 
132
137
  private static string _basePath;
133
138
  private static string basePath
@@ -252,7 +257,7 @@ namespace Amanotes.Core.Internal
252
257
  return DictionaryToJson(new Dictionary<string, object>() { { key, value } });
253
258
  }
254
259
 
255
- public static string DictionaryToJson(IDictionary inputDict, bool format = false)
260
+ public static string DictionaryToJson(IDictionary inputDict, bool format = false, bool checkJsonInString = true)
256
261
  {
257
262
  if (inputDict == null)
258
263
  return "{}";
@@ -276,7 +281,7 @@ namespace Amanotes.Core.Internal
276
281
  jsonSb.Append(",");
277
282
 
278
283
  jsonSb.AppendFormat("{0}\"{1}\":", format ? "\n" : "", key);
279
- AppendJsonValue(ref jsonSb, key, value, format);
284
+ AppendJsonValue(ref jsonSb, key, value, format, checkJsonInString);
280
285
 
281
286
  }
282
287
 
@@ -299,7 +304,7 @@ namespace Amanotes.Core.Internal
299
304
 
300
305
  if (format)
301
306
  jsonSb.AppendLine();
302
- AppendJsonValue(ref jsonSb, key, item, format);
307
+ AppendJsonValue(ref jsonSb, key, item, format, false);
303
308
  }
304
309
 
305
310
  if (format)
@@ -309,36 +314,60 @@ namespace Amanotes.Core.Internal
309
314
  jsonSb.Append("]");
310
315
  }
311
316
 
312
- private static void AppendJsonValue(ref StringBuilder jsonSb, string key, object value, bool format)
317
+ private static void AppendJsonValue(ref StringBuilder jsonSb, string key, object value, bool format, bool checkJsonInString)
313
318
  {
314
319
  if (value == null)
315
320
  {
316
321
  jsonSb.Append("null");
322
+ return;
317
323
  }
324
+
318
325
  if (value is string)
319
326
  {
327
+ string s = value.ToString();
328
+ if (checkJsonInString)
329
+ {
330
+ if (s.StartsWith("{") && s.EndsWith("}"))
331
+ {
332
+ jsonSb.Append(s);
333
+ return;
334
+ }
335
+ if (s.StartsWith("[") && s.EndsWith("]"))
336
+ {
337
+ jsonSb.Append(s);
338
+ return;
339
+ }
340
+ }
341
+
320
342
  jsonSb.Append($"\"{value}\"");
343
+ return;
321
344
  }
322
- else if (value is int || value is float || value is double || value is long)
345
+
346
+ if (value is int || value is float || value is double || value is long)
323
347
  {
324
348
  jsonSb.Append($"{value}");
349
+ return;
325
350
  }
326
- else if (value is bool)
351
+
352
+ if (value is bool)
327
353
  {
328
354
  jsonSb.Append((bool)value ? "true" : "false");
355
+ return;
329
356
  }
330
- else if (value is IDictionary)
357
+
358
+ if (value is IDictionary)
331
359
  {
332
360
  jsonSb.Append($"{DictionaryToJson((IDictionary)value, format)}");
361
+ return;
333
362
  }
334
- else if (value is IList || value is Array)
363
+
364
+ if (value is IList || value is Array)
335
365
  {
336
366
  GetJsonIListValue(ref jsonSb, key, (IList)value, format);
367
+ return;
337
368
  }
338
- else
339
- {
340
- jsonSb.Append($"{JsonUtility.ToJson(value, format)}");
341
- }
369
+
370
+ jsonSb.Append($"{JsonUtility.ToJson(value, format)}");
342
371
  }
343
372
 
344
373
  //public static T[] FromJsonToArray<T>(string json)
@@ -57,9 +57,8 @@ namespace Amanotes.Core.Internal
57
57
  {"api-token", requestHeader}
58
58
  });
59
59
  yield return SendWebRequest();
60
-
61
- var httpError = result == Result.ConnectionError || result == Result.ProtocolError;
62
- if (httpError)
60
+
61
+ if (!string.IsNullOrEmpty(error))
63
62
  {
64
63
  LogWarning($"{url} returned {responseCode}: {error}");
65
64
  yield break;
@@ -117,16 +116,14 @@ namespace Amanotes.Core.Internal
117
116
  webRequest.downloadHandler = new DownloadHandlerBuffer();
118
117
  yield return webRequest.SendWebRequest();
119
118
 
120
- if (webRequest.result != UnityWebRequest.Result.Success)
119
+ if (!string.IsNullOrEmpty(webRequest.error))
121
120
  {
122
- onComplete?.Invoke(false, webRequest.error);
123
-
121
+ onComplete?.Invoke(false, webRequest.error);
124
122
  }
125
123
  else
126
124
  {
127
- onComplete?.Invoke(true, webRequest.downloadHandler.text);
128
- }
129
- yield return null;
125
+ onComplete?.Invoke(true, webRequest.downloadHandler.text);
126
+ }
130
127
  }
131
128
  }
132
129
  }
package/Runtime/AmaGDK.cs CHANGED
@@ -12,7 +12,7 @@ namespace Amanotes.Core
12
12
  {
13
13
  public partial class AmaGDK : MonoBehaviour
14
14
  {
15
- public const string VERSION = "0.1.20";
15
+ public const string VERSION = "0.1.21";
16
16
 
17
17
  internal static AmaGDK _instance;
18
18
  internal static event Action _frameUpdate;
@@ -88,16 +88,18 @@ namespace Amanotes.Core
88
88
  {
89
89
  Log($"Initing {adapter.adapterId} --> initOrder: {adapter.initOrder}");
90
90
  adapter.Init();
91
+ time = 0;
91
92
 
92
93
  while (!adapter.IsReady)
93
94
  {
94
95
  time += Time.deltaTime;
95
96
  yield return null;
96
97
  if (time <= timeout) continue;
97
- LogWarningOnce($"{adapter.adapterId} init time out: {timeout}");
98
+ LogWarning($"{adapter.adapterId} init time out: {timeout}");
99
+ break;
98
100
  }
99
101
 
100
- Log($"Adapter {adapter.adapterId} inited!");
102
+ Log(string.Format("Adapter {0} {1}", adapter.adapterId, adapter.IsReady ? "inited!" : "is not ready!"));
101
103
  }
102
104
 
103
105
  // Init modules (Adapter managers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2020.3",