1

I have found next: googlegmail:///co?subject=... The /co endpoint is the only one which works. My task is to open Gmail inbox with search parameters like from:, in: and others which are available in app. The problem is that I'm getting Unable to understand the link for every endpoint except /co. I have tried to find documentation. ChatGPT gives 404 link. In google documentation I found nothing (probably I'm blind:) ) Would be very respectful if someone can help me with finding working search endpoint. Thanks P.S I have tried it for IOS only and for the first time I'm looking for IOS solution

ChatGPT gave me next but search is not working:

*Here is a list of all the endpoints available for deep linking into the Gmail app on iOS:

googlegmail:/// - Open the Gmail app to the default view (i.e., the inbox). googlegmail:///co - Create a new email message. googlegmail:///search - Open the Gmail app to the search view with a specified query. Use the q parameter to specify the search query. googlegmail:///thread - Open a specific email thread. Use the th= parameter to specify the thread ID. googlegmail:///label - Open a specific label in the Gmail app. Use the label= parameter to specify the label name. For more information on using these endpoints, including the parameters and URL format for each endpoint, you can refer to the official documentation on Gmail iOS app deep linking.*

1 Answers1

1

I've used this bit of code in the past to open message sending. I believe Google does not support anything other than this, at least I couldn't find anything related on GitHub and in google search

private func openGmail(subject: String, body: String, recipients: [String]) -> Bool {
    var components = URLComponents(string: "googlegmail://co")!
    components.queryItems = [
      URLQueryItem(name: "to", value: recipients.joined(separator: ";")),
      URLQueryItem(name: "subject", value: subject),
      URLQueryItem(name: "body", value: body),
    ]

    if let url = components.url, UIApplication.shared.canOpenURL(url) {
      UIApplication.shared.open(url)
      return true
    }
    return false
}
Ivan Smetanin
  • 1,999
  • 2
  • 21
  • 28