Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

iMessage Apps

iMessage Apps

Fabricio Serralvo

December 06, 2017
Tweet

More Decks by Fabricio Serralvo

Other Decks in Programming

Transcript

  1. API

  2. let layout = MSMessageTemplateLayout() layout.image = UIImage(named: "coverImage") layout.caption =

    "Message In A Bottle" let message = MSMessage() message.layout = layout
  3. var components = URLComponents() components.queryItems = [ URLQueryItem(name: "songID", value:

    “92381”), URLQueryItem(name: "name", value: “Message In A Bottle") ] let message = MSMessage() message.url = components.url
  4. guard let conversation = activeConversation else { fatalError("Whooops, expected a

    conversation") } // iOS 10 API conversation.insert(message) { error in if let e = error { print(e) } } // iOS 11 API conversation.send(message) { error in if let e = error { print(e) } }
  5. guard let conversation = activeConversation else { fatalError("Whooops, expected a

    conversation") } let session = conversation.selectedMessage?.session ?? MSSession() let message = MSMessage(session: session)
  6. // Changing presentation style requestPresentationStyle(.expanded) // Messages Handling override func

    didSelect(_ message: MSMessage, conversation: MSConversation) { print("Items: \(message.url?.query ?? “Nope")") }
  7. // MSStickerBrowserViewDataSource override func numberOfStickers(in stickerBrowserView: MSStickerBrowserView) -> Int {

    return 5 } override func stickerBrowserView(_ stickerBrowserView: MSStickerBrowserView, stickerAt index: Int) -> MSSticker { // ... }