Which view controller should I pass in my Swift native code for a Flutter plugin?

前端 未结 1 1825
南笙
南笙 2021-01-22 19:44

I am trying to show an Adcolony ad from Swift native code in my Flutter plugin, this is how my swift code looks like -

 if let interstitial = self.interstitial,         


        
相关标签:
1条回答
  • 2021-01-22 20:22

    Try this:

    if let vc = UIApplication.shared.delegate?.window??.rootViewController  as? FlutterViewController {
      interstitial.show(withPresenting: vc)
    }            
    
    0 讨论(0)
提交回复
热议问题