dialogflow / dialogflow-apple-client

iOS SDK for Dialogflow
http://api.ai
Apache License 2.0
244 stars 65 forks source link

Welcome message #32

Open scinfu opened 7 years ago

scinfu commented 7 years ago

How to get welcome message?

magicmikek commented 6 years ago
let request = ApiAI.shared().textRequest()

        request?.query = "Hi"

        request?.setMappedCompletionBlockSuccess({(request, response) in
            let response = response as! AIResponse

            self.sendRobotText(response.result.fulfillment.speech)

        }, failure: {(request, error) in
            print("error")
        })

        ApiAI.shared().enqueue(request)

Just make a request with the Welcome Message and retrieve the request to greet the user. Or make your own.