File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 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) {
892892 userAgentMap[libraryPrefix + " -buildsrc" ] =
893893 Firebase.VersionInfo .BuildSource ;
894894
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+
895912 RegisterLibrariesInternal (userAgentMap);
896913 }
897914
You can’t perform that action at this time.
0 commit comments