File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -892,6 +892,23 @@ static firebase::AppOptions* AppOptionsLoadFromJsonConfig(const char* config) {
892
892
userAgentMap[libraryPrefix + " -buildsrc" ] =
893
893
Firebase.VersionInfo .BuildSource ;
894
894
895
+ try {
896
+ // FirebaseAI doesn't depend on the other platforms, so the heartbeat
897
+ // logic needs to check for it here, using reflection.
898
+ const string firebaseAIClassName = " Firebase.AI.FirebaseAI" ;
899
+ // Iterate over the loaded assemblies, since we don't have a known DLL name.
900
+ foreach (var assembly in System.AppDomain .CurrentDomain .GetAssemblies ()) {
901
+ System.Type foundType = assembly.GetType (firebaseAIClassName, throwOnError: false , ignoreCase: false );
902
+ if (foundType != null) {
903
+ // Found the class, add the FirebaseAI heartbeat to the user agent.
904
+ userAgentMap[" fire-vertex" ] = Firebase.VersionInfo .SdkVersion ;
905
+ break ;
906
+ }
907
+ }
908
+ } catch {
909
+ // Don't actually want to do anything if it fails
910
+ }
911
+
895
912
RegisterLibrariesInternal (userAgentMap);
896
913
}
897
914
You can’t perform that action at this time.
0 commit comments