简体   繁体   中英

How to navigate to iOS Native Add Contact Page in flutter?

I've been looking on how to get this done: I have a contact list with an "add contact" button. My goal is to open the native add contact page (mainly for iOS) when I click on that button.

I know how to call the method from flutter, but I don't know how to do the calling add contact screen with swift.

Any suggestions on how to do that?

Thanks

Ok so I figured things out, I still need to figure out how to make the cancel button work and create a link or something to go back to my app after the contact is added. But if someone needs it here's the code:

let con = CNContact()
let mainVC = CNContactViewController(forNewContact: con)
let navigationController = UINavigationController(rootViewController: mainVC)
          
self.window.rootViewController = navigationController
self.window.makeKeyAndVisible()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM