I am building an app and I want the user to be able to tap on a URL using the URL scheme and be sent to a specific view controller on my app. That is working OK. However, I also need to get specific data onto that view controller. I need it so that User A can send an invite (URL) through Messages to User B. User B can tap on that invite (URL) to open a screen with details about the invitation from Firebase. The user can then accept the invite, or decline the invite.
I have setup my database like so:
users(collection)
"uid"(document)
parties(collection)
"partyName"(document)
respondedYes(field)
respondedNo(field)
This is the code that is in the AppDelegate
for someone taps on a URL.
func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
// Open the RSVPViewController.
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let rsvpViewController = storyboard.instantiateViewController(withIdentifier: "RSVPViewController") as! RSVPViewController
if let window = self.window, let rootViewController = window.rootViewController {
var currentController = rootViewController
while let presentedController = currentController.presentedViewController {
currentController = presentedController
}
currentController.present(rsvpViewController, animated: true, completion: nil)
}
return true
}
I don't know how to get it so I know which invitation is being displayed after User B taps the URL so I cannot display the data. How can I get my app to work like I explained in my concept in the first paragraph? Let me know if you need more info. It is really hard to explain what I need help with.