@@ -414,22 +414,33 @@ import Foundation
414414
415415 /// Set the screen name and its meta details from crossplatfrom services (Flutter & React Native agents)
416416 ///
417+ /// ONLY TO BE USED BY FLUTTER/REACT NATIVE AGENTS!
418+ ///
417419 /// This is exposed for internal use, for the communication between the instana agents, not to be consumed by developers
418420 /// Call this method from instana cross platform agents when need to provide auto capture of screen names and its meta details
419421 /// - Parameters:
420422 /// - name: The screen name identified from cross platform agents
421- /// - viewInternalMetaMap : Dictionary of keys and values of meta details from cross platform agents
423+ /// - viewInternalCPMetaMap : Dictionary of keys and values of meta details from CROSS PLATFORM agents
422424 @objc
423- public static func setViewMetaCPInternal( name: String , viewInternalMetaMap: [ String : String ] = [ : ] ) {
424- Instana . current? . setViewInternal ( name: name, viewInternalMetaMap: viewInternalMetaMap)
425+ public static func setViewMetaCPInternal( name: String , viewInternalCPMetaMap: [ String : String ] = [ : ] ) {
426+ var isAllKeyValid = true
427+ for key in viewInternalCPMetaMap. keys {
428+ if !internalMetaFlutterKeys. contains ( key) {
429+ isAllKeyValid = false
430+ break
431+ }
432+ }
433+ if isAllKeyValid {
434+ Instana . current? . setViewInternal ( name: name, viewInternalCPMetaMap: viewInternalCPMetaMap)
435+ }
425436 }
426437
427438 public func setViewInternal( name: String ? ,
428439 accessibilityLabel: String ? = nil ,
429440 navigationItemTitle: String ? = nil ,
430441 className: String ? = nil ,
431442 isSwiftUI: Bool = false ,
432- viewInternalMetaMap : [ String : String ] = [ : ] ) {
443+ viewInternalCPMetaMap : [ String : String ] = [ : ] ) {
433444 guard let propertyHandler = Instana . current? . session. propertyHandler else { return }
434445 let isIdentical = propertyHandler. properties. view? . isSame ( name: name,
435446 accessibilityLabel: accessibilityLabel,
@@ -441,7 +452,7 @@ import Foundation
441452 navigationItemTitle: navigationItemTitle,
442453 className: className,
443454 isSwiftUI: isSwiftUI,
444- viewInternalMetaMap : viewInternalMetaMap )
455+ viewInternalCPMetaMap : viewInternalCPMetaMap )
445456 propertyHandler. properties. view = view
446457
447458 guard view. viewName != nil else { return }
0 commit comments